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/Backgrounds/SunkenSeaBurrowsBG0.png b/Backgrounds/SunkenSeaBurrowsBG0.png index 26ad2b3f50..21e7232442 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG0.png and b/Backgrounds/SunkenSeaBurrowsBG0.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG1.png b/Backgrounds/SunkenSeaBurrowsBG1.png index 452e46c78c..9756095977 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG1.png and b/Backgrounds/SunkenSeaBurrowsBG1.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG2.png b/Backgrounds/SunkenSeaBurrowsBG2.png index 3eb8e53eb6..21e7232442 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG2.png and b/Backgrounds/SunkenSeaBurrowsBG2.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG3.png b/Backgrounds/SunkenSeaBurrowsBG3.png index 13524864b4..55795c777e 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG3.png and b/Backgrounds/SunkenSeaBurrowsBG3.png differ 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 4b5ab5dba9..c1ecb0779f 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; @@ -36,10 +36,6 @@ namespace CalamityMod.Buffs { player.arrowDamage *= 0.955f; } - else if (type == BuffID.Ironskin) - { - player.statDefense += CalamityUtils.GetScalingDefense(-1) - 8; - } else if (type == BuffID.MagicPower) { player.GetDamage() -= 0.1f; @@ -93,10 +89,6 @@ namespace CalamityMod.Buffs { player.Calamity().shine = true; } - else if (type == BuffID.IceBarrier) - { - player.endurance -= 0.1f; - } // Beetle Shell DR is a full compensation, as the vanilla multiplicative DR is removed entirely. else if (type >= BuffID.BeetleEndurance1 && type <= BuffID.BeetleEndurance3 && player.beetleDefense) @@ -139,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; @@ -157,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; } } @@ -214,14 +200,6 @@ namespace CalamityMod.Buffs tip = tip.Replace("25", "15"); break; - case BuffID.Ironskin: - tip = tip.Replace("8", CalamityUtils.GetScalingDefense(-1).ToString()); - break; - - case BuffID.LeafCrystal: - tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.LeafCrystal"); - break; - case BuffID.MagicPower: tip = tip.Replace("20", "10"); break; 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/StatBuffs/Mushy.cs b/Buffs/StatBuffs/Mushy.cs index 23ae4f785c..c5c5fc1aa8 100644 --- a/Buffs/StatBuffs/Mushy.cs +++ b/Buffs/StatBuffs/Mushy.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.StatBuffs { public class Mushy : ModBuff { - public static int DefenseBoost = 8; + public static int DefenseBoost = 5; public static int RegenBoost = 2; public override LocalizedText Description => base.Description.WithFormatArgs(DefenseBoost, RegenBoost.ToRegenPerSecond()); diff --git a/Buffs/StatBuffs/SpiritDefense.cs b/Buffs/StatBuffs/SpiritDefense.cs index 664de50b2b..ad39d8d70d 100644 --- a/Buffs/StatBuffs/SpiritDefense.cs +++ b/Buffs/StatBuffs/SpiritDefense.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.StatBuffs { public class SpiritDefense : ModBuff { - public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost, SpiritGlyph.DamageReductionBoost.ToPercent()); + public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost); public override void SetStaticDefaults() { @@ -20,7 +20,6 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { player.statDefense += SpiritGlyph.DefenseBoost; - player.endurance += SpiritGlyph.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap? } } } 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 abd92b700e..021e94782a 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,15 +113,12 @@ 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; public double projectileDamageReduction = 0D; public int hellbornShots = 0; + public int garandShots = 0; public int searedPanCounter = 0; public int searedPanTimer = 0; /// Used to get around the hardcoded Potion Sickness duration to allow Hadal Stew's reduced duration. @@ -122,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; /// @@ -190,6 +195,13 @@ namespace CalamityMod.CalPlayer } public FishingMinigames SelectedFishingMinigame = FishingMinigames.None; 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 @@ -314,10 +326,13 @@ 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; + public int rOfResilienceCooldown = 0; public int rOfResilienceEffect = 0; public int rOfResilienceOrbitOffset = 0; @@ -349,10 +364,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; @@ -397,6 +412,8 @@ namespace CalamityMod.CalPlayer public bool canFireBloodflareRangedProjectile = false; public int consecutiveCaughtFish = 0; + public float WeakTimeFreezeUseTimer = 0; + public bool WeakTimeFreezeInUse = false; #endregion #region Sound @@ -420,7 +437,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"); @@ -574,7 +590,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 @@ -659,6 +674,8 @@ namespace CalamityMod.CalPlayer public bool roverDrive = false; public bool roverDriveShieldVisible = false; + internal float roverDriveShieldPartialRechargeProgress = 0f; + internal bool playedRoverDriveShieldSound = false; // Lunic Corps shield is controlled by its armor set bool // Lunic Corps shield comes from an armor set and its visibility is non optional @@ -781,8 +798,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; @@ -797,10 +812,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; @@ -817,12 +828,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; @@ -891,7 +904,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; @@ -943,15 +955,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; @@ -995,16 +1006,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; @@ -1065,7 +1076,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; @@ -1079,6 +1089,8 @@ namespace CalamityMod.CalPlayer /// Calamity's Silver armor set bonus; taking over 20 damage heals 10 health if the player avoids damage for 2 seconds. public bool silverMedkit = false; public int silverMedkitTimer = 0; + /// Calamity's Tungsten armor set bonus; makes grappling hooks fly and retract faster. + public bool tungstenArmorHookBoost = false; /// Calamity's Gold armor set bonus; makes enemies drop Gold Coins. public bool goldArmorGoldDrops = false; /// Calamity's Mining armor set bonus; gives a chance for extra items to drop when mining ores. @@ -1099,8 +1111,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; @@ -1135,7 +1151,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; @@ -1157,7 +1172,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; @@ -1196,8 +1210,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; @@ -1260,25 +1274,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; @@ -1289,9 +1303,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; @@ -1301,9 +1315,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; @@ -1460,21 +1474,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; @@ -1489,8 +1503,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; @@ -1691,6 +1703,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 @@ -1996,7 +2009,7 @@ namespace CalamityMod.CalPlayer public override void ResetEffects() { if (fleshKnuckles) - Player.statLifeMax2 += 45; + Player.statLifeMax2 += 25; int percentMaxLifeIncrease = 0; // Blood Pact and Chalice of the Blood God stack their HP bonuses if you want to equip both @@ -2147,7 +2160,6 @@ namespace CalamityMod.CalPlayer ataxiaBolt = false; ataxiaGeyser = false; - ataxiaFire = false; ataxiaVolley = false; ataxiaBlaze = false; ataxiaMage = false; @@ -2229,8 +2241,6 @@ namespace CalamityMod.CalPlayer cryogenSoul = false; ascendantInsignia = false; ascendantTrail = false; - frozenWingsCold = false; - flameWingsHeat = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; @@ -2318,14 +2328,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; @@ -2374,6 +2381,7 @@ namespace CalamityMod.CalPlayer forbiddenCirclet = false; silverMedkit = false; + tungstenArmorHookBoost = false; goldArmorGoldDrops = false; miningSet = false; @@ -2385,8 +2393,11 @@ namespace CalamityMod.CalPlayer necroSet = false; frostSet = false; - victideSet = false; - victideSummoner = false; + victideBarrierSet = false; + victideBarrierHead = false; + victideBurrowSet = false; + victideBurrowHead = false; + victideSnailSet = false; sulphurSet = false; @@ -2397,7 +2408,6 @@ namespace CalamityMod.CalPlayer titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; - titanHeartBoots = false; umbraphileSet = false; plagueReaper = false; plaguebringerPatronSet = false; @@ -2456,26 +2466,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; @@ -2485,9 +2495,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; @@ -2497,13 +2507,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; @@ -2547,8 +2564,6 @@ namespace CalamityMod.CalPlayer bloodfinBoost = false; divineBless = false; - killSpikyBalls = false; - vodka = false; redWine = false; grapeBeer = false; @@ -2609,11 +2624,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; @@ -2624,21 +2639,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; @@ -2739,7 +2753,6 @@ namespace CalamityMod.CalPlayer rageModeActive = false; adrenalineModeActive = false; - AdrenalineTrail = false; RageDuration = BalancingConstants.DefaultRageDuration; RageDamageBoost = BalancingConstants.DefaultRageDamageBoost; @@ -2785,14 +2798,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 @@ -2857,10 +2868,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; @@ -2904,11 +2915,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; @@ -2919,26 +2928,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; @@ -2948,9 +2957,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; @@ -2960,13 +2969,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 @@ -3087,6 +3102,7 @@ namespace CalamityMod.CalPlayer #region Armor Set Bonuses silverMedkit = false; silverMedkitTimer = 0; + tungstenArmorHookBoost = false; goldArmorGoldDrops = false; miningSet = false; miningSetCooldown = 0; @@ -3103,7 +3119,7 @@ namespace CalamityMod.CalPlayer silvaMage = false; silvaSummon = false; hasSilvaEffect = false; - silvaCountdown = silvaReviveDuration; + silvaCountdown = SilvaReviveDuration; auricSet = false; GemTechSet = false; CobaltSet = false; @@ -3135,7 +3151,6 @@ namespace CalamityMod.CalPlayer titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; - titanHeartBoots = false; titanCooldown = 0; umbraphileSet = false; fathomSwarmer = false; @@ -3153,7 +3168,6 @@ namespace CalamityMod.CalPlayer ataxiaMage = false; ataxiaBolt = false; ataxiaGeyser = false; - ataxiaFire = false; ataxiaVolley = false; ataxiaBlaze = false; hydrothermalSmoke = false; @@ -3167,7 +3181,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; @@ -3220,13 +3237,12 @@ namespace CalamityMod.CalPlayer CurrentlyViewedHologramText = string.Empty; #endregion - KameiBladeUseDelay = 0; - AdrenalineTrail = false; ascendantTrail = false; evilSmasherBoost = 0; burningSeaBurnOut = 0; flareGunOverheat = 0; hellbornShots = 0; + garandShots = 0; searedPanCounter = 0; searedPanTimer = 0; potionTimer = 0; @@ -3535,19 +3551,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(); } } @@ -3760,25 +3773,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); @@ -3897,12 +3934,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) @@ -3912,26 +3949,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 @@ -4263,6 +4357,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 @@ -4438,13 +4538,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) + @@ -4465,7 +4607,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) + @@ -4495,6 +4638,12 @@ namespace CalamityMod.CalPlayer else momentumCapacitorBoost = 0f; + if (victideBarrierHead) + { + Player.runAcceleration *= VictideHeadBarrier.RunAccelerationMult; + Player.runSlowdown *= VictideHeadBarrier.RunAccelerationMult; + } + Player.runAcceleration *= runAccMult; Player.maxRunSpeed *= runSpeedMult; } @@ -4519,7 +4668,7 @@ namespace CalamityMod.CalPlayer ModDashMovement(); } #endregion - + Player.oldVelocity = Player.velocity; // Apparently this value is not updated on its own, so we do it } #endregion @@ -4573,20 +4722,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 @@ -4600,7 +4740,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; } @@ -4762,10 +4902,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); @@ -4910,7 +5050,7 @@ namespace CalamityMod.CalPlayer { if (!Player.mount.Active) { - Player.velocity.Y *= 0.9f; + Player.velocity.Y *= SnowRuffianMask.GlideFallSpeedMult; Player.wingFrame = 3; } Player.noFallDmg = true; @@ -5198,7 +5338,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 }); } @@ -5284,8 +5424,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 cc4d2168a0..9dbd8affde 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -170,6 +170,8 @@ namespace CalamityMod.CalPlayer if (canSulphurFish && bait == ModContent.ItemType() && !BossRushEvent.BossRushActive) { CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType(), bait); + itemDrop = -1; + return; } if (attempt.playerFishingConditions.PoleItemType == ModContent.ItemType()) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index f80d30474b..0b4abb9fb1 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; @@ -31,6 +36,7 @@ using CalamityMod.NPCs.Other; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.SupremeCalamitas; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; @@ -244,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) { @@ -292,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; @@ -332,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); @@ -377,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)); } @@ -408,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)); } @@ -424,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)); } @@ -444,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)); } @@ -703,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; } } @@ -718,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) @@ -733,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) @@ -746,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) @@ -761,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) @@ -776,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) @@ -809,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) @@ -821,11 +829,6 @@ namespace CalamityMod.CalPlayer if (trinketOfChiBuff) contactDamageReduction += 0.08; - // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. - // To prevent abuse, this effect does not work if there are any bosses alive. - if (fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon)) - contactDamageReduction += 0.15; - if (abyssalDivingSuitPlates) contactDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay; @@ -874,7 +877,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; @@ -913,7 +916,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); @@ -953,6 +956,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); + } } } @@ -982,30 +1000,23 @@ namespace CalamityMod.CalPlayer // Reduce damage from vanilla traps // Explosives - // 350 in normal, 450 in expert + // 350 damage if (proj.type == ProjectileID.Explosives) - modifiers.SourceDamage *= (Main.expertMode ? 0.225f : 0.35f); + modifiers.SourceDamage *= 0.7f; // Rolling Cacti - // 45 in normal, 65 in expert for cactus - // 30 in normal, 36 in expert for spikes + // 42 in normal, 84 in expert for cactus + // 36 in normal, 72 in expert for spikes else if (proj.type == ProjectileID.RollingCactus || proj.type == ProjectileID.RollingCactusSpike) - modifiers.SourceDamage *= (Main.expertMode ? 0.3f : 0.5f); + modifiers.SourceDamage *= 0.6f; - // Normal Boulders and Temple traps - if (Main.expertMode) + // Boulders + if (Main.expertMode && !areThereAnyDamnBosses) { - // 140 in normal, 182 in expert, 273 in master - if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder) - modifiers.SourceDamage *= 0.65f; - - // 80 in normal, 100 in expert, 150 in master - else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.FlamesTrap || proj.type == ProjectileID.PoisonDartTrap) - modifiers.SourceDamage *= 0.625f; - - // 120 in normal, 144 in expert, 216 in master - else if (proj.type == ProjectileID.SpearTrap) - modifiers.SourceDamage *= 0.6f; + // 140 in normal, 210 in expert, 315 in master for boulder + // 104 in normal, 156 in expert, 234 in master for mini boulder + if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder || proj.type == ProjectileID.BouncyBoulder || proj.type == ProjectileID.LifeCrystalBoulder) + modifiers.SourceDamage *= 0.75f; } bool isFallingBlock = (proj.type == ProjectileID.SandBallFalling) || (proj.type == ProjectileID.SiltBall) || (proj.type == ProjectileID.AshBallFalling) || @@ -1022,7 +1033,7 @@ namespace CalamityMod.CalPlayer if (Player.Calamity().trapProtection && isReducedTrap) modifiers.SourceDamage *= 0.35f; - // Reduce damage dealt by rainbow trails depending on how faded they are. + // Reduce damage dealt by rainbow trails if (proj.type == ProjectileID.HallowBossLastingRainbow) { // Find the oldPos of the projectile that is intersecting the player hitbox. @@ -1037,11 +1048,10 @@ namespace CalamityMod.CalPlayer hitbox.X = (int)trailHitbox.X; hitbox.Y = (int)trailHitbox.Y; - // Adjust damage based on what part of the trail intersected the player hitbox. if (hitbox.Intersects(Player.Hitbox)) { if (k > startOfDamageFalloff) - modifiers.SourceDamage *= MathHelper.Lerp(0.4f, 1f, 1f - (k - startOfDamageFalloff) / (float)(trailLength - startOfDamageFalloff)); + modifiers.SourceDamage *= EmpressofLightAI.EverlastingRainbowTrailDamageMult; break; } @@ -1060,21 +1070,9 @@ 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; - // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. - // To prevent abuse, this effect does not work if there are any bosses alive. - if (fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon)) - projectileDamageReduction += 0.15; - if (abyssalDivingSuitPlates) projectileDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay; @@ -1141,7 +1139,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; @@ -1307,7 +1305,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; } @@ -1370,90 +1368,10 @@ namespace CalamityMod.CalPlayer { Player.AddBuff(BuffID.BrokenArmor, 600); } - else if (proj.type == ProjectileID.DeathLaser || proj.type == ProjectileID.RocketSkeleton || proj.type == ProjectileID.BombSkeletronPrime) - { - Player.AddBuff(BuffID.OnFire, 180); - } - else if (proj.type == ProjectileID.Skull) - { - Player.AddBuff(BuffID.Weak, 180); - } - else if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire) - { - // Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds) - Player.AddBuff(BuffID.CursedInferno, 60); - } else if (proj.type == ProjectileID.DesertDjinnCurse) { Player.AddBuff(BuffID.Cursed, 180); } - else if (proj.type == ProjectileID.Stinger || proj.type == ProjectileID.QueenBeeStinger) - { - // 66.6% chance of Poison for 5 seconds, 2 guaranteed seconds of Poison otherwise (vanilla also has a 33.3% chance of Poison for 10 seconds) - if (Main.rand.Next(3) > 0) - Player.AddBuff(BuffID.Poisoned, 300); - else - Player.AddBuff(BuffID.Poisoned, 120); - } - else if (proj.type == ProjectileID.PoisonSeedPlantera) - { - // 75% chance of Poison for 3 to 5 seconds, guaranteed Poison for 2 seconds (vanilla also has a 50% chance of Poison for 3 to 7 seconds) - if (Main.rand.Next(4) > 0) - Player.AddBuff(BuffID.Poisoned, Main.rand.Next(180, 301)); - else - Player.AddBuff(BuffID.Poisoned, 120); - } - else if (proj.type == ProjectileID.ThornBall) - { - Player.AddBuff(BuffID.Poisoned, 420); - } - else if (proj.type == ProjectileID.CultistBossFireBall) - { - Player.AddBuff(ModContent.BuffType(), 180); - } - else if (proj.type == ProjectileID.CultistBossIceMist) - { - if (!Player.frozen) - Player.AddBuff(BuffID.Frozen, 60); - - Player.AddBuff(BuffID.Chilled, 180); - } - else if (proj.type == ProjectileID.CultistBossLightningOrbArc) - { - Player.AddBuff(BuffID.Electrified, 180); - } - else if (proj.type == ProjectileID.AncientDoomProjectile) - { - Player.AddBuff(ModContent.BuffType(), 120); - } - else if (proj.type == ProjectileID.CultistBossFireBallClone) - { - Player.AddBuff(ModContent.BuffType(), 180); - } - else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye) - { - Player.AddBuff(ModContent.BuffType(), 120); - } - else if (proj.type == ProjectileID.PhantasmalSphere) - { - Player.AddBuff(ModContent.BuffType(), 210); - } - else if (proj.type == ProjectileID.PhantasmalDeathray) - { - Player.AddBuff(ModContent.BuffType(), 300); - } - else if ((proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore) && NPC.ShouldEmpressBeEnraged()) - { - Player.AddBuff(ModContent.BuffType(), 120); - } - else if (proj.type == ProjectileID.HallowBossLastingRainbow && NPC.ShouldEmpressBeEnraged()) - { - Player.AddBuff(ModContent.BuffType(), 210); - } - else if (proj.type == ProjectileID.FairyQueenSunDance && NPC.ShouldEmpressBeEnraged()) - { - Player.AddBuff(ModContent.BuffType(), 300); - } else if (proj.type == ProjectileID.BloodNautilusShot) { Player.AddBuff(ModContent.BuffType(), 240); @@ -1466,42 +1384,49 @@ namespace CalamityMod.CalPlayer { Player.AddBuff(ModContent.BuffType(), 600); } - } - // 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) + if (CalamityWorld.revenge) { - 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) + if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire) { - 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); + // Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds) + Player.AddBuff(BuffID.CursedInferno, 60); + } + else if (proj.type == ProjectileID.ThornBall) + { + Player.AddBuff(BuffID.Venom, 120); + } + else if (proj.type == ProjectileID.CultistBossFireBall) + { + Player.AddBuff(ModContent.BuffType(), 180); + } + else if (proj.type == ProjectileID.CultistBossIceMist && proj.ai[1] == 1f) // Main ice mists only; no shards + { + Player.AddBuff(BuffID.Chilled, 180); + } + else if (proj.type == ProjectileID.CultistBossLightningOrbArc) + { + Player.AddBuff(BuffID.Electrified, 180); + } + else if (proj.type == ProjectileID.CultistBossFireBallClone) + { + Player.AddBuff(ModContent.BuffType(), 240); + } + else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye) + { + Player.AddBuff(ModContent.BuffType(), 120); + } + else if (proj.type == ProjectileID.PhantasmalSphere) + { + Player.AddBuff(ModContent.BuffType(), 180); + } + else if (proj.type == ProjectileID.PhantasmalDeathray) + { + Player.AddBuff(ModContent.BuffType(), 240); } } } + if (NPC.AnyNPCs(ModContent.NPCType())) { Player.AddBuff(ModContent.BuffType(), 15, true); @@ -2125,10 +2050,9 @@ namespace CalamityMod.CalPlayer // Regardless of whether shields took damage, iterate over and stall all shield regen on ANY hit. // This applies even if you are hit while shields are fully down, or if you unequip any of the relevant items. { - // Rover Drive does not recharge while partially full, only when broken. - // If you are hit when recharging, though, that timer gets reset. - if (cooldowns.TryGetValue(WulfrumRoverDriveRecharge.ID, out var roverDriveRechargeCD)) - roverDriveRechargeCD.timeLeft = RoverDrive.ShieldRechargeTime; + // Set Rover Drive's recharge delay to full. Override any existing cooldown instance. + if (roverDrive) + Player.AddCooldown(WulfrumRoverDriveRecharge.ID, RoverDrive.ShieldRechargeDelay, true); // Set the Lunic Corps Armor's recharge delay to full. Override any existing cooldown instance. if (lunicCorpsSet) @@ -2318,9 +2242,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); } @@ -2470,11 +2400,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)) @@ -2593,13 +2523,13 @@ namespace CalamityMod.CalPlayer if (!canTriggerHitEffects) return; - if (aeroSet && hurtInfo.Damage > 25) + if (aeroSet && hurtInfo.Damage > AerospecBreastplate.SetBonusHurtDamageThreshold) { // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, AerospecBreastplate.FeatherEntitySourceContext); for (int n = 0; n < 4; n++) { - int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(30); + int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(AerospecBreastplate.SetBonusFeatherDamage); CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), featherDamage, 1f, Player.whoAmI); } @@ -2706,21 +2636,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; @@ -2728,17 +2655,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 f5db8c9911..bffd174336 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,46 +98,46 @@ 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(heavybleeding, 16, purity); - ApplyDoTDebuff(laceration, 24, purity); ApplyDoTDebuff(vaporfied, 8, purity); int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1); ApplyDoTDebuff(staticDischarge, staticDoT, purity); - ApplyDoTDebuff(bFlames, abaddon ? 10 : 20, purity); - ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player - ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 15 : 30, purity); - ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 15 : 30, purity); - ApplyDoTDebuff(hFlames, 24, purity); - ApplyDoTDebuff(voidfrost, 30, purity); - ApplyDoTDebuff(vHex, 24); - ApplyDoTDebuff(trueVHex, 36); - ApplyDoTDebuff(cDepth, 15, purity); - ApplyDoTDebuff(astralInfection, 18, infectedJewel || hideOfDeus || purity); - ApplyDoTDebuff(hPressure, 30, purity); - ApplyDoTDebuff(pFlames, alchFlask ? 12 : 24, purity); - ApplyDoTDebuff(cragsLava, 30); // Being literally submerged in crags lava should do more than brimstone flames + ApplyDoTDebuff(heavybleeding, 16, purity); + ApplyDoTDebuff(crushDepth, 18, purity); + ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player - ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player + ApplyDoTDebuff(brimstoneFlames, abaddon ? 15 : 30, purity); + ApplyDoTDebuff(plague, alchFlask ? 15 : 30, purity); + ApplyDoTDebuff(vHex, 30); // Has other effects + ApplyDoTDebuff(searingLava, 30); + ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player + ApplyDoTDebuff(laceration, 36, purity); + ApplyDoTDebuff(daybroken, 40, purity); + ApplyDoTDebuff(nightwither, 40, purity); + ApplyDoTDebuff(holyFlames, 40, purity); + ApplyDoTDebuff(voidfrost, 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 ? 45 : 35); + ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40); int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1); ApplyDoTDebuff(vermillionFlux, fluxDoT); - int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 240 : 40) / (dynamoStemCells ? 2 : 1); + ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player + ApplyDoTDebuff(trueVHex, 50); + int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1); ApplyDoTDebuff(dragonFire, dragonfireDoT); - int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 75 : 15) / (eleResist ? 2 : 1); + ApplyDoTDebuff(miracleBlight, 60); + ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player + int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16) / (eleResist ? 2 : 1); ApplyDoTDebuff(auricRebuke, rebukeDoT); - ApplyDoTDebuff(miracleBlight, 50); // Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player takes damage and the meter resets. bool nearSafeZone = false; @@ -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,10 +375,10 @@ 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 < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; Player.lifeRegen += 6; } @@ -391,8 +387,8 @@ namespace CalamityMod.CalPlayer if (rOoze || aAmpoule || purity) { float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2; - //Ambrosial Ampule and ooze give between 2 and 6 hp/s - int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp((purity || aAmpoule? 2f : 4f), (purity || aAmpoule ? 10f : 12f), missingLifeRatio));//Rounding is needed for it to ever actually give +6 hp/s, as the integer conversion would otherwise floor it. + //Ambrosial Ampule and ooze give between 2 and 5 hp/s + int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp((purity || aAmpoule? 2f : 4f), (purity || aAmpoule ? 8f : 10f), missingLifeRatio));//Rounding is needed for it to ever actually give +5 hp/s, as the integer conversion would otherwise floor it. Player.lifeRegen += lifeRegenToGive; radiantOozeRegen += lifeRegenToGive / 2f; ambrosialAmpouleRegen += lifeRegenToGive / 2f; @@ -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) @@ -419,10 +415,7 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) Player.Heal(1); - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; - - intendedPurityDefense = 20 + (currentDebuffs - 1) * 8; + intendedPurityDefense = 15 + (currentDebuffs - 1) * 5; if (jewelBonusDefense < intendedPurityDefense) jewelBonusDefense = intendedPurityDefense; @@ -457,14 +450,12 @@ 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; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; - intendedJewelDefense = 16 + (currentDebuffs - 1) * 5; + intendedJewelDefense = 12 + (currentDebuffs - 1) * 4; if (jewelBonusDefense < intendedJewelDefense) jewelBonusDefense = intendedJewelDefense; } @@ -483,13 +474,9 @@ 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 any debuff is detected, provide even more life regen + if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i])) Player.lifeRegen += 3; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; - } } #endregion @@ -525,7 +512,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegenCount = 0; } - if (hInferno) + if (holyInferno) { Player.nebulaLevelLife = 0; @@ -651,7 +638,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; @@ -676,8 +663,8 @@ namespace CalamityMod.CalPlayer { Player.lifeRegen += 7; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; Player.lifeRegenTime += 4; } @@ -696,15 +683,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; @@ -748,9 +726,9 @@ namespace CalamityMod.CalPlayer if (turboRegenPower > 0) { - // After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600. - if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f) - Player.lifeRegenTime = 1800f; + // After a brief delay determined by your form of standing still regen, min-cap life regen time at 900 / 3600. + if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 900f) + Player.lifeRegenTime = 900f; Player.lifeRegen += turboRegenPower; Player.lifeRegenTime += turboRegenPower; @@ -763,13 +741,13 @@ namespace CalamityMod.CalPlayer if (regenerator) // Gives special regen of it's own, but disables all regular life regen { - if (Player.miscCounter % 7 == 0 && Player.statLife < (int)(Player.statLifeMax2 * 0.5f)) + if (Player.miscCounter % Regenerator.FramesPerHeal == 0 && Player.statLife < (int)(Player.statLifeMax2 * 0.5f)) Player.HealPlayer(1, HealTextType.None); // Boost life regen time quite a bit. // This is so that in events and such where small hits are common, your damage boost isn't completley negated if (Player.lifeRegenTime < 3600) - Player.lifeRegenTime += 10; + Player.lifeRegenTime += Regenerator.RegenTimeBoost; } else regeneratorDamage = 0; @@ -838,7 +816,7 @@ namespace CalamityMod.CalPlayer if (Player.palladiumRegen) finalRegen += 4; - regeneratorDamage = (finalRegen * 1.75f) * 0.01f; + regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio; Player.GetDamage() += regeneratorDamage; if (Player.lifeRegen > 0) @@ -848,11 +826,11 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenCount > 0) Player.lifeRegenCount = 0; - //Hard-lock the player's health to 50%. + //Hard-lock the player's health to a certain ratio. //No lifesteal, no regen, no healing pots - if (Player.statLife >= (int)(Player.statLifeMax2 * 0.5f)) + if (Player.statLife >= (int)(Player.statLifeMax2 * Regenerator.HealthRatioCap)) { - Player.statLife = (int)(Player.statLifeMax2 * 0.5f); + Player.statLife = (int)(Player.statLifeMax2 * Regenerator.HealthRatioCap); Player.moonLeech = true; healingPotionMultiplier = 0; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 863c6c0d4d..ffa976b477 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -17,12 +17,15 @@ using CalamityMod.ExtraTextures; using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; +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; @@ -201,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++; @@ -221,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; @@ -294,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) @@ -510,8 +512,8 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { int hasBuff = Player.buffType[l]; - if (Player.buffTime[l] > 360 && hasBuff == BuffID.ShadowDodge) - Player.buffTime[l] = 360; + if (Player.buffTime[l] > 600 && hasBuff == BuffID.ShadowDodge) + Player.buffTime[l] = 600; } } @@ -627,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; } } @@ -914,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++) @@ -947,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++) @@ -965,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) { @@ -1142,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]--; } } @@ -1156,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. @@ -1177,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); } @@ -1203,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--; @@ -1293,18 +1310,16 @@ namespace CalamityMod.CalPlayer if (!Player.wet) { if (aeroSet) - Player.maxFallSpeed = 15f; + Player.maxFallSpeed = AerospecBreastplate.SetBonusFallSpeed; if (Player.PortalPhysicsEnabled) 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) @@ -1325,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; } @@ -1530,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--; @@ -1806,7 +1815,7 @@ namespace CalamityMod.CalPlayer { if (dOfTheDeepDefenseBuffTimer > 0) { - int maxDefense = 15; + int maxDefense = 10; int givenDefense = (int)Utils.Remap(dOfTheDeepDefenseBuffTimer, 0, dOfTheDeepDefenseBuffMax * 0.5f, 0, maxDefense); Player.statDefense += givenDefense; dOfTheDeepDefenseBuffTimer--; @@ -1872,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) { @@ -2035,8 +2079,6 @@ namespace CalamityMod.CalPlayer phantomicHeartRegen--; if (phantomicBulwarkCooldown > 0) phantomicBulwarkCooldown--; - if (KameiBladeUseDelay > 0) - KameiBladeUseDelay--; if (galileoCooldown > 0) galileoCooldown--; if (gladiatorTimer > 0) @@ -2078,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) @@ -2097,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; @@ -2138,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) @@ -2198,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; @@ -2297,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 @@ -2369,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; @@ -2449,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; } } @@ -2499,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; @@ -2518,7 +2574,7 @@ namespace CalamityMod.CalPlayer if (Player.isNearFairy()) { Player.lifeRegen += 4; - Player.statDefense += 10; + Player.statDefense += 6; Player.moveSpeed += 0.1f; } } @@ -2542,7 +2598,7 @@ namespace CalamityMod.CalPlayer if (affliction || afflicted) { Player.endurance += 0.07f; - Player.statDefense += 13; + Player.statDefense += 9; Player.GetDamage() += 0.1f; } @@ -2582,7 +2638,7 @@ namespace CalamityMod.CalPlayer // Permafrost's Concoction bonuses/debuffs if (permafrostsConcoction) { - Player.manaCost *= 0.85f; + Player.manaCost -= 0.15f; Player.statManaMax2 += 50; } @@ -2772,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) { @@ -2809,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) { @@ -2962,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; @@ -2978,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) @@ -2991,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); } } @@ -3041,7 +3097,7 @@ namespace CalamityMod.CalPlayer abyssDeath = false; // Signus headcrab darkness - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (CalamityGlobalNPC.signus != -1) { @@ -3149,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) * 50f); + 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)) { @@ -3321,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) @@ -3349,7 +3405,7 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += 0.12f; Player.GetKnockback() += 1.2f; if (Main.eclipse || !Main.dayTime) - Player.statDefense += Main.eclipse ? 10 : 20; + Player.statDefense += Main.eclipse ? 8 : 16; } if (AbsorberRegen) @@ -3396,7 +3452,7 @@ namespace CalamityMod.CalPlayer if (tortShellPostHit > 0) { - Player.statDefense -= 8; + Player.statDefense -= 6; tortShellPostHit--; } else @@ -3514,7 +3570,7 @@ namespace CalamityMod.CalPlayer if (starBeamRye) { Player.GetDamage() += StarBeamRye.MagicDamageBoost; - Player.manaCost *= (1f - StarBeamRye.ManaCostReduction); + Player.manaCost -= StarBeamRye.ManaCostReduction; Player.statManaMax2 += StarBeamRye.MaxManaBoost; } @@ -3545,7 +3601,7 @@ namespace CalamityMod.CalPlayer } } - if (HighTestFishingPoleList.Includes(Player.ActiveItem().type)) + if (CalamityItemSets.FishingPoleThatNeverBreaks[Player.ActiveItem().type]) Player.accFishingLine = true; if (planarSpeedBoost != 0) @@ -3574,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; @@ -3600,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) @@ -3654,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; @@ -3755,7 +3811,7 @@ namespace CalamityMod.CalPlayer if (Player.statLife > (int)(Player.statLifeMax2 * 0.5)) Player.GetDamage() += 0.1f; if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) - Player.statDefense += 20; + Player.statDefense += 15; } if (vexation) @@ -3765,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); } @@ -3821,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; } } @@ -3886,20 +3943,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) { @@ -3940,7 +3995,7 @@ namespace CalamityMod.CalPlayer if (eArtifact) { - Player.manaCost *= 0.75f; + Player.manaCost -= 0.25f; Player.maxMinions++; } @@ -4281,7 +4336,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) { @@ -4298,7 +4353,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; } } @@ -4346,7 +4401,7 @@ namespace CalamityMod.CalPlayer // Also gives acceleration, which is done in PostUpdateRunSpeeds break; case BuffID.Ichor: - Player.statDefense += 40; // +25 net defense + Player.statDefense += 20; // +10 net defense break; case BuffID.Bleeding: Player.bleed = false; @@ -4364,7 +4419,7 @@ namespace CalamityMod.CalPlayer case BuffID.Weak: Player.GetDamage() += 0.051f; // Cancel melee damage nerf, add 10% all damage Player.GetDamage() += 0.1f; - Player.statDefense += 14; // +10 net defense + Player.statDefense += 10; // +6 net defense Player.moveSpeed += 0.25f; // +15% net move speed break; case BuffID.Slow: @@ -4373,7 +4428,7 @@ namespace CalamityMod.CalPlayer break; case BuffID.Confused: Player.confused = false; - Player.statDefense += 50; + Player.statDefense += 15; break; case BuffID.Cursed: Player.cursed = false; @@ -4611,7 +4666,10 @@ namespace CalamityMod.CalPlayer { if (cooldowns.TryGetValue(WulfrumRoverDriveDurability.ID, out var cdDurability)) cdDurability.timeLeft = 0; - // if (cooldowns.TryGetValue(WulfrumRoverDriveRecharge.ID, out var cdRecharge)) cdRecharge.timeLeft = 0; + + // As Rover Drive's shield can be left in a partially recharged state, this is for safety. + // If the player does not have the accessory equipped for even one frame, discharge all shields. + RoverDriveShieldDurability = 0; } // Stuff to do if the Rover Drive is equipped @@ -4619,16 +4677,38 @@ namespace CalamityMod.CalPlayer { // If the Rover Drive shield is discharged and hasn't started its recharge delay, start that. if (RoverDriveShieldDurability == 0 && !cooldowns.ContainsKey(WulfrumRoverDriveRecharge.ID)) - Player.AddCooldown(WulfrumRoverDriveRecharge.ID, RoverDrive.ShieldRechargeTime); + Player.AddCooldown(WulfrumRoverDriveRecharge.ID, RoverDrive.ShieldRechargeDelay); - // If the shield has greater than zero durability but that durability is not on the cooldown rack, - // add it to the cooldown rack and play a sound of the shield turning on. + // If the shield has greater than zero durability but that durability is not on the cooldown rack, add it to the cooldown rack. if (RoverDriveShieldDurability > 0 && !cooldowns.ContainsKey(WulfrumRoverDriveDurability.ID)) { CooldownInstance durabilityCooldown = Player.AddCooldown(WulfrumRoverDriveDurability.ID, RoverDrive.ShieldDurabilityMax); durabilityCooldown.timeLeft = RoverDriveShieldDurability; } + // If the shield has greater than zero durability and isn't in its recharge delay, actively replenish shield points. + // Play a sound on the first frame this occurs. + if (RoverDriveShieldDurability > 0 && !cooldowns.ContainsKey(WulfrumRoverDriveRecharge.ID)) + { + if (!playedRoverDriveShieldSound) + SoundEngine.PlaySound(RoverDrive.ActivationSound, Player.Center); + playedRoverDriveShieldSound = true; + + // This number is not an integer, and stores exact per-frame recharge progress. + roverDriveShieldPartialRechargeProgress += RoverDrive.ShieldDurabilityMax / (float)RoverDrive.TotalShieldRechargeTime; + + // Floor the value to get whole number of shield points recharged this frame. + int pointsActuallyRecharged = (int)MathF.Floor(roverDriveShieldPartialRechargeProgress); + + // Give those points to the real shield durability, capping the result. Then remove them from recharge progress. + RoverDriveShieldDurability = Math.Min(RoverDriveShieldDurability + pointsActuallyRecharged, RoverDrive.ShieldDurabilityMax); + roverDriveShieldPartialRechargeProgress -= pointsActuallyRecharged; + + // Update the cooldown rack's durability indicator. + if (cooldowns.TryGetValue(WulfrumRoverDriveDurability.ID, out var cdDurability)) + cdDurability.timeLeft = RoverDriveShieldDurability; + } + // Add light if this shield is currently active if (RoverDriveShieldDurability > 0 && !shieldAddedLight) { @@ -4791,30 +4871,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/CombHairSparkleLayer.cs b/CalPlayer/DrawLayers/CombHairSparkleLayer.cs index 18ca428d85..e2525ac081 100644 --- a/CalPlayer/DrawLayers/CombHairSparkleLayer.cs +++ b/CalPlayer/DrawLayers/CombHairSparkleLayer.cs @@ -60,10 +60,14 @@ namespace CalamityMod.CalPlayer.DrawLayers { for (int j = TopRange; j <= BottomRange; j++) { + Tile tile = Main.tile[i, j]; + if (!tile.HasTile || !TileID.Sets.IsAContainer[tile.TileType] || TileID.Sets.BasicDresser[tile.TileType]) + continue; + int PotentialChest = Chest.FindChestByGuessing(i, j); - if (PotentialChest != -1 && !TileID.Sets.BasicDresser[Main.tile[i, j].TileType]) + if (PotentialChest != -1) { - // Adjust position ot the center of the chest + // Adjust position to the center of the chest Chest chest = Main.chest[PotentialChest]; Vector2 chestCenter = new Vector2(chest.x + 1, chest.y + 1) * 16f; float distance = Vector2.Distance(chestCenter, drawPlayer.MountedCenter); 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 50d1ea2d39..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,36 +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 Multi-Threading Settings - [Header("Multithreading")] - - [BackgroundColor(192, 54, 64, 192)] - [SliderColor(224, 165, 56, 128)] - [Range(0f, 2f)] - [DefaultValue(0f)] - [Increment(1f)] - [DrawTicks] - public float SunkenSeaMultiThreading { get; set; } - #endregion - #region Graphics Changes [Header("Graphics")] @@ -299,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.cs b/CalamityMod.cs index 6a5df844d4..88ad657958 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -34,7 +34,7 @@ namespace CalamityMod public override void Load() { // Initialize the EnemyStats struct as early as it is safe to do so - NPCStats.Load(); + NPCStats.LoadDebuffs(); // Initialize Calamity Balance, since it is tightly coupled with the remaining systems CalamityGlobalItem.LoadTweaks(); @@ -58,7 +58,7 @@ namespace CalamityMod #region Unload public override void Unload() { - NPCStats.Unload(); + NPCStats.UnloadDebuffs(); CalamityGlobalItem.UnloadTweaks(); CalamityGlobalProjectile.UnloadTweaks(); 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/M1GarandShots.cs b/Cooldowns/M1GarandShots.cs new file mode 100644 index 0000000000..200f8d1c05 --- /dev/null +++ b/Cooldowns/M1GarandShots.cs @@ -0,0 +1,43 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.GameContent; +using Terraria.Localization; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Cooldowns +{ + public class M1GarandShots : CooldownHandler + { + public float CompletionPercentage => MathF.Round(instance.Completion * 100); + private bool IsEmpty => CompletionPercentage == 100; + private float TextXOffset => -5.4f; + private Vector2 TextPosition => new(TextXOffset, 15); + private Color TextColor => Color.Silver; + private Color TextBorderColor = Color.DarkGoldenrod; + + public static new string ID => "M1GarandShots"; + public override bool CanTickDown => false; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override bool ShouldDisplay => instance.player.HeldItem.type == ItemType(); + public override string Texture => "CalamityMod/Cooldowns/" + ID; + + public override Color CooldownStartColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.DarkGoldenrod, Color.SlateGray, instance.Completion); + public override Color CooldownEndColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.LightGoldenrodYellow, Color.SlateGray, instance.Completion); + + public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawExpanded(spriteBatch, position, opacity, scale); + + CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.player.Calamity().garandShots.ToString(), position + TextPosition, TextColor, TextBorderColor); + } + + public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawCompact(spriteBatch, position, opacity, scale); + + CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.player.Calamity().garandShots.ToString(), position + TextPosition, TextColor, TextBorderColor); + } + } +} diff --git a/Cooldowns/M1GarandShots.png b/Cooldowns/M1GarandShots.png new file mode 100644 index 0000000000..b50e512ae9 Binary files /dev/null and b/Cooldowns/M1GarandShots.png differ diff --git a/Cooldowns/M1GarandShotsOutline.png b/Cooldowns/M1GarandShotsOutline.png new file mode 100644 index 0000000000..495f87eb5c Binary files /dev/null and b/Cooldowns/M1GarandShotsOutline.png differ diff --git a/Cooldowns/M1GarandShotsOverlay.png b/Cooldowns/M1GarandShotsOverlay.png new file mode 100644 index 0000000000..4d8b9e04e8 Binary files /dev/null and b/Cooldowns/M1GarandShotsOverlay.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/Cooldowns/WulfrumRoverDriveCooldowns.cs b/Cooldowns/WulfrumRoverDriveCooldowns.cs index e4c6485992..9df995f04a 100644 --- a/Cooldowns/WulfrumRoverDriveCooldowns.cs +++ b/Cooldowns/WulfrumRoverDriveCooldowns.cs @@ -91,12 +91,14 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + public override void Tick() => instance.player.Calamity().playedRoverDriveShieldSound = false; + // Rover Drive shields are recharged as a side effect of the cooldown completing client side public override void OnCompleted() { CalamityPlayer modPlayer = instance.player.Calamity(); - if (modPlayer.roverDrive) - modPlayer.RoverDriveShieldDurability = RoverDrive.ShieldDurabilityMax; + if (modPlayer.RoverDriveShieldDurability <= 0) + modPlayer.RoverDriveShieldDurability = 1; } public override SoundStyle? EndSound => RoverDrive.ActivationSound; public override bool ShouldPlayEndSound => instance.player.Calamity().roverDrive; diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs new file mode 100644 index 0000000000..44e01e60ca --- /dev/null +++ b/DataStructures/DebuffData.cs @@ -0,0 +1,426 @@ +using System; +using System.Diagnostics; +using System.Security.Cryptography; +using CalamityMod.NPCs; +using Microsoft.Xna.Framework; +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; + } + /// + /// Applies a scaling amount to a StatModifier but ensures all changes end up positive + /// + /// + /// + /// + public static StatModifier ForceModifierPositiveWithScaling(StatModifier Modifer, float scaling) + { + StatModifier output = new(); + output += MathHelper.Max((Modifer.Additive - 1) * scaling,0); + output *= MathHelper.Max(1 + (Modifer.Multiplicative - 1) * scaling,1); + output.Base = MathHelper.Max(Modifer.Base * scaling,0); + output.Flat = MathHelper.Max(Modifer.Flat * scaling, 0); + 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/NPCStats.cs b/DataStructures/NPCStats.cs deleted file mode 100644 index dde90afc67..0000000000 --- a/DataStructures/NPCStats.cs +++ /dev/null @@ -1,841 +0,0 @@ -using System; -using System.Collections.Generic; -using CalamityMod.NPCs.AcidRain; -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.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.StormWeaver; -using CalamityMod.NPCs.SupremeCalamitas; -using CalamityMod.NPCs.Yharon; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.World; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod -{ - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static partial class NPCStats - { - private const double ExpertContactVanillaMultiplier = 2D; - private const double MasterContactVanillaMultiplier = 3D; - private const double NormalProjectileVanillaMultiplier = 2D; - private const double ExpertProjectileVanillaMultiplier = 4D; - private const double MasterProjectileVanillaMultiplier = 6D; - - #region Enemy Stats Container Struct - internal partial struct EnemyStats - { - public static SortedDictionary ExpertDamageMultiplier; - public static SortedDictionary ContactDamageValues; - public static SortedDictionary, int[]> ProjectileDamageValues; - }; - #endregion - - #region Stat Retrieval Methods - public static void GetNPCDamage(this NPC npc) - { - double damageAdjustment = GetExpertDamageMultiplier(npc) * (Main.masterMode ? MasterContactVanillaMultiplier : ExpertContactVanillaMultiplier); - - // Safety check: If for some reason the contact damage array is not initialized yet, set the NPC's damage to 1. - bool exists = EnemyStats.ContactDamageValues.TryGetValue(npc.type, out int[] contactDamage); - if (!exists) - npc.damage = 1; - - int normalDamage = contactDamage[0]; - int expertDamage = contactDamage[1] == -1 ? -1 : (int)Math.Round(contactDamage[1] / damageAdjustment); - int revengeanceDamage = contactDamage[2] == -1 ? -1 : (int)Math.Round(contactDamage[2] / damageAdjustment); - int masterDamage = contactDamage[3] == -1 ? -1 : (int)Math.Round(contactDamage[3] / damageAdjustment); - - // If the assigned value would be -1, don't actually assign it. This allows for conditionally disabling the system. - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage; - if (damageToUse != -1) - npc.damage = damageToUse; - } - - // Gets the amount of damage a given projectile should do from this NPC. - // Automatically compensates for Terraria's internal spaghetti scaling. - public static int GetProjectileDamage(this NPC npc, int projType) - { - double damageAdjustment = Main.masterMode ? MasterProjectileVanillaMultiplier : Main.expertMode ? ExpertProjectileVanillaMultiplier : NormalProjectileVanillaMultiplier; - - // Safety check: If for some reason the projectile damage array is not initialized yet, return 1. - bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple(npc.type, projType), out int[] projectileDamage); - if (!exists) - return 1; - - int normalDamage = (int)Math.Round(projectileDamage[0] / damageAdjustment); - int expertDamage = (int)Math.Round(projectileDamage[1] / damageAdjustment); - int revengeanceDamage = (int)Math.Round(projectileDamage[2] / damageAdjustment); - int masterDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment); - - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage; - - return damageToUse; - } - - // Gets the amount of damage this projectile should do from a given NPC. - // Automatically compensates for Terraria's internal spaghetti scaling. - public static int GetProjectileDamage(this Projectile projectile, int npcType) - { - double damageAdjustment = Main.masterMode ? MasterProjectileVanillaMultiplier : Main.expertMode ? ExpertProjectileVanillaMultiplier : NormalProjectileVanillaMultiplier; - - // Safety check: If for some reason the projectile damage array is not initialized yet, return 1. - bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple(npcType, projectile.type), out int[] projectileDamage); - if (!exists) - return 1; - - int normalDamage = (int)Math.Round(projectileDamage[0] / damageAdjustment); - int expertDamage = (int)Math.Round(projectileDamage[1] / damageAdjustment); - int revengeanceDamage = (int)Math.Round(projectileDamage[2] / damageAdjustment); - int masterDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment); - - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage; - - return damageToUse; - } - - // Gets the raw amount of damage a projectile should do from this NPC. - // That is, this doesn't adjust the value to compensate for Terraria's internal spaghetti scaling. - public static int GetProjectileDamageNoScaling(this NPC npc, int projType) - { - bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple(npc.type, projType), out int[] projectileDamage); - return !exists ? 1 // Base case for safety, in case the array is not initialized yet. - : Main.masterMode ? projectileDamage[3] - : CalamityWorld.revenge ? projectileDamage[2] - : Main.expertMode ? projectileDamage[1] - : projectileDamage[0]; - } - - /// - /// Gets the Expert/Master Mode damage multiplier for the specified boss NPC. - /// Useful for determining the base damage a boss NPC should have prior to being run through the Expert/Master scaling code. - /// - /// The NPC you want to get the damage multiplier for - /// Whether Master Mode is enabled or not - /// - public static double GetExpertDamageMultiplier(this NPC npc, bool? master = null) - { - bool exists = EnemyStats.ExpertDamageMultiplier.TryGetValue(npc.type, out double damageMult); - return exists ? damageMult : 1D; - } - #endregion - - #region Load/Unload - internal static void Load() - { - LoadEnemyStats(); - LoadDebuffs(); - } - internal static void Unload() - { - UnloadEnemyStats(); - UnloadDebuffs(); - } - - // A static function, called exactly once, which initializes the EnemyStats struct at a predictable time. - // This is necessary to ensure this dictionary is populated as early as possible. - internal static void LoadEnemyStats() - { - EnemyStats.ExpertDamageMultiplier = new SortedDictionary - { - { NPCID.KingSlime, 0.8 }, - - { ModContent.NPCType(), 1.1 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.EaterofWorldsHead, 1.1 }, - { NPCID.EaterofWorldsBody, 0.8 }, - { NPCID.EaterofWorldsTail, 0.8 }, - - { NPCID.BrainofCthulhu, 0.9 }, - - { ModContent.NPCType(), 0.9 }, - - { ModContent.NPCType(), 0.9 }, - - { NPCID.QueenBee, 0.9 }, - { NPCID.Bee, 0.6 }, - { NPCID.BeeSmall, 0.6 }, - - { NPCID.SkeletronHead, 1.1 }, - { NPCID.SkeletronHand, 1.1 }, - - { NPCID.WallofFlesh, 1.5 }, - { NPCID.WallofFleshEye, 1.5 }, - - { ModContent.NPCType(), 1.15 }, - - { NPCID.Spazmatism, 0.85 }, - { NPCID.Retinazer, 0.85 }, - - { ModContent.NPCType(), 1.1 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { NPCID.TheDestroyer, 2 }, - { NPCID.TheDestroyerBody, 0.85 }, - { NPCID.TheDestroyerTail, 0.85 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.SkeletronPrime, 0.85 }, - { NPCID.PrimeCannon, 0.85 }, - { NPCID.PrimeLaser, 0.85 }, - { NPCID.PrimeSaw, 0.85 }, - { NPCID.PrimeVice, 0.85 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.Plantera, 1.15 }, - { NPCID.PlanterasTentacle, 1.15 }, - { ModContent.NPCType(), 1.15 }, - - { NPCID.HallowBoss, 0.6875 }, - - { ModContent.NPCType(), 1.2 }, - { ModContent.NPCType(), 0.8 }, - { NPCID.DetonatingBubble, 0.75 }, - - { ModContent.NPCType(), 1.1 }, - - { NPCID.Golem, 0.8 }, - { NPCID.GolemHead, 0.8 }, - { NPCID.GolemFistLeft, 0.8 }, - { NPCID.GolemFistRight, 0.8 }, - - { ModContent.NPCType(), 0.9 }, - - { NPCID.DukeFishron, 0.7 }, - { NPCID.Sharkron, 0.75 }, - { NPCID.Sharkron2, 0.75 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.CultistDragonHead, 0.75 }, - { NPCID.CultistDragonBody1, 0.75 }, - { NPCID.CultistDragonBody2, 0.75 }, - { NPCID.CultistDragonBody3, 0.75 }, - { NPCID.CultistDragonBody4, 0.75 }, - { NPCID.CultistDragonTail, 0.75 }, - { NPCID.AncientDoom, 0.75 }, - { NPCID.AncientLight, 0.75 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.9 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.9 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.85 }, - { ModContent.NPCType(), 0.85 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 } - }; - - EnemyStats.ContactDamageValues = new SortedDictionary - { - { NPCID.KingSlime, new int[] { 40, 64, 80, 144 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 114 } }, - - { ModContent.NPCType(), new int[] { 45, 66, 88, 165 } }, - { ModContent.NPCType(), new int[] { 24, 32, 40, 72 } }, - { ModContent.NPCType(), new int[] { 18, 24, 30, 54 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 114 } }, - { ModContent.NPCType(), new int[] { 21, 28, 32, 63 } }, - { ModContent.NPCType(), new int[] { 12, 16, 20, 36 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 114 } }, - { ModContent.NPCType(), new int[] { 21, 28, 32, 63 } }, - { ModContent.NPCType(), new int[] { 12, 16, 20, 36 } }, - - { NPCID.EyeofCthulhu, new int[] { - 24, // 36 in phase 2 - 30, // 45 in phase 2 - 40, // 48 in phase 2, 56 in phase 3 - 75 } }, // Vanilla: 113 in phase 2; Rev+: 90 in phase 2, 105 in phase 3 - { NPCID.ServantofCthulhu, new int[] { 18, 24, 30, 54 } }, - - { ModContent.NPCType(), new int[] { 40, 64, 80, 144 } }, - { ModContent.NPCType(), new int[] { 25, 50, 62, 111 } }, - - { NPCID.EaterofWorldsHead, new int[] { 38, 55, 77, 165 } }, - { NPCID.EaterofWorldsBody, new int[] { 18, 24, 32, 60 } }, - { NPCID.EaterofWorldsTail, new int[] { 12, 16, 24, 48 } }, - { NPCID.VileSpitEaterOfWorlds, new int[] { -1, 64, 64, 96 } }, - - { NPCID.BrainofCthulhu, new int[] { 36, 54, 81, 162 } }, - { NPCID.Creeper, new int[] { 24, 36, 66, 144 } }, - - { ModContent.NPCType(), new int[] { 42, 63, 81, 162 } }, - { ModContent.NPCType(), new int[] { 30, 50, 62, 111 } }, - - { ModContent.NPCType(), new int[] { 36, 54, 63, 108 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 189 } }, - { ModContent.NPCType(), new int[] { 28, 48, 56, 96 } }, - { ModContent.NPCType(), new int[] { 22, 36, 42, 72 } }, - { ModContent.NPCType(), new int[] { 42, 70, 84, 147 } }, - { ModContent.NPCType(), new int[] { 24, 42, 50, 87 } }, - { ModContent.NPCType(), new int[] { 18, 28, 34, 60 } }, - { ModContent.NPCType(), new int[] { 36, 60, 72, 126 } }, - { ModContent.NPCType(), new int[] { 20, 36, 42, 72 } }, - { ModContent.NPCType(), new int[] { 14, 20, 26, 48 } }, - - { NPCID.QueenBee, new int[] { 36, 54, 81, 162 } }, - { NPCID.Bee, new int[] { 20, 24, 48, 108 } }, - { NPCID.BeeSmall, new int[] { 15, 18, 36, 81 } }, - - { NPCID.SkeletronHead, new int[] { - 42, // 55 while spinning - 77, // 100 while spinning - 88, // 114 while spinning - 165 } }, // 215 while spinning - { NPCID.SkeletronHand, new int[] { 32, 44, 77, 165 } }, - - { NPCID.Deerclops, new int[] { 20, 40, 50, 90 } }, - - { ModContent.NPCType(), new int[] { 48, 80, 96, 168 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 189 } }, - { ModContent.NPCType(), new int[] { 48, 80, 96, 168 } }, - { ModContent.NPCType(), new int[] { 60, 100, 120, 210 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 189 } }, - { ModContent.NPCType(), new int[] { 36, 60, 72, 126 } }, - { ModContent.NPCType(), new int[] { 24, 40, 48, 84 } }, - { ModContent.NPCType(), new int[] { 42, 70, 84, 147 } }, - { ModContent.NPCType(), new int[] { 30, 50, 60, 105 } }, - - { NPCID.WallofFlesh, new int[] { 100, 150, 180, 315 } }, - { NPCID.WallofFleshEye, new int[] { 100, 150, 180, 315 } }, - { NPCID.TheHungry, new int[] { - 30, // Ranges from 30 to 75 depending on WoF life - 60, // Ranges from 60 to 150 depending on WoF life - 60, // Ranges from 60 to 150 depending on WoF life - 90 } }, // Ranges from 90 to 225 depending on WoF life - { NPCID.TheHungryII, new int[] { 30, 60, 74, 132 } }, - { NPCID.LeechHead, new int[] { 26, 52, 62, 108 } }, - { NPCID.LeechBody, new int[] { 22, 44, 52, 90 } }, - { NPCID.LeechTail, new int[] { 18, 36, 42, 72 } }, - - { NPCID.QueenSlimeBoss, new int[] { 80, 120, 150, 270 } }, - { NPCID.QueenSlimeMinionBlue, new int[] { 60, 80, 100, 180 } }, - { NPCID.QueenSlimeMinionPink, new int[] { 60, 80, 100, 180 } }, - { NPCID.QueenSlimeMinionPurple, new int[] { 70, 100, 120, 210 } }, - - { ModContent.NPCType(), new int[] { 90, 138, 161, 276 } }, - { ModContent.NPCType(), new int[] { 80, 120, 138, 240 } }, - - { NPCID.Spazmatism, new int[] { - 70, // 105 in phase 2 - 102, // 153 in phase 2 - 119, // 178 in phase 2 - 204 } }, // 306 in phase 2 - { NPCID.Retinazer, new int[] { - 55, // 83 in phase 2 - 85, // 127 in phase 2 - 102, // 153 in phase 2 - 153 } }, // 229 in phase 2 - - { ModContent.NPCType(), new int[] { 110, 176, 187, 330 } }, - { ModContent.NPCType(), new int[] { 75, 112, 136, 240 } }, - { ModContent.NPCType(), new int[] { 70, 104, 112, 192 } }, - { ModContent.NPCType(), new int[] { 65, 96, 104, 168 } }, - - { NPCID.TheDestroyer, new int[] { 140, 280, 300, 480 } }, - { NPCID.TheDestroyerBody, new int[] { 70, 102, 136, 255 } }, - { NPCID.TheDestroyerTail, new int[] { 45, 68, 102, 204 } }, - - { ModContent.NPCType(), new int[] { 75, 112, 136, 240 } }, - - { NPCID.SkeletronPrime, new int[] { - 50, // 100 while spinning - 85, // 170 while spinning - 102, // 204 while spinning - 153 } }, // 306 while spinning - { NPCID.PrimeVice, new int[] { 70, 102, 136, 255 } }, - { NPCID.PrimeSaw, new int[] { 70, 102, 136, 255 } }, - { NPCID.PrimeCannon, new int[] { 30, 51, 68, 102 } }, - { NPCID.PrimeLaser, new int[] { 30, 51, 68, 102 } }, - - { ModContent.NPCType(), new int[] { 95, 144, 168, 288 } }, - { ModContent.NPCType(), new int[] { 80, 120, 138, 240 } }, - { ModContent.NPCType(), new int[] { 85, 130, 150, 255 } }, - - { NPCID.Plantera, new int[] { - 70, // 98 in phase 2 - 100, // 140 in phase 2 - 138, // 193 in phase 2 - 276 } }, // 386 in phase 2 - { NPCID.PlanterasTentacle, new int[] { 90, 138, 161, 276 } }, - { ModContent.NPCType(), new int[] { 90, 138, 161, 276 } }, - { NPCID.Spore, new int[] { 90, 140, 160, 270 } }, - - { NPCID.HallowBoss, new int[] { 80, // 120 during charge - 110, // 165 during charge - 143, // 215 during charge - 264 } }, // 396 during charge - - { ModContent.NPCType(), new int[] { 140, 216, 240, 414 } }, - { ModContent.NPCType(), new int[] { - 75, // 113 during charge - 112, // 168 during charge - 136, // 204 during charge - 240 } }, // 360 during charge - { ModContent.NPCType(), new int[] { 70, 110, 126, 210 } }, - { NPCID.DetonatingBubble, new int[] { 100, 150, 180, 315 } }, - { ModContent.NPCType(), new int[] { 90, 140, 160, 270 } }, - - { ModContent.NPCType(), new int[] { 145, 220, 242, 429 } }, - { ModContent.NPCType(), new int[] { 75, 112, 128, 225 } }, - - { NPCID.Golem, new int[] { 95, 144, 176, 312 } }, - { NPCID.GolemHead, new int[] { 85, 128, 144, 240 } }, - { NPCID.GolemFistLeft, new int[] { 75, 112, 144, 264 } }, - { NPCID.GolemFistRight, new int[] { 75, 112, 144, 264 } }, - - { ModContent.NPCType(), new int[] { 120, 180, 216, 378 } }, - { ModContent.NPCType(), new int[] { 120, 180, 210, 360 } }, - { ModContent.NPCType(), new int[] { 130, 200, 240, 420 } }, - - { NPCID.DukeFishron, new int[] { - 100, // 120 in phase 2 - 140, // 202 in phase 2, 185 in phase 3 - 168, // 242 in phase 2, 222 in phase 3 - 294 } }, // 423 in phase 2, 388 in phase 3 - { NPCID.Sharkron, new int[] { 100, 150, 180, 315 } }, - { NPCID.Sharkron2, new int[] { 120, 180, 210, 360 } }, - - { ModContent.NPCType(), new int[] { 130, 192, 224, 384 } }, - { ModContent.NPCType(), new int[] { 105, 160, 180, 315 } }, - { ModContent.NPCType(), new int[] { 105, 160, 180, 315 } }, - { ModContent.NPCType(), new int[] { 130, 192, 224, 390 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 336 } }, - - { NPCID.CultistDragonHead, new int[] { 120, 180, 210, 360 } }, - { NPCID.CultistDragonBody1, new int[] { 60, 90, 105, 180 } }, - { NPCID.CultistDragonBody2, new int[] { 60, 90, 105, 180 } }, - { NPCID.CultistDragonBody3, new int[] { 60, 90, 105, 180 } }, - { NPCID.CultistDragonBody4, new int[] { 60, 90, 105, 180 } }, - { NPCID.CultistDragonTail, new int[] { 60, 90, 105, 180 } }, - { NPCID.AncientCultistSquidhead, new int[] { 120, 180, 210, 360 } }, - { NPCID.AncientLight, new int[] { 120, 180, 210, 360 } }, - - { ModContent.NPCType(), new int[] { 160, 240, 268, 480 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 336 } }, - { ModContent.NPCType(), new int[] { 85, 128, 160, 288 } }, - - { ModContent.NPCType(), new int[] { 150, 224, 256, 444 } }, - { ModContent.NPCType(), new int[] { 160, 240, 264, 405 } }, - { ModContent.NPCType(), new int[] { 100, 200, 220, 300 } }, - { ModContent.NPCType(), new int[] { 100, 200, 220, 300 } }, - - { ModContent.NPCType(), new int[] { 170, 256, 288, 504 } }, - { ModContent.NPCType(), new int[] { 145, 220, 242, 435 } }, - - { ModContent.NPCType(), new int[] { 240, 360, 396, 720 } }, - { ModContent.NPCType(), new int[] { 175, 260, 288, 525 } }, - - { ModContent.NPCType(), new int[] { 240, 360, 396, 720 } }, - { ModContent.NPCType(), new int[] { 125, 192, 224, 372 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 312 } }, - - { ModContent.NPCType(), new int[] { 210, 315, 351, 621 } }, - { ModContent.NPCType(), new int[] { 175, 260, 288, 525 } }, - { ModContent.NPCType(), new int[] { 190, 280, 300, 570 } }, - - { ModContent.NPCType(), new int[] { - 160, // 192 in phase 2, 224 in phase 3 - 240, // 288 in phase 2, 336 in phase 3 - 264, // 317 in phase 2, 370 in phase 3 - 480 } }, // 576 in phase 2, 672 in phase 3 - { ModContent.NPCType(), new int[] { 224, 336, 370, 672 } }, - - { ModContent.NPCType(), new int[] { - 192, // 211 in phase 2, 230 in phase 3 - 288, // 317 in phase 2, 346 in phase 3 - 324, // 356 in phase 2, 389 in phase 3 - 567 } }, // 624 in phase 2, 680 in phase 3 - { ModContent.NPCType(), new int[] { 192, 288, 328, 576 } }, - { ModContent.NPCType(), new int[] { 192, 288, 328, 576 } }, - - { ModContent.NPCType(), new int[] { 470, 700, 750, 1410 } }, - { ModContent.NPCType(), new int[] { 250, 374, 425, 714 } }, - { ModContent.NPCType(), new int[] { 204, 306, 340, 612 } }, - { ModContent.NPCType(), new int[] { 240, 360, 396, 720 } }, - { ModContent.NPCType(), new int[] { 175, 260, 290, 525 } }, - { ModContent.NPCType(), new int[] { 135, 200, 230, 405 } }, - - { ModContent.NPCType(), new int[] { 300, 448, 480, 900 } }, - - { ModContent.NPCType(), new int[] { 340, 512, 544, 1020 } }, - - { ModContent.NPCType(), new int[] { 340, 512, 544, 1020 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 960 } }, - - { ModContent.NPCType(), new int[] { 375, 560, 592, 1116 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 960 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 960 } }, - { ModContent.NPCType(), new int[] { 270, 400, 424, 804 } }, - - { ModContent.NPCType(), new int[] { 535, 800, 850, 1596 } } - }; - - EnemyStats.ProjectileDamageValues = new SortedDictionary, int[]> - { - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 84 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 84 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 84 } }, - - { new Tuple(NPCID.EyeofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 26, 44, 60, 114 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 108 } }, - - { new Tuple(NPCID.EaterofWorldsHead, ProjectileID.CursedFlameHostile), new int[] { 26, 44, 60, 114 } }, - { new Tuple(NPCID.EaterofWorldsHead, ModContent.ProjectileType()), new int[] { 26, 36, 44, 84 } }, - - { new Tuple(NPCID.BrainofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 36, 56, 68, 120 } }, - { new Tuple(NPCID.BrainofCthulhu, ProjectileID.BloodShot), new int[] { 26, 44, 60, 114 } }, - { new Tuple(NPCID.Creeper, ProjectileID.BloodShot), new int[] { 26, 44, 60, 114 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 30, 48, 60, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 30, 48, 60, 108 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 22, 36, 44, 84 } }, - - { new Tuple(NPCID.QueenBee, ProjectileID.QueenBeeStinger), new int[] { 22, 44, 64, 126 } }, - { new Tuple(NPCID.QueenBee, ModContent.ProjectileType()), new int[] { 46, 72, 84, 144 } }, // Beenade Bees: 122 (death mode-exclusive) - - { new Tuple(NPCID.SkeletronHead, ProjectileID.Skull), new int[] { 46, 72, 84, 144 } }, - { new Tuple(NPCID.SkeletronHead, ProjectileID.Shadowflames), new int[] { 36, 72, 88, 156 } }, - { new Tuple(NPCID.SkeletronHand, ProjectileID.Skull), new int[] { 36, 56, 68, 120 } }, - - { new Tuple(NPCID.Deerclops, ProjectileID.DeerclopsIceSpike), new int[] { 26, 52, 76, 150 } }, - { new Tuple(NPCID.Deerclops, ProjectileID.DeerclopsRangedProjectile), new int[] { 36, 72, 88, 156 } }, - { new Tuple(NPCID.Deerclops, ProjectileID.InsanityShadowHostile), new int[] { 20, 40, 60, 120 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 34, 52, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 24, 48, 60, 108 } }, - - { new Tuple(NPCID.WallofFleshEye, ProjectileID.EyeLaser), new int[] { 36, 72, 88, 156 } }, - { new Tuple(NPCID.WallofFlesh, ProjectileID.DemonSickle), new int[] { 52, 92, 112, 198 } }, - { new Tuple(NPCID.WallofFlesh, ProjectileID.Fireball), new int[] { 36, 72, 88, 156 } }, - - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeGelAttack), new int[] { 60, 120, 136, 228 } }, - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeSmash), new int[] { 80, 160, 188, 324 } }, - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 198 } }, - { new Tuple(NPCID.QueenSlimeMinionBlue, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 198 } }, - { new Tuple(NPCID.QueenSlimeMinionPink, ProjectileID.QueenSlimeMinionPinkBall), new int[] { 52, 92, 112, 198 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 52, 92, 112, 198 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 228 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 210 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 52, 92, 112, 198 } }, - - { new Tuple(NPCID.Retinazer, ProjectileID.EyeLaser), new int[] { 40, 92, 116, 210 } }, - { new Tuple(NPCID.Retinazer, ProjectileID.DeathLaser), new int[] { - 50, // 38 in rapid fire - 108, // 81 in rapid fire - 132, // 99 in rapid fire - 234 } }, // 176 in rapid fire - { new Tuple(NPCID.Retinazer, ModContent.ProjectileType()), new int[] { 70, 120, 136, 228 } }, - { new Tuple(NPCID.Spazmatism, ProjectileID.CursedFlameHostile), new int[] { 50, 100, 120, 210 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 60, 120, 148, 264 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 70, 120, 148, 264 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 60, 100, 128, 234 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 210 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 228 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 66, 112, 128, 216 } }, - - { new Tuple(NPCID.TheDestroyer, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 204 } }, - { new Tuple(NPCID.TheDestroyer, ModContent.ProjectileType()), new int[] { 46, 108, 128, 222 } }, - { new Tuple(NPCID.TheDestroyer, ModContent.ProjectileType()), new int[] { 48, 116, 136, 234 } }, - { new Tuple(NPCID.TheDestroyerBody, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 204 } }, - { new Tuple(NPCID.TheDestroyerBody, ModContent.ProjectileType()), new int[] { 46, 108, 128, 222 } }, - { new Tuple(NPCID.TheDestroyerBody, ModContent.ProjectileType()), new int[] { 48, 116, 136, 234 } }, - { new Tuple(NPCID.Probe, ProjectileID.PinkLaser), new int[] { 50, 88, 100, 168 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 240, 420 } }, // Split shots: 72, 120, 144, 252 - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 216 } }, - - { new Tuple(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 50, 108, 124, 210 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 210 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 264 } }, - { new Tuple(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 264 } }, - { new Tuple(NPCID.PrimeCannon, ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 0, 300 } }, - { new Tuple(NPCID.PrimeLaser, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 210 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 216 } }, - - { new Tuple(NPCID.Plantera, ProjectileID.SeedPlantera), new int[] { 52, 96, 128, 240 } }, - { new Tuple(NPCID.Plantera, ProjectileID.PoisonSeedPlantera), new int[] { 62, 116, 144, 258 } }, - { new Tuple(NPCID.Plantera, ProjectileID.ThornBall), new int[] { 72, 132, 160, 282 } }, - { new Tuple(NPCID.Plantera, ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(NPCID.Plantera, ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - - { new Tuple(NPCID.HallowBoss, ProjectileID.HallowBossRainbowStreak), new int[] { 100, 152, 172, 300 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.FairyQueenSunDance), new int[] { 120, 180, 204, 360 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.HallowBossLastingRainbow), new int[] { 100, 152, 172, 300 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.FairyQueenLance), new int[] { 130, 196, 216, 390 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 208, 366 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 84, 148, 172, 294 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 208, 366 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 318 } }, - - { new Tuple(NPCID.Golem, ProjectileID.Fireball), new int[] { 60, 120, 140, 270 } }, - { new Tuple(NPCID.Golem, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 306 } }, - { new Tuple(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 140, 270 } }, - { new Tuple(NPCID.GolemHead, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 306 } }, - { new Tuple(NPCID.GolemFistLeft, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 318 } }, - { new Tuple(NPCID.GolemFistRight, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 318 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 140, 270 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 306 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 372 } }, - - { new Tuple(NPCID.DukeFishron, ProjectileID.Sharknado), new int[] { 80, 100, 150, 300 } }, - { new Tuple(NPCID.DukeFishron, ProjectileID.Cthulunado), new int[] { 160, 200, 232, 480 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 144, 172, 300 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 144, 172, 300 } }, - - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossFireBall), new int[] { 88, 156, 184, 318 } }, - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossIceMist), new int[] { 120, 180, 208, 360 } }, - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossLightningOrb), new int[] { 120, 192, 220, 372 } }, - { new Tuple(NPCID.CultistBossClone, ProjectileID.CultistBossFireBallClone), new int[] { 90, 144, 172, 300 } }, - { new Tuple(NPCID.AncientDoom, ProjectileID.AncientDoomProjectile), new int[] { 88, 156, 184, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 152, 176, 300 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 192, 318 } }, - - { new Tuple(NPCID.MoonLordHead, ProjectileID.PhantasmalDeathray), new int[] { 200, 300, 380, 690 } }, - { new Tuple(NPCID.MoonLordHead, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 300 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalEye), new int[] { 90, 120, 160, 300 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalSphere), new int[] { 120, 160, 220, 420 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 300 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalBolt), new int[] { 100, 140, 180, 330 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalEye), new int[] { 100, 140, 180, 330 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalSphere), new int[] { 132, 176, 220, 396 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalDeathray), new int[] { 150, 200, 260, 480 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 320, 352, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 450 } }, // Split holy fire does: 113, 198, 216, 338 - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 400, 440, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrbArc), new int[] { 150, 264, 288, 450 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.FrostWave), new int[] { 150, 264, 288, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrb), new int[] { 150, 264, 288, 450 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 450 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 420 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 420, 460, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 316, 348, 540 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 510 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 316, 348, 540 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 340, 376, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 520, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 592, 624, 1050 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 750 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 840 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 592, 624, 1050 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 608, 640, 1200 } }, - - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossIceMist), new int[] { 400, 600, 632, 1200 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrbArc), new int[] { 500, 752, 788, 1500 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.AncientDoomProjectile), new int[] { 400, 600, 632, 1200 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossFireBallClone), new int[] { 400, 600, 632, 1200 } } - }; - } - - // Destroys the EnemyStats struct to save memory because mod assemblies will not be fully unloaded until TML 1.4. - internal static void UnloadEnemyStats() - { - EnemyStats.ExpertDamageMultiplier = null; - EnemyStats.ContactDamageValues = null; - EnemyStats.ProjectileDamageValues = null; - } - #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/Dyes/InvisibleDyeShader.fx b/Effects/Dyes/InvisibleDyeShader.fx new file mode 100644 index 0000000000..e1b691da39 --- /dev/null +++ b/Effects/Dyes/InvisibleDyeShader.fx @@ -0,0 +1,33 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +float2 uTargetPosition; +float4 uLegacyArmorSourceRect; +float2 uLegacyArmorSheetSize; + +float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0 +{ + float4 color = tex2D(uImage0, coords); + color.rgb *= 0; + color.a = 0; + return color; +} + +technique Technique1 +{ + pass DyePass + { + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/Dyes/InvisibleDyeShader.xnb b/Effects/Dyes/InvisibleDyeShader.xnb new file mode 100644 index 0000000000..738b0c2935 Binary files /dev/null and b/Effects/Dyes/InvisibleDyeShader.xnb differ 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/ExtraJumps/SulphurJump.cs b/ExtraJumps/SulphurJump.cs index eef2cbb6c1..db5dd0bd9f 100644 --- a/ExtraJumps/SulphurJump.cs +++ b/ExtraJumps/SulphurJump.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Armor.Sulphurous; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Particles; using CalamityMod.Projectiles.Typeless; @@ -46,7 +47,7 @@ namespace CalamityMod.ExtraJumps if (modPlayer.sulphurBubbleCooldown <= 0) { var source = player.GetSource_Misc("0"); - int damage = (int)player.GetTotalDamage().ApplyTo(20); + int damage = (int)player.GetTotalDamage().ApplyTo(SulphurousHelmet.BubbleDamage); int bubble = Projectile.NewProjectile(source, new Vector2(player.position.X, player.position.Y + (player.gravDir == -1f ? 20 : -20)), Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1f, 0f); if (bubble.WithinBounds(Main.maxProjectiles)) diff --git a/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/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 20b45bc28c..f2abeedfea 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,6 +1,8 @@ using System; using CalamityMod.Balancing; using CalamityMod.Enums; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; @@ -332,16 +334,6 @@ namespace CalamityMod.ILEditing private static void PrefixChanges(On_Player.orig_GrantPrefixBenefits orig, Player self, Item item) { orig(self, item); - // Defense accessory prefixes have slightly scaling defense boosts through progression - if (item.prefix >= PrefixID.Hard && item.prefix <= PrefixID.Warding) - { - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; - } // Hard / Guarding / Armored / Warding give 0.25% / 0.5% / 0.75% / 1% DR if (item.prefix == PrefixID.Hard) self.endurance += 0.0025f; @@ -526,9 +518,72 @@ namespace CalamityMod.ILEditing } #endregion - #region Vortex Booster Keeps Vortex Stealth When Dashing - private static void VortexBoosterKeepsVortexStealthWhenDashing(On_Player.orig_DashMovement orig, Player self) + #region SoC Buffs & Vortex Booster Keeping Stealth + private static void DashMovementEdits(On_Player.orig_DashMovement orig, Player self) { + //This is a modified version of Vanilla's Shield of Cthulhu dash collision checks + //This is done to be able to adjust values as needed. Here we change the iframe amount and recoil velocity + if (self.dash == 2 && self.eocDash > 0 && self.eocHit < 0) + { + Rectangle DashHitbox = new Rectangle((int)(self.position.X + self.velocity.X * 0.5 - 4.0), (int)(self.position.Y + self.velocity.Y * 0.5 - 4.0), self.width + 8, self.height + 8); + for (int i = 0; i < 200; i++) + { + NPC hitNPC = Main.npc[i]; + if (!hitNPC.active || hitNPC.dontTakeDamage || hitNPC.friendly || (hitNPC.aiStyle == 112 && !(hitNPC.ai[2] <= 1f)) || !self.CanNPCBeHitByPlayerOrPlayerProjectile(hitNPC)) + { + continue; + } + Rectangle npcHitbox = hitNPC.getRect(); + if (DashHitbox.Intersects(npcHitbox) && (hitNPC.noTileCollide || self.CanHit(hitNPC))) + { + float dmg = self.GetTotalDamage(DamageClass.Melee).ApplyTo(self.Calamity().copyrightInfringementShield ? 300f : 30f); + float kb = self.GetTotalKnockback(DamageClass.Melee).ApplyTo(self.Calamity().copyrightInfringementShield ? 12f : 9f); + bool crit = false; + if (Main.rand.Next(100) < self.GetTotalCritChance(DamageClass.Melee)) + { + crit = true; + } + int direction = self.direction; + if (self.velocity.X < 0f) + { + direction = -1; + } + if (self.velocity.X > 0f) + { + direction = 1; + } + self.eocHit = i; + if (self.whoAmI == Main.myPlayer) + { + self.ApplyDamageToNPC(hitNPC, (int)dmg, kb, direction, crit, DamageClass.Melee); + } + self.eocDash = 10; + self.dashDelay = BalancingConstants.OnShieldBonkCooldown; + self.velocity.X = -direction * 9; + self.velocity.Y = -4f; + self.GiveImmuneTimeForCollisionAttack(8); //This is normally 4 in vanilla + int heldDir = 0; + if (self.controlLeft) + heldDir--; + if (self.controlRight) + heldDir++; + int dirSum = Math.Abs(direction + heldDir); + switch (dirSum) + { + case 0: //Holding in direction of recoil + self.velocity.X *= 1.75f; + break; + case 1: //Neutral direction + self.velocity.X *= 1.5f; + break; + case 2: //Holding in direction of enemy + self.velocity.X *= 1.25f; + break; + } + } + } + } + // Allows for Vortex Booster to automatically re-engage Vortex armor's stealth after a delay when dashing bool vortexStealth = self.vortexStealthActive; orig(self); diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index a566bda6e5..f7428ad488 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 @@ -74,8 +75,9 @@ namespace CalamityMod.ILEditing IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments; On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown; IL_Player.DashMovement += FixAllDashMechanics; - On_Player.DashMovement += VortexBoosterKeepsVortexStealthWhenDashing; + 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) @@ -171,7 +175,6 @@ namespace CalamityMod.ILEditing IL_Projectile.StatusPlayer += RemoveFrozenInflictionFromDeerclopsIceSpikes; // World generation - IL_WorldGen.Pyramid += ReplacePharaohSetInPyramids; IL_WorldGen.GrowLivingTree += BlockLivingTreesNearOcean; On_WorldGen.SmashAltar += PreventSmashAltarCode; IL_WorldGen.hardUpdateWorld += AdjustChlorophyteSpawnRate; @@ -195,9 +198,10 @@ 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; IL_Main.UpdateTime_StartNight += BloodMoonsRequire200MaxLife; IL_WorldGen.AttemptFossilShattering += PreventFossilShattering; On_Player.GetPickaxeDamage += RemoveHellforgePickaxeRequirement; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 9060f3013b..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; @@ -161,26 +162,7 @@ namespace CalamityMod.ILEditing // This will occur precisely when the player has no vanilla OR Calamity dash items equipped. cursor.Emit(OpCodes.Or); - // - // SHIELD OF CTHULHU - // - - // Move to Shield of Cthulhu's code by finding its function call for iframes. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCall("GiveImmuneTimeForCollisionAttack"))) - { - LogFailure("Vanilla Dash Fixes", "Could not locate function call for Shield of Cthulhu iframes."); - return; - } - - if (!cursor.TryGotoPrev(MoveType.AfterLabel, i => i.MatchLdcI4(30))) - { - LogFailure("Vanilla Dash Fixes", "Could not locate amount of frames of dash cooldown applied on impact with Shield of Cthulhu."); - return; - } - - // Remove the instruction and replace it with one which gives Calamity's (customizable) amount of dash cooldown. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_I4, BalancingConstants.OnShieldBonkCooldown); + // CIT 22JUL2025: Shield of Cthulhu bonk is reimplemented in a separate On edit; removed the change made to it via this IL edit. // // SOLAR FLARE ARMOR @@ -331,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 @@ -383,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) { @@ -618,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); @@ -666,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..d8b2adea5e 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; @@ -240,34 +241,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Make Windy Day Music Play Less Often - private static void MakeWindyDayMusicPlayLessOften(ILContext il) - { - // Make windy day theme only play when the wind speed is over 0.5f instead of 0.4f and make it stop when the wind dies down to below 0.44f instead of 0.34f. - var cursor = new ILCursor(il); - - FieldInfo _minWindField = typeof(Main).GetField("_minWind", BindingFlags.NonPublic | BindingFlags.Static); - - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(_minWindField))) // The min wind speed check that stops the windy day theme when the wind dies down enough. - { - LogFailure("Make Windy Day Music Play Less Often", "Could not locate the _minWind variable."); - return; - } - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, 0.44f); // Change to 0.44f. - - FieldInfo _maxWindField = typeof(Main).GetField("_maxWind", BindingFlags.NonPublic | BindingFlags.Static); - - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(_maxWindField))) // The max wind speed check that causes the windy day theme to play. - { - LogFailure("Make Windy Day Music Play Less Often", "Could not locate the _maxWind variable."); - return; - } - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, 0.5f); // Change to 0.5f. - } - #endregion Make Windy Day Music Play Less Often - #region Change Blood Moon Max HP Requirements private static void BloodMoonsRequire200MaxLife(ILContext il) { @@ -333,6 +306,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/ILEditing/WorldgenILChanges.cs b/ILEditing/WorldgenILChanges.cs index ea5a4dd8d7..002c434ca3 100644 --- a/ILEditing/WorldgenILChanges.cs +++ b/ILEditing/WorldgenILChanges.cs @@ -34,28 +34,6 @@ namespace CalamityMod.ILEditing set; } - #region Replacement of Pharaoh Set in Pyramids - // Note: There is no need to replace the other Pharaoh piece, due to how the vanilla code works. - // The other Pharaoh vanity piece is added automatically if the mask is found in the chest. - private static void ReplacePharaohSetInPyramids(ILContext il) - { - var cursor = new ILCursor(il); - - // Find the instruction which loads in the item ID of the Pharaoh's Mask. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(ItemID.PharaohsMask))) - { - LogFailure("Pharaoh Set Pyramid Replacement", "Could not locate the Pharaoh's Mask item ID."); - return; - } - - // Replace the Pharaoh's Mask with the Amber Hook. - // THIS INT CAST IS MANDATORY. DO NOT REMOVE IT. - // In TML's DLL, despite item IDs being shorts (16 bits), the hardcoded 848 here is a 32-bit integer literal. - // As such, it must be replaced with a 32-bit integer literal or the branches of the switch will misalign and the IL edit fails. - cursor.Next.Operand = (int)ItemID.AmberHook; - } - #endregion Replacement of Pharaoh Set in Pyramids - #region Fixing of Living Tree/Sulphurous Sea Interactions private static void BlockLivingTreesNearOcean(ILContext il) { diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 8e71f92a39..9ba8791b8d 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories Item.width = 60; Item.height = 54; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 12; + Item.defense = 6; Item.accessory = true; Item.rare = ModContent.RarityType(); } diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index 5478959941..3f7bff607d 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories Item.height = 48; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 8; // we buff Ankh Shield to 8 + Item.defense = 4; Item.accessory = true; } diff --git a/Items/Accessories/BloodstainedGlove.cs b/Items/Accessories/BloodstainedGlove.cs index 075af22adf..41d4f0b6a9 100644 --- a/Items/Accessories/BloodstainedGlove.cs +++ b/Items/Accessories/BloodstainedGlove.cs @@ -24,15 +24,5 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.bloodyGlove = true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 2). - AddIngredient(6). - AddIngredient(ItemID.Vertebrae, 2). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index 8399ef805a..23c4716747 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 42; - Item.defense = 7; + Item.defense = 3; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index 4c6ef7f45c..9a31aa9dad 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 12; Item.height = 15; - Item.defense = 7; + Item.defense = 3; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; diff --git a/Items/Accessories/CorrosiveSpine.cs b/Items/Accessories/CorrosiveSpine.cs index f9bc1fde4a..21b17bf5f6 100644 --- a/Items/Accessories/CorrosiveSpine.cs +++ b/Items/Accessories/CorrosiveSpine.cs @@ -16,7 +16,6 @@ namespace CalamityMod.Items.Accessories Item.height = 46; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 4; Item.accessory = true; } @@ -25,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/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 1c85ffd2fe..9c4b4cfca5 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 26; - Item.defense = 4; + Item.defense = 1; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; 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/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index 361bf550d6..e86eea2a52 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories Item.width = 42; Item.height = 60; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 10; + Item.defense = 4; Item.lifeRegen = 1; Item.accessory = true; Item.rare = ModContent.RarityType(); 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/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 8825c99c92..0177e7f04c 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories Item.width = 52; Item.height = 68; Item.accessory = true; - Item.defense = 48; + Item.defense = 20; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); } 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/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index 05e3ce7943..c941a263df 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories Item.height = 42; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); - Item.defense = 10; + Item.defense = 5; Item.accessory = true; } 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/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index 5179e46fcb..0e565a1163 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories player.statManaMax2 += 150; player.GetDamage() += 0.15f; - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; player.GetCritChance() += 5; } 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/FilthyGlove.cs b/Items/Accessories/FilthyGlove.cs index 905d4c0ccb..35f2edb458 100644 --- a/Items/Accessories/FilthyGlove.cs +++ b/Items/Accessories/FilthyGlove.cs @@ -24,15 +24,5 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.filthyGlove = true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 2). - AddIngredient(6). - AddIngredient(ItemID.RottenChunk, 2). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Accessories/GiantShell.cs b/Items/Accessories/GiantShell.cs index 52297d4d96..fe575c6fd1 100644 --- a/Items/Accessories/GiantShell.cs +++ b/Items/Accessories/GiantShell.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 30; Item.height = 28; - Item.defense = 6; + Item.defense = 5; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; diff --git a/Items/Accessories/GiantTortoiseShell.cs b/Items/Accessories/GiantTortoiseShell.cs index 579d15d32f..9551ffbb81 100644 --- a/Items/Accessories/GiantTortoiseShell.cs +++ b/Items/Accessories/GiantTortoiseShell.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 46; Item.height = 30; - Item.defense = 15; + Item.defense = 10; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; diff --git a/Items/Accessories/GrandGelatin.cs b/Items/Accessories/GrandGelatin.cs index 1bf8309fd9..a3c5b0b973 100644 --- a/Items/Accessories/GrandGelatin.cs +++ b/Items/Accessories/GrandGelatin.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories public static float MoveSpeedBoost = 0.12f; public static float JumpSpeedBoost = 0.6f; // Both 12% so we only need just one in the tooltip public static int AuraLifetime = 1800; - public static int AuraRegenBoost = 6; + public static int AuraRegenBoost = 4; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), AuraLifetime.FramesToSeconds(), AuraRegenBoost.ToRegenPerSecond()); public override void SetDefaults() diff --git a/Items/Accessories/HallowedRune.cs b/Items/Accessories/HallowedRune.cs index 360aa5df98..814c76a378 100644 --- a/Items/Accessories/HallowedRune.cs +++ b/Items/Accessories/HallowedRune.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int RegenBoost = 3; - public static int DefenseBoost = 8; + public static int DefenseBoost = 4; public static float DamageReductionBoost = 0.04f; public static float SummonDamageBoost = 0.1f; 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/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index 5411c27755..5d8a49719e 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 30; + player.statLifeMax2 += 10; CalamityPlayer modPlayer = player.Calamity(); modPlayer.alwaysHoneyRegen = true; modPlayer.honeyTurboRegen = true; 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/InfectedJewel.cs b/Items/Accessories/InfectedJewel.cs index c5c18c08f6..7746446c7f 100644 --- a/Items/Accessories/InfectedJewel.cs +++ b/Items/Accessories/InfectedJewel.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 26; - Item.defense = 6; + Item.defense = 4; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.accessory = 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/LivingDew.cs b/Items/Accessories/LivingDew.cs index bc76e4a498..d384b931a1 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 50; + player.statLifeMax2 += 25; // Inherits all effects of Honey Dew CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index ca173561dc..1be7ad87e1 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Blue; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.accessory = true; - Item.defense = 4; + Item.defense = 3; } public override void UpdateAccessory(Player player, bool hideVisual) 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/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index 2b12a2aa69..40d0834c14 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories Item.height = 32; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 4; // This has a ram dash, it should give a bit less defense due to how good it is + Item.defense = 2; // This has a ram dash, it should give a bit less defense due to how good it is 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/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index de805f51fa..e1c0f21cfd 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Accessories public class ProfanedSoulCrystal : TransformationAccessory, ILocalizedModType, IDyeableShaderRenderer { public static string[] contributorNames = new[] { "IbanPlay", "Chen", "Nincity", "Amber", "Mishiro", "LordMetarex", "Memes" }; - public static int ShieldDurabilityMax = 125; + public static int ShieldDurabilityMax = 100; public new string LocalizationCategory => "Items.Accessories"; public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5); diff --git a/Items/Accessories/Radiance.cs b/Items/Accessories/Radiance.cs index 5389af0bc6..ba2d8f31ff 100644 --- a/Items/Accessories/Radiance.cs +++ b/Items/Accessories/Radiance.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 18; Item.height = 44; - Item.defense = 8; + Item.defense = 5; Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index 9e98211a44..091ecaaa0c 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories Item.width = 64; Item.height = 62; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 12; + Item.defense = 8; Item.accessory = true; Item.rare = ModContent.RarityType(); } 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/Regenerator.cs b/Items/Accessories/Regenerator.cs index ea319a1373..8161d9d105 100644 --- a/Items/Accessories/Regenerator.cs +++ b/Items/Accessories/Regenerator.cs @@ -1,11 +1,11 @@ -using CalamityMod.CalPlayer; +using System; +using System.Collections.Generic; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; using Terraria.Localization; -using System.Collections.Generic; -using System; +using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { @@ -13,6 +13,13 @@ namespace CalamityMod.Items.Accessories public class Regenerator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float HealthRatioCap = 0.5f; + public static int FramesPerHeal = 8; + public static int RegenTimeBoost = 4; // on top of +1/s regular increment + public static float RegenToDamageRatio = 0.015f; // per regen point + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HealthRatioCap.ToPercent(), (60 / (float)FramesPerHeal).Round()); + public override void SetDefaults() { Item.width = 34; 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/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index 1289b42d86..dd70db074e 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -11,6 +11,7 @@ using Terraria; using Terraria.Audio; using Terraria.Graphics.Effects; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -25,10 +26,9 @@ namespace CalamityMod.Items.Accessories public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; public static int ShieldDurabilityMax = 20; - public static int ShieldRechargeTime = CalamityUtils.SecondsToFrames(10); - - // While active, Rover Drive gives 10 defense - public static int ShieldDefenseBoost = 10; + public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(10); + public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(5); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ShieldDurabilityMax, ShieldRechargeDelay.FramesToSeconds(), TotalShieldRechargeTime.FramesToSeconds()); // Interface stuff. public int OwnerPlayer { get; set; } @@ -78,9 +78,6 @@ namespace CalamityMod.Items.Accessories modPlayer.roverDrive = true; modPlayer.roverDriveShieldVisible = !hideVisual; - - if (modPlayer.RoverDriveShieldDurability > 0) - player.statDefense += ShieldDefenseBoost; } // In vanity, provides a visual shield but no actual functionality diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs index d4188317bb..de7f1c2b4b 100644 --- a/Items/Accessories/SandCloak.cs +++ b/Items/Accessories/SandCloak.cs @@ -8,6 +8,9 @@ namespace CalamityMod.Items.Accessories public class SandCloak : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int SandVeilDefenseBoost = 4; + public override void SetDefaults() { Item.width = 30; 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/ShieldoftheHighRuler.cs b/Items/Accessories/ShieldoftheHighRuler.cs index e7e7fb50d7..1d7bc17922 100644 --- a/Items/Accessories/ShieldoftheHighRuler.cs +++ b/Items/Accessories/ShieldoftheHighRuler.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; - Item.defense = 6; + Item.defense = 4; Item.accessory = true; } diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index eb3ff6f32b..94c5dd7487 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories player.manaMagnet = true; player.statManaMax2 += 100; player.GetDamage() += 0.15f; - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; } public override void AddRecipes() diff --git a/Items/Accessories/SpiritGlyph.cs b/Items/Accessories/SpiritGlyph.cs index 2d1d84ad2f..4c5bd25543 100644 --- a/Items/Accessories/SpiritGlyph.cs +++ b/Items/Accessories/SpiritGlyph.cs @@ -11,8 +11,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int RegenBoost = 2; - public static int DefenseBoost = 6; - public static float DamageReductionBoost = 0.03f; + public static int DefenseBoost = 4; public static float SummonDamageBoost = 0.1f; public override void SetDefaults() diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index 2b2e35e978..70e6e19b64 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories public static float JumpSpeedBoost = 0.6f; // Both 12% so we only need just one in the tooltip public static float ThornsBoost = 3.5f; public static int AuraLifetime = 1800; - public static int AuraRegenBoost = 6; + public static int AuraRegenBoost = 4; public static float AuraDamageBoost = 0.08f; public static float AuraDamageReductionBoost = 0.05f; public static float DamageTakenHealedPercent = 0.05f; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 24; - Item.defense = 10; + Item.defense = 6; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; Item.accessory = true; 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/TheSponge.cs b/Items/Accessories/TheSponge.cs index 92895e1f74..de3d6a916f 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -15,6 +15,7 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -32,13 +33,11 @@ namespace CalamityMod.Items.Accessories 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 = 180; + public static int ShieldDurabilityMax = 120; + public static float ShieldActiveDamageReduction = 0.1f; public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(8); // Was 6, then was 9 public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(10); // Was 6 - - // While active, The Sponge gives 20 defense and 10% DR - public static int ShieldActiveDefense = 20; - public static float ShieldActiveDamageReduction = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ShieldDurabilityMax, ShieldActiveDamageReduction.ToPercent(), ShieldRechargeDelay.FramesToSeconds(), TotalShieldRechargeTime.FramesToSeconds()); public int OwnerPlayer { get; set; } public float RenderDepth => IDyeableShaderRenderer.SpongeShieldDepth; @@ -91,10 +90,7 @@ namespace CalamityMod.Items.Accessories modPlayer.spongeShieldVisible = !hideVisual; if (modPlayer.SpongeShieldDurability > 0) - { - player.statDefense += ShieldActiveDefense; player.endurance += ShieldActiveDamageReduction; - } } // In vanity, provides a visual shield but no actual functionality 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/AbandonedWulfrumHelmet.cs b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs index a1521cb95d..abcdf74751 100644 --- a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs +++ b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs @@ -1,9 +1,6 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.BaseItems; -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; using Terraria; using Terraria.Audio; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -26,7 +23,7 @@ namespace CalamityMod.Items.Accessories.Vanity public new string LocalizationCategory => "Items.Accessories"; public override (EquipType, string, string)[] EquipSlots => [ - (EquipType.Head, "AbandonedWulfrumHelmet", "WulfrumOldSetHead"), + (EquipType.Head, "AbandonedWulfrumHelmetTrans", "WulfrumOldSetHead"), (EquipType.Body, "AbandonedWulfrumHelmet", null), (EquipType.Legs, "AbandonedWulfrumHelmet", null), (EquipType.Face, null, null), //results in setting this equip slot to -1 diff --git a/Items/Accessories/Vanity/AbandonedWulfrumHelmet_HeadSet.png b/Items/Accessories/Vanity/AbandonedWulfrumHelmetTrans_Head.png similarity index 100% rename from Items/Accessories/Vanity/AbandonedWulfrumHelmet_HeadSet.png rename to Items/Accessories/Vanity/AbandonedWulfrumHelmetTrans_Head.png 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/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index 7f541ea531..2d0096cb73 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 22; - Item.defense = 15; // Why did this give 30 defense? This thing really needs a rework lol + Item.defense = 12; // Why did this give 30 defense? This thing really needs a rework lol Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); diff --git a/Items/Armor/Aerospec/AerospecBreastplate.cs b/Items/Armor/Aerospec/AerospecBreastplate.cs index c4601b3ca1..acd1344852 100644 --- a/Items/Armor/Aerospec/AerospecBreastplate.cs +++ b/Items/Armor/Aerospec/AerospecBreastplate.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -11,6 +12,15 @@ namespace CalamityMod.Items.Armor.Aerospec public new string LocalizationCategory => "Items.Armor.PreHardmode"; internal static string FeatherEntitySourceContext => "SetBonus_Calamity_Aerospec"; + public static float DamageBoost = 0.03f; + public static int CritBoost = 3; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); + + // Common Set Bonus + public static int SetBonusHurtDamageThreshold = 25; + public static int SetBonusFeatherDamage = 30; + public static float SetBonusFallSpeed = 15f; + public override void SetDefaults() { Item.width = 18; @@ -22,8 +32,8 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateEquip(Player player) { - player.GetDamage() += 0.03f; - player.GetCritChance() += 3; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Aerospec/AerospecHeadMagic.cs b/Items/Armor/Aerospec/AerospecHeadMagic.cs index 084d548d20..3c66e85984 100644 --- a/Items/Armor/Aerospec/AerospecHeadMagic.cs +++ b/Items/Armor/Aerospec/AerospecHeadMagic.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -11,6 +12,16 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int MaxManaBoost = 30; + public static float MagicDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusManaCostReduction = 0.08f; + public static float SetBonusMoveSpeedBoost = 0.05f; + public static int SetBonusMagicCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal + public override void SetDefaults() { Item.width = 18; @@ -32,19 +43,20 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusManaCostReduction.ToPercent(), SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.manaCost -= 0.08f; - player.GetCritChance() += 5; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.manaCost -= SetBonusManaCostReduction; + player.GetCritChance() += SetBonusMagicCritBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.statManaMax2 += 30; + player.GetDamage() += MagicDamageBoost; + player.statManaMax2 += MaxManaBoost; } public override void AddRecipes() diff --git a/Items/Armor/Aerospec/AerospecHeadMelee.cs b/Items/Armor/Aerospec/AerospecHeadMelee.cs index 1d7b21e058..070471a1d6 100644 --- a/Items/Armor/Aerospec/AerospecHeadMelee.cs +++ b/Items/Armor/Aerospec/AerospecHeadMelee.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -11,6 +12,15 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MeleeDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusMoveSpeedBoost = 0.05f; + public static int SetBonusMeleeCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal + public static int SetBonusAggroBoost = 300; + public override void SetDefaults() { Item.width = 18; @@ -32,19 +42,17 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.GetCritChance() += 5; - player.aggro += 300; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.GetCritChance() += SetBonusMeleeCritBoost; + player.aggro += SetBonusAggroBoost; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += MeleeDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Aerospec/AerospecHeadRanged.cs b/Items/Armor/Aerospec/AerospecHeadRanged.cs index 01fc45869d..7953422862 100644 --- a/Items/Armor/Aerospec/AerospecHeadRanged.cs +++ b/Items/Armor/Aerospec/AerospecHeadRanged.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -11,6 +12,14 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RangedDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusMoveSpeedBoost = 0.05f; + public static int SetBonusRangedCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal + public override void SetDefaults() { Item.width = 18; @@ -32,18 +41,16 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.GetCritChance() += 5; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.GetCritChance() += SetBonusRangedCritBoost; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RangedDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Aerospec/AerospecHeadRogue.cs b/Items/Armor/Aerospec/AerospecHeadRogue.cs index be4a49a3d4..5ada7136eb 100644 --- a/Items/Armor/Aerospec/AerospecHeadRogue.cs +++ b/Items/Armor/Aerospec/AerospecHeadRogue.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -11,6 +12,16 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.1f; + public static float MoveSpeedBoost = 0.05f; + 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 override void SetStaticDefaults() { if (!Main.dedServ) @@ -38,20 +49,21 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; - modPlayer.rogueStealthMax += 0.8f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.GetCritChance() += 5; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.GetCritChance() += SetBonusRogueCritBoost; player.Calamity().wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Aerospec/AerospecHeadSummon.cs b/Items/Armor/Aerospec/AerospecHeadSummon.cs index b54a722b93..5543fb9945 100644 --- a/Items/Armor/Aerospec/AerospecHeadSummon.cs +++ b/Items/Armor/Aerospec/AerospecHeadSummon.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.Aerospec @@ -14,6 +15,14 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float SummonDamageBoost = 0.1f; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.11f; public static int ValkyrieDamage = 20; public override void SetDefaults() @@ -37,7 +46,8 @@ namespace CalamityMod.Items.Armor.Aerospec 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(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.valkyrie = true; modPlayer.aeroSet = true; @@ -58,14 +68,14 @@ namespace CalamityMod.Items.Armor.Aerospec Main.projectile[p].originalDamage = ValkyrieDamage; } } - player.GetDamage() += 0.11f; - player.maxMinions++; + player.GetDamage() += SetBonusSummonDamageBoost; + player.maxMinions += SetBonusMinionSlotBoost; } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.05f; - player.GetDamage() += 0.1f; + player.moveSpeed += MoveSpeedBoost; + player.GetDamage() += SummonDamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/Aerospec/AerospecLeggings.cs b/Items/Armor/Aerospec/AerospecLeggings.cs index e28d5c8641..f035355c2f 100644 --- a/Items/Armor/Aerospec/AerospecLeggings.cs +++ b/Items/Armor/Aerospec/AerospecLeggings.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MoveSpeedBoost = 0.12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -18,10 +23,7 @@ namespace CalamityMod.Items.Armor.Aerospec Item.defense = 6; } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.12f; - } + public override void UpdateEquip(Player player) => player.moveSpeed += MoveSpeedBoost; public override void AddRecipes() { diff --git a/Items/Armor/Astral/AstralBreastplate.cs b/Items/Armor/Astral/AstralBreastplate.cs index 0efb6e01dc..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,9 +26,8 @@ namespace CalamityMod.Items.Armor.Astral public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; - 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/AuricTeslaBodyArmor.cs b/Items/Armor/Auric/AuricTeslaBodyArmor.cs index f35231fbaf..cdc97de8ed 100644 --- a/Items/Armor/Auric/AuricTeslaBodyArmor.cs +++ b/Items/Armor/Auric/AuricTeslaBodyArmor.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Armor.Auric public override void UpdateEquip(Player player) { var modPlayer = player.Calamity(); - player.statLifeMax2 += 100; + player.statLifeMax2 += 50; player.GetDamage() += 0.08f; player.GetCritChance() += 5; } diff --git a/Items/Armor/Auric/AuricTeslaHeadMagic.cs b/Items/Armor/Auric/AuricTeslaHeadMagic.cs index 6c932422b7..94f03805a8 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMagic.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMagic.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Items.Armor.Auric { var modPlayer = player.Calamity(); modPlayer.auricBoost = true; - player.manaCost *= 0.8f; + player.manaCost -= 0.2f; player.GetDamage() += 0.3f; player.GetCritChance() += 20; player.statManaMax2 += 100; 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/BloodflareBodyArmor.cs b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs index c1fee61ca3..b9370b9752 100644 --- a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs +++ b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void UpdateEquip(Player player) { - player.statLifeMax2 += 40; + player.statLifeMax2 += 25; player.GetDamage() += 0.12f; player.GetCritChance() += 8; } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index 8a4569fc13..cff6ab1e36 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void UpdateEquip(Player player) { - player.manaCost *= 0.83f; + player.manaCost -= 0.17f; player.GetDamage() += 0.2f; player.GetCritChance() += 10; player.statManaMax2 += 100; 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 24be230104..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.9f; - 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 1601c041ce..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.9f; - 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/DemonshadeBreastplate.cs b/Items/Armor/Demonshade/DemonshadeBreastplate.cs index dec634e4f4..4119d966ad 100644 --- a/Items/Armor/Demonshade/DemonshadeBreastplate.cs +++ b/Items/Armor/Demonshade/DemonshadeBreastplate.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor.Demonshade var modPlayer = player.Calamity(); modPlayer.shadeRegen = true; player.thorns += 100f; - player.statLifeMax2 += 200; + player.statLifeMax2 += 50; player.statManaMax2 += 200; player.GetDamage() += 0.15f; player.GetCritChance() += 15; 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 b361e9b684..650289817d 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -27,9 +27,17 @@ namespace CalamityMod.Items.Armor.DesertProwler public static readonly SoundStyle SmokeBombEndSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombEnd"); public static readonly SoundStyle CDResetSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerCDReset"); - public static int SmokeCooldown = 25 * 60; - public static int SmokeDuration = 5 * 60; - public static int LightsOutReset = (int)(1.5f * 60); + public static int RogueCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); + + // Set Bonus + public static float SetBonusRogueStealth = 0.5f; + 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; @@ -40,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(); @@ -77,10 +66,10 @@ namespace CalamityMod.Items.Armor.DesertProwler public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(); //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 += 0.5f; - player.GetDamage() += 0.05f; + player.Calamity().rogueStealthMax += SetBonusRogueStealth; DesertProwlerPlayer armorPlayer = player.GetModPlayer(); armorPlayer.desertProwlerSet = true; @@ -90,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++) @@ -156,36 +145,10 @@ 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() += 4; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RogueCritBoost; public override void AddRecipes() { @@ -203,6 +166,9 @@ namespace CalamityMod.Items.Armor.DesertProwler public new string LocalizationCategory => "Items.Armor.PreHardmode"; public string BulkTexture => "CalamityMod/Items/Armor/DesertProwler/DesertProwlerShirt_Bulk"; + public static float RogueDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetStaticDefaults() { if (Main.dedServ) @@ -220,15 +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() += 5; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { @@ -245,19 +206,23 @@ namespace CalamityMod.Items.Armor.DesertProwler public class DesertProwlerPants : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RogueCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); + public override void SetDefaults() { Item.width = 18; 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 += 0.1f; } public override void AddRecipes() @@ -272,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 bf80cf38b8..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,14 +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.statLifeMax2 += 20; - 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 be0e044c58..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,9 +38,8 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.endurance += 0.06f; - 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/Fearmonger/FearmongerGreathelm.cs b/Items/Armor/Fearmonger/FearmongerGreathelm.cs index d384cb6fb5..ade4c8e7b0 100644 --- a/Items/Armor/Fearmonger/FearmongerGreathelm.cs +++ b/Items/Armor/Fearmonger/FearmongerGreathelm.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor.Fearmonger { player.statManaMax2 += 60; player.GetDamage() += 0.1f; - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; } public override bool IsArmorSet(Item head, Item body, Item legs) 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/GodSlayer/GodSlayerChestplate.cs b/Items/Armor/GodSlayer/GodSlayerChestplate.cs index 7c21d4aa79..815eeb87e7 100644 --- a/Items/Armor/GodSlayer/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayer/GodSlayerChestplate.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor.GodSlayer { var modPlayer = player.Calamity(); player.thorns += 0.5f; - player.statLifeMax2 += 60; + player.statLifeMax2 += 50; player.GetDamage() += 0.11f; player.GetCritChance() += 8; } diff --git a/Items/Armor/Hydrothermic/HydrothermicArmor.cs b/Items/Armor/Hydrothermic/HydrothermicArmor.cs index b1801d6c38..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,9 +33,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; - 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 6bf014726a..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.85f; } 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 f67aa39d0f..ed9c3cea1c 100644 --- a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs +++ b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs @@ -16,6 +16,7 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameInput; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using static Microsoft.Xna.Framework.Input.Keys; using static Terraria.ModLoader.ModContent; @@ -32,8 +33,13 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public static readonly SoundStyle LiftGoAwaySound = new("CalamityMod/Sounds/Item/MarniteLiftUnsummon"); public static readonly SoundStyle LiftHummSound = new("CalamityMod/Sounds/Item/MarniteLiftHumm") { IsLooped = true }; + public static int TileRangeBoost = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(TileRangeBoost); + + // 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() { @@ -86,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; } @@ -95,32 +102,11 @@ namespace CalamityMod.Items.Armor.MarniteArchitect //Tile range is a static variable did you know that? That's quite funny. I assume it's just because its not like other players would need to know about the players reach if (Main.myPlayer == player.whoAmI) { - Player.tileRangeX += 5; - Player.tileRangeY += 5; //Extendo grip also increases vertical tile range by one less than horizontal <-- This is silly lmao + Player.tileRangeX += TileRangeBoost; + Player.tileRangeY += TileRangeBoost; //Extendo grip also increases vertical tile range by one less than horizontal <-- This is silly lmao } } - 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(). @@ -136,6 +122,10 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public class MarniteArchitectToga : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float PlacementSpeedBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(PlacementSpeedBoost.ToPercent()); + public override void Load() { if (Main.dedServ) @@ -143,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; @@ -160,13 +144,10 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public override void UpdateEquip(Player player) { - player.tileSpeed += 0.5f; - player.wallSpeed += 0.5f; + player.tileSpeed += PlacementSpeedBoost; + 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..22a247b1e7 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -1,11 +1,12 @@ -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,64 +17,55 @@ 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 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; - } - - if (player.whoAmI == Main.myPlayer) - { - var source = player.GetSource_Accessory(Item); - if (player.immune) - { - if (player.miscCounter % 10 == 0) - { - var damage = (int)player.GetTotalDamage().ApplyTo(40); - - var cinder = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 4f, player.whoAmI); - if (cinder.whoAmI.WithinBounds(Main.maxProjectiles)) - cinder.DamageType = DamageClass.Generic; - } - } + player.GetDamage() += BlackoutRangedDamageBoost; + player.GetCritChance() += BlackoutRangedCritBoost; } } 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..c94900de0e 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.16f; + 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 92ed645a33..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,19 +38,13 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; - player.statLifeMax2 += 20; + 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) { @@ -49,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 d21c375da9..5cb45254a2 100644 --- a/Items/Armor/Prismatic/PrismaticHelmet.cs +++ b/Items/Armor/Prismatic/PrismaticHelmet.cs @@ -38,10 +38,9 @@ namespace CalamityMod.Items.Armor.Prismatic { player.Calamity().prismaticSet = true; player.statManaMax2 += 40; - player.manaCost *= 0.85f; + 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/Prismatic/PrismaticRegalia.cs b/Items/Armor/Prismatic/PrismaticRegalia.cs index 05f840849e..520c548143 100644 --- a/Items/Armor/Prismatic/PrismaticRegalia.cs +++ b/Items/Armor/Prismatic/PrismaticRegalia.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Armor.Prismatic public override void UpdateEquip(Player player) { player.Calamity().prismaticRegalia = true; - player.statLifeMax2 += 20; player.statManaMax2 += 40; player.GetDamage() += 0.12f; player.GetCritChance() += 15; 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 4b4f5a5f6d..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,15 +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.statLifeMax2 += 20; - 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/Silva/SilvaArmor.cs b/Items/Armor/Silva/SilvaArmor.cs index 28c354ad14..e3250d25d5 100644 --- a/Items/Armor/Silva/SilvaArmor.cs +++ b/Items/Armor/Silva/SilvaArmor.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor.Silva public override void UpdateEquip(Player player) { - player.statLifeMax2 += 80; + player.statLifeMax2 += 50; player.GetDamage() += 0.11f; player.GetCritChance() += 8; } diff --git a/Items/Armor/Silva/SilvaHeadMagic.cs b/Items/Armor/Silva/SilvaHeadMagic.cs index bd16f1c2ad..aae31f716a 100644 --- a/Items/Armor/Silva/SilvaHeadMagic.cs +++ b/Items/Armor/Silva/SilvaHeadMagic.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor.Silva public override void UpdateEquip(Player player) { - player.manaCost *= 0.81f; + player.manaCost -= 0.19f; player.GetDamage() += 0.23f; player.GetCritChance() += 13; player.statManaMax2 += 100; diff --git a/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs b/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs index 67aa4cc310..eb8c2b383c 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.SnowRuffian @@ -8,6 +9,10 @@ namespace CalamityMod.Items.Armor.SnowRuffian public class SnowRuffianChestplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); + public override void Load() { if (Main.dedServ) @@ -19,7 +24,6 @@ namespace CalamityMod.Items.Armor.SnowRuffian public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -38,10 +42,7 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.defense = 5; //12 } - public override void UpdateEquip(Player player) - { - player.GetCritChance() += 4; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { diff --git a/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs b/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs index d400b91e37..8c1bbf66ac 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.SnowRuffian @@ -8,6 +9,10 @@ namespace CalamityMod.Items.Armor.SnowRuffian public class SnowRuffianGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); + public override void SetDefaults() { Item.width = 18; @@ -17,10 +22,7 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.defense = 4; //12 } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.1f; - } + 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 b3365ce50c..7a54d2afea 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianMask.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianMask.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.SnowRuffian @@ -9,8 +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 int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); + + // Set Bonus + public static float GlideFallSpeedMult = 0.9f; + public static int SetBonusFrostburnDuration = CalamityUtils.SecondsToFrames(3); public override void Load() { @@ -26,43 +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() += 4; - player.GetDamage() += 0.04f; - player.setBonus = this.GetLocalizedValue("SetBonus"); - - 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() += 0.02f; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { @@ -75,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/StatigelArmor.cs b/Items/Armor/Statigel/StatigelArmor.cs index 0ff1c28e1f..bb2ce6cdf8 100644 --- a/Items/Armor/Statigel/StatigelArmor.cs +++ b/Items/Armor/Statigel/StatigelArmor.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -10,9 +11,16 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelArmor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int CritBoost = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost); + + // Common Set Bonus + public static float SetBonusJumpSpeedBoost = 0.6f; + public static float SetBonusJumpHeightPercentBoost = 0.3334f; + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -31,14 +39,14 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 10; } - public override void UpdateEquip(Player player) => player.GetCritChance() += 5; + public override void UpdateEquip(Player player) => player.GetCritChance() += CritBoost; public override void AddRecipes() { CreateRecipe(). AddIngredient(12). AddIngredient(12). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Armor/Statigel/StatigelGreaves.cs b/Items/Armor/Statigel/StatigelGreaves.cs index ce2b1d9665..26d9f5f81b 100644 --- a/Items/Armor/Statigel/StatigelGreaves.cs +++ b/Items/Armor/Statigel/StatigelGreaves.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float DamageBoost = 0.05f; + public static float MoveSpeedBoost = 0.05f; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -21,8 +27,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; - player.moveSpeed += 0.05f; + player.GetDamage() += DamageBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() @@ -30,7 +36,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(7). AddIngredient(7). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Armor/Statigel/StatigelHeadMagic.cs b/Items/Armor/Statigel/StatigelHeadMagic.cs index e4c60df6fc..51097e8f85 100644 --- a/Items/Armor/Statigel/StatigelHeadMagic.cs +++ b/Items/Armor/Statigel/StatigelHeadMagic.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,13 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int MaxManaBoost = 40; + 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() { Item.width = 18; @@ -21,27 +29,24 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 5; //22 } - 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 = CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; - player.manaCost *= 0.9f; - player.statManaMax2 += 40; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; + player.manaCost -= ManaCostReduction; + player.statManaMax2 += MaxManaBoost; } public override void AddRecipes() @@ -49,7 +54,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadMelee.cs b/Items/Armor/Statigel/StatigelHeadMelee.cs index 078d4805df..3e8b5f86f4 100644 --- a/Items/Armor/Statigel/StatigelHeadMelee.cs +++ b/Items/Armor/Statigel/StatigelHeadMelee.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,15 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MeleeDamageBoost = 0.1f; + public static float MeleeSpeedBoost = 0.1f; // NOTE: Tooltip shares this number with damage % as they're equal + public static int MeleeCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeCritBoost); + + // Set Bonus + public static int SetBonusAggroBoost = 400; + public override void SetDefaults() { Item.width = 18; @@ -21,27 +31,25 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 9; //27 } - 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") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalizedValue("SetBonus") + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; - player.aggro += 400; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; + player.aggro += SetBonusAggroBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; - player.GetAttackSpeed() += 0.1f; + player.GetDamage() += MeleeDamageBoost; + player.GetCritChance() += MeleeCritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() @@ -49,7 +57,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadRanged.cs b/Items/Armor/Statigel/StatigelHeadRanged.cs index 25820004c8..17294e9b1d 100644 --- a/Items/Armor/Statigel/StatigelHeadRanged.cs +++ b/Items/Armor/Statigel/StatigelHeadRanged.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,11 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RangedDamageBoost = 0.1f; + public static int RangedCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public override void SetDefaults() { Item.width = 18; @@ -21,25 +27,22 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 7; //25 } - 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 = CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; } public override void AddRecipes() @@ -47,7 +50,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadRogue.cs b/Items/Armor/Statigel/StatigelHeadRogue.cs index fab0c20533..2d1a5b96d5 100644 --- a/Items/Armor/Statigel/StatigelHeadRogue.cs +++ b/Items/Armor/Statigel/StatigelHeadRogue.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,15 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.1f; + public static int RogueCritBoost = 7; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 0.9f; + public override void SetDefaults() { Item.width = 18; @@ -21,28 +31,26 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 6; //23 } - 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") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - modPlayer.rogueStealthMax += 0.9f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() @@ -50,7 +58,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index 44b9d4b2f4..e6a57a835a 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -7,6 +7,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -16,6 +17,13 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusSummonDamageBoost = 0.15f; public static int SlimeDamage = 18; public override void SetDefaults() @@ -27,22 +35,19 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 4; //20 } - 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") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusSummonDamageBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; modPlayer.slimeGod = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; - player.GetDamage() += 0.18f; - player.maxMinions++; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; + player.GetDamage() += SetBonusSummonDamageBoost; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); @@ -66,7 +71,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateEquip(Player player) { - player.GetKnockback() += 1.5f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } public override void AddRecipes() @@ -74,7 +80,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Sulphurous/SulphurousBreastplate.cs b/Items/Armor/Sulphurous/SulphurousBreastplate.cs index bf6118be31..e28b61c5e4 100644 --- a/Items/Armor/Sulphurous/SulphurousBreastplate.cs +++ b/Items/Armor/Sulphurous/SulphurousBreastplate.cs @@ -1,7 +1,8 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Sulphurous @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Armor.Sulphurous public class SulphurousBreastplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.06f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 24; @@ -20,11 +25,7 @@ namespace CalamityMod.Items.Armor.Sulphurous Item.rare = ItemRarityID.Green; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.06f; - player.GetCritChance() += 4; - } + 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 5f7dfb45c1..d61781b6ea 100644 --- a/Items/Armor/Sulphurous/SulphurousHelmet.cs +++ b/Items/Armor/Sulphurous/SulphurousHelmet.cs @@ -1,9 +1,10 @@ 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; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Sulphurous @@ -13,6 +14,15 @@ namespace CalamityMod.Items.Armor.Sulphurous public class SulphurousHelmet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + 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; + public override void SetDefaults() { Item.width = 26; @@ -29,19 +39,17 @@ namespace CalamityMod.Items.Armor.Sulphurous public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusPoisonDuration.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.sulphurSet = true; player.GetJumpState().Enable(); - modPlayer.rogueStealthMax += 0.65f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.ignoreWater = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.04f; - player.GetCritChance() += 2; + 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 ebca7b0c38..b9ed660705 100644 --- a/Items/Armor/Sulphurous/SulphurousLeggings.cs +++ b/Items/Armor/Sulphurous/SulphurousLeggings.cs @@ -1,7 +1,8 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Sulphurous @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Armor.Sulphurous public class SulphurousLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.04f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 22; @@ -20,10 +25,7 @@ namespace CalamityMod.Items.Armor.Sulphurous Item.rare = ItemRarityID.Green; } - public override void UpdateEquip(Player player) - { - player.moveSpeed += player.Calamity().countsAsAnyWet ? 0.35f : 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Tarragon/TarragonBreastplate.cs b/Items/Armor/Tarragon/TarragonBreastplate.cs index e8f74b9a7e..9c37bd9f9b 100644 --- a/Items/Armor/Tarragon/TarragonBreastplate.cs +++ b/Items/Armor/Tarragon/TarragonBreastplate.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void UpdateEquip(Player player) { - player.statLifeMax2 += 40; + player.statLifeMax2 += 25; player.GetDamage() += 0.1f; player.GetCritChance() += 5; } diff --git a/Items/Armor/Tarragon/TarragonHeadMagic.cs b/Items/Armor/Tarragon/TarragonHeadMagic.cs index 1faa537056..a9b0fac606 100644 --- a/Items/Armor/Tarragon/TarragonHeadMagic.cs +++ b/Items/Armor/Tarragon/TarragonHeadMagic.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void UpdateEquip(Player player) { - player.manaCost *= 0.85f; + player.manaCost -= 0.15f; player.GetDamage() += 0.15f; player.GetCritChance() += 10; player.endurance += 0.1f; 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 ae7ef7e9f4..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,21 +11,20 @@ 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; Item.height = 18; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; - Item.defense = 14; + 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 fbd3c17cd5..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,9 +11,13 @@ 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) return; @@ -28,13 +33,13 @@ namespace CalamityMod.Items.Armor.TitanHeart Item.height = 18; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; - Item.defense = 17; + Item.defense = 14; } 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 03b99c9fa4..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,27 +12,34 @@ 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; Item.height = 18; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; - Item.defense = 12; //43 + 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..5da260e68e --- /dev/null +++ b/Items/Armor/Victide/VictideHeadBarrier.cs @@ -0,0 +1,77 @@ +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 = 5; + public static float BarrierDamageAbsorptionPercent = 0.1f; + public static int BarrierFramesPerHeal = 15; + 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 = 6; // 15 + } + + 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..8eaf0ed7be --- /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(7); + 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 4717a713b6..f27d55f4a1 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -35,11 +35,16 @@ namespace CalamityMod.Items.Armor.Wulfrum public static readonly SoundStyle SetBreakSound = new("CalamityMod/Sounds/Custom/AbilitySounds/WulfrumBastionBreak"); public static readonly SoundStyle SetBreakSoundSafe = new("CalamityMod/Sounds/Custom/AbilitySounds/WulfrumBastionBreakSafely"); - public static int MinionSlotBoost = 1; - 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 float SummonDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int BastionDefenseBoost = 12; + public static float BastionDRBoost = 0.1f; + 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. @@ -57,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; } @@ -67,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) { @@ -117,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(); @@ -132,8 +110,9 @@ namespace CalamityMod.Items.Armor.Wulfrum armorPlayer.wulfrumSet = true; - player.setBonus = this.GetLocalization("SetBonus").Format(MinionSlotBoost); //The cooler part of the set bonus happens in modifytooltips because I can't recolor it otherwise. Madge - player.maxMinions += MinionSlotBoost; + 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) @@ -142,8 +121,8 @@ namespace CalamityMod.Items.Armor.Wulfrum } //Stats - player.statDefense += 13; - player.endurance += 0.05f; //10% DR in total with the chestplate + player.statDefense += BastionDefenseBoost; + player.endurance += BastionDRBoost; //Can't account for previous fullbody transformations but at this point, whatever bool transformed = player.Transformation().Type == ItemType(); @@ -222,41 +201,7 @@ 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() += 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += SummonDamageBoost; public override void AddRecipes() { @@ -273,6 +218,10 @@ namespace CalamityMod.Items.Armor.Wulfrum public class WulfrumJacket : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int MinionSlotBoost = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost); + public override void SetStaticDefaults() { if (!Main.dedServ) @@ -292,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.endurance += 0.05f; + public override void UpdateEquip(Player player) => player.maxMinions += MinionSlotBoost; public override void AddRecipes() { @@ -311,6 +258,10 @@ namespace CalamityMod.Items.Armor.Wulfrum public class WulfrumOveralls : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float SummonDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -325,11 +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 += 0.05f; - } + + public override void UpdateEquip(Player player) => player.GetDamage() += SummonDamageBoost; public override void AddRecipes() { @@ -344,10 +292,6 @@ namespace CalamityMod.Items.Armor.Wulfrum public class WulfrumArmorPlayer : ModPlayer { - public static int BastionShootDamage = 10; - public static float BastionShootSpeed = 18f; - public static int BastionShootTime = 10; - public bool wulfrumSet = false; public override void ResetEffects() diff --git a/Items/BaseItems/TransformationAccessory.cs b/Items/BaseItems/TransformationAccessory.cs index 01af6d62e9..f929462815 100644 --- a/Items/BaseItems/TransformationAccessory.cs +++ b/Items/BaseItems/TransformationAccessory.cs @@ -84,11 +84,13 @@ namespace CalamityMod.Items.BaseItems { public override void Load() { + On_Player.ResetVisibleAccessories += ResetTransformation; On_Player.UpdateVisibleAccessory += SetTransformationItem; } internal TransformationAccessory currentTransformation = null; - int prevSlot = -1; + int previousHighest = -1; + int currentHighest = -1; public int Type { @@ -107,20 +109,36 @@ namespace CalamityMod.Items.BaseItems } } + private void ResetTransformation(On_Player.orig_ResetVisibleAccessories orig, Player self) + { + orig(self); + + Reset(self); + } + + private void Reset(Player p) + { + previousHighest = currentHighest; + currentHighest = -1; + + if (p.Transformation().currentTransformation != null && !p.Transformation().currentTransformation.IsForced) + p.Transformation().currentTransformation = null; + } + private void SetTransformationItem(On_Player.orig_UpdateVisibleAccessory orig, Player self, int itemSlot, Item item, bool modded) { orig(self, itemSlot, item, modded); if (self.Transformation().currentTransformation == null || !self.Transformation().currentTransformation.IsForced) { - if (self.Transformation().prevSlot > itemSlot) //determines if we're on the first visible slot (as this isnt called on non-visible slots) - self.Transformation().currentTransformation = null; - if (item.ModItem is TransformationAccessory transformation && transformation.ShouldTransform.Invoke(self) && (currentTransformation == null || transformation.Priority >= currentTransformation.Priority)) self.Transformation().currentTransformation = transformation; } - if (self.Transformation().currentTransformation != null && itemSlot == 19) // last item slot, can set equip slots to our transformation if one is equipped + if (currentHighest < itemSlot) + currentHighest = itemSlot; + + if (self.Transformation().currentTransformation != null && itemSlot == previousHighest) // last item slot, can set equip slots to our transformation if one is equipped { TransformationAccessory trans = self.Transformation().currentTransformation; bool[] list = new bool[15]; @@ -133,11 +151,9 @@ namespace CalamityMod.Items.BaseItems list[(int)Type] = true; } } - if(trans.ShouldHideAccessories) + if (trans.ShouldHideAccessories) self.HideAccessories(); } - - self.Transformation().prevSlot = itemSlot; } public override void UpdateAutopause() @@ -151,6 +167,8 @@ namespace CalamityMod.Items.BaseItems SetEquipSlot(Player, EquipType.Head, Mod, name); } } + + Reset(Player); } public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 824567cb3a..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); } @@ -731,41 +701,6 @@ namespace CalamityMod.Items { return false; } - if (player.ActiveItem().type == ModContent.ItemType()) - { - bool hasBlades = false; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI && p.localAI[1] == 0f) - { - hasBlades = true; - break; - } - } - if (hasBlades) - { - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.ModProjectile is IgneousBlade) - { - if (p.ModProjectile().Firing) - continue; - } - if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI && p.localAI[1] == 0f) - { - p.rotation = MathHelper.PiOver2 + MathHelper.PiOver4; - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - p.velocity = p.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY) * 22f; - p.rotation += p.velocity.ToRotation(); - p.ai[0] = 180f; - p.ModProjectile().Firing = true; - p.tileCollide = true; - p.netUpdate = true; - } - } - } - return false; - } if (player.ActiveItem().type == ModContent.ItemType() && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) { foreach (Projectile p in Main.ActiveProjectiles) @@ -844,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)) { @@ -912,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; } @@ -1303,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; @@ -1502,9 +1430,6 @@ namespace CalamityMod.Items if (item.type == ItemID.FleshKnuckles || item.type == ItemID.BerserkerGlove || item.type == ItemID.HeroShield) modPlayer.fleshKnuckles = true; - if (item.type == ItemID.WormScarf) - player.endurance -= 0.03f; - if (item.type == ItemID.RoyalGel) modPlayer.royalGel = true; @@ -1524,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; @@ -1574,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]) @@ -1677,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 @@ -1793,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 bdf23947ce..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; @@ -51,8 +51,8 @@ namespace CalamityMod.Items // We don't care. case ItemID.EaterOfWorldsBossBag: var eowRevLCR = loot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.revenge)); - eowRevLCR.Add(ItemID.DemoniteOre, 1, 90, 135); // 100% 90-135 Demonite Ore - eowRevLCR.Add(ItemID.ShadowScale, 1, 35, 55); // 100% 35-55 Shadow Scale + eowRevLCR.Add(ItemID.DemoniteOre, 1, 70, 90); // 100% 70-90 Demonite Ore + eowRevLCR.Add(ItemID.ShadowScale, 1, 20, 30); // 100% 20-30 Shadow Scale loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; @@ -62,11 +62,9 @@ namespace CalamityMod.Items // This can theoretically be exploited by killing the boss on Expert, then turning on Rev to open the bags. // We don't care. case ItemID.BrainOfCthulhuBossBag: - // BoC drops less partial loot than EoW - // However, sell price is overall higher despite the lower yield var bocRevLCR = loot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.revenge)); - bocRevLCR.Add(ItemID.CrimtaneOre, 1, 80, 120); // 100% 80-120 Crimtane Ore - bocRevLCR.Add(ItemID.TissueSample, 1, 25, 40); // 100% 25-40 Tissue Sample + bocRevLCR.Add(ItemID.CrimtaneOre, 1, 70, 90); // 100% 70-90 Crimtane Ore + bocRevLCR.Add(ItemID.TissueSample, 1, 20, 30); // 100% 20-30 Tissue Sample loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; @@ -95,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); @@ -147,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 66b782bf2c..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); } @@ -580,10 +572,6 @@ namespace CalamityMod.Items if (item.type == ItemID.ArcheryPotion) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcheryPotion")); - // Buffed Ironskin Potion tooltip - if (item.type == ItemID.IronskinPotion) - EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("IronskinPotion").Format(CalamityUtils.GetScalingDefense(-1))); - // Nerfed Swiftness Potion tooltip if (item.type == ItemID.SwiftnessPotion) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); @@ -621,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 @@ -787,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")); @@ -810,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) @@ -902,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) @@ -935,10 +908,6 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("15%", "9%")); } - // Worm Scarf only gives 14% DR instead of 17% - if (item.type == ItemID.WormScarf) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("17%", "14%")); - // Feral Claws line melee speed and true melee damage changes if (item.type == ItemID.FeralClaws) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("12%", "10%")); @@ -988,63 +957,15 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.Text = EditedTooltip("Gi")); #endregion - // Pre-Hardmode ore armor tooltip edits - #region Pre-Hardmode Ore Armor - // Copper - if (item.type == ItemID.CopperHelmet) - AddTooltip("CopperHelmet"); - if (item.type == ItemID.CopperChainmail) - AddTooltip("CopperChainmail"); - if (item.type == ItemID.CopperGreaves) - AddTooltip("CopperGreaves"); - - // Tin - if (item.type == ItemID.TinHelmet) - AddTooltip("TinHelmet"); - if (item.type == ItemID.TinChainmail) - AddTooltip("TinChainmail"); - if (item.type == ItemID.TinGreaves) - AddTooltip("TinGreaves"); - - // Iron - if (item.type == ItemID.IronHelmet || item.type == ItemID.AncientIronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) - AddTooltip("IronPieces"); - - // Lead - if (item.type == ItemID.LeadHelmet || item.type == ItemID.LeadChainmail || item.type == ItemID.LeadGreaves) - AddTooltip("LeadPieces"); - - // Silver - if (item.type == ItemID.SilverHelmet) - AddTooltip("SilverHelmet"); - if (item.type == ItemID.SilverChainmail) - AddTooltip("SilverChainmail"); - if (item.type == ItemID.SilverGreaves) - AddTooltip("SilverGreaves"); - - // Tungsten - if (item.type == ItemID.TungstenHelmet) - AddTooltip("TungstenHelmet"); - if (item.type == ItemID.TungstenChainmail) - AddTooltip("TungstenChainmail"); - if (item.type == ItemID.TungstenGreaves) - AddTooltip("TungstenGreaves"); - - // Gold - if (item.type == ItemID.GoldHelmet || item.type == ItemID.AncientGoldHelmet) - AddTooltip("GoldHelmet"); - if (item.type == ItemID.GoldChainmail) - AddTooltip("GoldChainmail"); - if (item.type == ItemID.GoldGreaves) - AddTooltip("GoldGreaves"); - - // Platinum - if (item.type == ItemID.PlatinumHelmet) - AddTooltip("PlatinumHelmet"); - if (item.type == ItemID.PlatinumChainmail) - AddTooltip("PlatinumChainmail"); - if (item.type == ItemID.PlatinumGreaves) - AddTooltip("PlatinumGreaves"); + // 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) @@ -1073,7 +994,7 @@ namespace CalamityMod.Items #endregion // Hardmode armor tooltip edits - #region Hardmode Ore Armor + #region Hardmode Armor // Cobalt if (item.type == ItemID.CobaltHat) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", $"{CobaltArmorSetChange.MaxManaBoost + 40}")); @@ -1190,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 @@ -1217,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 @@ -1560,20 +1475,16 @@ namespace CalamityMod.Items switch (item.prefix) { case PrefixID.Hard: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("1", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(0.25f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(0.25f)); return; case PrefixID.Guarding: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("2", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(0.5f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(0.5f)); return; case PrefixID.Armored: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("3", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(0.75f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(0.75f)); return; case PrefixID.Warding: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("4", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(1f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(1f)); return; case PrefixID.Lucky: EditTooltipByName("PrefixAccCritChance", (line) => line.Text += AddedTooltip("LuckyPrefix")); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index cf223874a0..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,33 +55,34 @@ 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)) }, { ItemID.CorruptYoyo, Do(AutoReuse, DamageExact(20)) }, // Malaise { ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery { ItemID.CrystalBullet, Do(DamageExact(6)) }, @@ -95,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)) }, @@ -124,8 +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.GoldCoin, Do(DamageExact(75)) }, // For Coin Gun + { 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,20 +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.PlatinumCoin, Do(DamageExact(150)) }, // For Coin Gun + { 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)) }, @@ -211,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)) }, @@ -220,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)) }, @@ -254,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, @@ -265,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)) }, @@ -278,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)) }, @@ -300,35 +295,13 @@ namespace CalamityMod.Items #endregion #region CATEGORY 2: Defense Balancing - { ItemID.AncientHallowedGreaves, Do(DefenseDelta(+2)) }, - { ItemID.AncientHallowedPlateMail, Do(DefenseDelta(+3)) }, - { ItemID.AnkhShield, Do(DefenseDelta(+4)) }, // 8 total - { ItemID.CobaltShield, Do(DefenseDelta(+3)) }, // 4 total - { ItemID.EoCShield, Do(DefenseDelta(+1)) }, // Shield of Cthulhu - { ItemID.FrozenShield, Do(DefenseDelta(+4)) }, // 10 total (plus the Frozen Turtle Shell DR effect) - { ItemID.FrozenTurtleShell, Do(DefenseExact(6)) }, - { ItemID.HallowedGreaves, Do(DefenseDelta(+2)) }, - { ItemID.HallowedPlateMail, Do(DefenseDelta(+3)) }, - { ItemID.HeroShield, Do(DefenseDelta(+5)) }, // 15 total (plus increased max life) - { ItemID.LavaSkull, Do(DefenseExact(4)) }, // Magma Skull - { ItemID.MoltenCharm, Do(DefenseExact(4)) }, //Magma Charm - { ItemID.MoltenSkullRose, Do(DefenseExact(8)) }, - { ItemID.ObsidianShield, Do(DefenseDelta(+4)) }, // 6 total - { ItemID.ObsidianSkull, Do(DefenseDelta(+1)) }, // 2 total - { ItemID.ObsidianSkullRose, Do(DefenseExact(4)) }, - { ItemID.OrichalcumBreastplate, Do(DefenseDelta(+3)) }, - { ItemID.OrichalcumHeadgear, Do(DefenseDelta(+2)) }, - { ItemID.OrichalcumHelmet, Do(DefenseDelta(+3)) }, - { ItemID.OrichalcumLeggings, Do(DefenseDelta(+4)) }, - { ItemID.OrichalcumMask, Do(DefenseDelta(+3)) }, - { ItemID.PaladinsShield, Do(DefenseDelta(+2)) }, // 8 total - { ItemID.PalladiumBreastplate, Do(DefenseDelta(+3)) }, - { ItemID.PalladiumHeadgear, Do(DefenseDelta(+2)) }, - { ItemID.PalladiumHelmet, Do(DefenseDelta(+3)) }, - { ItemID.PalladiumMask, Do(DefenseDelta(+1)) }, - { ItemID.PalladiumLeggings, Do(DefenseDelta(+3)) }, - { ItemID.Shackle, Do(DefenseDelta(+2)) }, // 3 total - { ItemID.SquireAltHead, Do(DefenseDelta(-2)) }, + { ItemID.LavaSkull, Do(DefenseExact(3)) }, // Magma Skull + { ItemID.MoltenCharm, Do(DefenseExact(3)) }, //Magma Charm + { ItemID.MoltenSkullRose, Do(DefenseExact(4)) }, + { ItemID.ObsidianSkull, Do(DefenseExact(2)) }, + { ItemID.ObsidianSkullRose, Do(DefenseExact(3)) }, + { ItemID.Shackle, Do(DefenseExact(3)) }, + { ItemID.SquireAltHead, Do(DefenseDelta(-2)) }, // Valhalla Knight set { ItemID.SquireAltPants, Do(DefenseDelta(-3)) }, { ItemID.SquireAltShirt, Do(DefenseDelta(-3)) }, { ItemID.SquireGreatHelm, Do(DefenseDelta(-1)) }, @@ -451,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 @@ -524,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) }, @@ -551,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) }, @@ -570,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 @@ -1021,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 { @@ -1382,15 +1314,14 @@ namespace CalamityMod.Items var shimmerTransmute = ItemID.Sets.ShimmerTransformToItem; // Note: Making Luminite Ore -> Astral Ore makes Deus almost completely skippable with no (recipe-related) downsides. - + // Adding Cryonic Ore to the shimmer chain has the same issue. shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = ItemID.LunarOre; shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.LunarOre]; - shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); - shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.ChlorophyteOre]; + shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.ChlorophyteOre]; shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.CobaltOre]; //shimmerTransmute[ItemID.LunarOre] = ModContent.ItemType(); diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index 59ffdfced2..3af6d8f825 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.DraedonMisc int insertIndex = list.FindIndex(x => x.Name == "Tooltip2" && x.Mod == "Terraria"); if (insertIndex != -1) { - int meleeItem = ModContent.ItemType(); + int meleeItem = ModContent.ItemType(); TooltipLine meleeDisplay = new TooltipLine(this.Mod, "CalamityMod:MeleeDisplay", $"[i:{meleeItem}] {CalamityUtils.GetItemName(meleeItem)}"); meleeDisplay.OverrideColor = new Color(236, 255, 31); list.Insert(insertIndex + 1, meleeDisplay); 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/Dyes/InvisibleDye.cs b/Items/Dyes/InvisibleDye.cs new file mode 100644 index 0000000000..af27456e67 --- /dev/null +++ b/Items/Dyes/InvisibleDye.cs @@ -0,0 +1,78 @@ +using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil.Cil; +using MonoMod.Cil; +using Terraria; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Dyes +{ + public class InvisibleDye : BaseDye + { + public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(Mod.Assets.Request("Effects/Dyes/InvisibleDyeShader"), "DyePass"); + + public override void SafeSetStaticDefaults() + { + Item.ResearchUnlockCount = 3; + } + + public override void SafeSetDefaults() + { + Item.rare = ItemRarityID.Blue; + Item.value = Item.sellPrice(silver: 20); + } + + #region On Edit Hell To Actually Make Player Body Not Draw + public override void Load() + { + On_PlayerDrawLayers.DrawPlayer_21_Head += StopHeadDrawing; + On_PlayerDrawLayers.DrawPlayer_12_Skin += StopBodyAndLegDrawing; + On_PlayerDrawLayers.DrawPlayer_13_Leggings += StopLegClothesDrawing; + On_PlayerDrawLayers.DrawPlayer_17_Torso += StopBodyClothesDrawing; + On_PlayerDrawLayers.DrawPlayer_12_SkinComposite_BackArmShirt += StopCompositeArmDrawing; + On_PlayerDrawLayers.DrawPlayer_28_ArmOverItem += StopBackArmAndUndershirtDrawing; + } + + private static void StopHeadDrawing(On_PlayerDrawLayers.orig_DrawPlayer_21_Head orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cHead == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopBodyAndLegDrawing(On_PlayerDrawLayers.orig_DrawPlayer_12_Skin orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + drawInfo.hidesTopSkin = true; + if (drawInfo.drawPlayer.cLegs == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + drawInfo.hidesBottomSkin = true; + orig(ref drawInfo); + } + private static void StopLegClothesDrawing(On_PlayerDrawLayers.orig_DrawPlayer_13_Leggings orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cLegs == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopBodyClothesDrawing(On_PlayerDrawLayers.orig_DrawPlayer_17_Torso orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopCompositeArmDrawing(On_PlayerDrawLayers.orig_DrawPlayer_12_SkinComposite_BackArmShirt orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopBackArmAndUndershirtDrawing(On_PlayerDrawLayers.orig_DrawPlayer_28_ArmOverItem orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + #endregion + } +} diff --git a/Items/Dyes/InvisibleDye.png b/Items/Dyes/InvisibleDye.png new file mode 100644 index 0000000000..debd5eea5c Binary files /dev/null and b/Items/Dyes/InvisibleDye.png differ 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/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 9f73c7efe0..07e7f4cb50 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -11,11 +11,11 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { public new string LocalizationCategory => "Items.Fishing"; - public static int RegenBoost = 5; - public static int RegenTimeBoost = 10; + public static int RegenBoost = 4; + public static int RegenTimeBoost = 4; public static int DebuffedRegenBoost = 10; // Does not stack with above - public static int DebuffedRegenTimeFloor = 1800; + public static int DebuffedRegenTimeFloor = 900; public static double ExtraRegenHealthThreshold = 0.75D; public static int FramesForExtraRegen = 30; 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/BloodSample.cs b/Items/Materials/BloodSample.cs deleted file mode 100644 index 5576926d81..0000000000 --- a/Items/Materials/BloodSample.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - public class BloodSample : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.SortingPriorityMaterials[Type] = 68; // Sturdy Fossil - ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); - } - - public override void SetDefaults() - { - Item.width = 26; - Item.height = 34; - Item.maxStack = Item.CommonMaxStack; - Item.value = Item.sellPrice(silver: 2); - Item.rare = ItemRarityID.Orange; - - Item.MakeUsableWithChlorophyteExtractinator(); - } - } -} diff --git a/Items/Materials/BloodSample.png b/Items/Materials/BloodSample.png deleted file mode 100644 index 421a652516..0000000000 Binary files a/Items/Materials/BloodSample.png and /dev/null differ 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/Materials/RottenMatter.cs b/Items/Materials/RottenMatter.cs deleted file mode 100644 index bd79bb3508..0000000000 --- a/Items/Materials/RottenMatter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - [LegacyName("TrueShadowScale")] - public class RottenMatter : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.SortingPriorityMaterials[Type] = 65; // Crimtane Ore - ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); - } - - public override void SetDefaults() - { - Item.width = 28; - Item.height = 32; - Item.maxStack = Item.CommonMaxStack; - Item.value = Item.sellPrice(silver: 2); - Item.rare = ItemRarityID.Orange; - - Item.MakeUsableWithChlorophyteExtractinator(); - } - } -} diff --git a/Items/Materials/RottenMatter.png b/Items/Materials/RottenMatter.png deleted file mode 100644 index b3b9fb798f..0000000000 Binary files a/Items/Materials/RottenMatter.png and /dev/null differ 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 f86823bde7..7082ae07af 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -73,7 +73,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "fryzahh", "HaguriHat", "Heart Plus Up!", - "Hugekraken", "LordMetarex", "Memes", "Mercutio 'Merkalto' Takle", @@ -137,6 +136,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Graydee", "Grox the Great", "Hectique", + "Hugekraken", "Huggles", "Ian-1KV", "IbanPlay", @@ -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/Furniture/ResilientCandle.cs b/Items/Placeables/Furniture/ResilientCandle.cs index 65bc15e3db..0bb9adab8a 100644 --- a/Items/Placeables/Furniture/ResilientCandle.cs +++ b/Items/Placeables/Furniture/ResilientCandle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } diff --git a/Items/Placeables/Furniture/SpitefulCandle.cs b/Items/Placeables/Furniture/SpitefulCandle.cs index a47f64652c..1c6cf59f01 100644 --- a/Items/Placeables/Furniture/SpitefulCandle.cs +++ b/Items/Placeables/Furniture/SpitefulCandle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } diff --git a/Items/Placeables/Furniture/ThaumaticChair.cs b/Items/Placeables/Furniture/ThaumaticChair.cs index 79d46acd0a..32e3c9a452 100644 --- a/Items/Placeables/Furniture/ThaumaticChair.cs +++ b/Items/Placeables/Furniture/ThaumaticChair.cs @@ -5,7 +5,7 @@ using CalamityMod.Items.Placeables.FurnitureAncient; using CalamityMod.Items.Placeables.FurnitureAshen; using CalamityMod.Items.Placeables.FurnitureBotanic; using CalamityMod.Items.Placeables.FurnitureCosmilite; -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using CalamityMod.Items.Placeables.FurnitureExo; using CalamityMod.Items.Placeables.FurnitureMarnite; using CalamityMod.Items.Placeables.FurnitureMonolith; @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Placeables.Furniture AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). diff --git a/Items/Placeables/Furniture/VigorousCandle.cs b/Items/Placeables/Furniture/VigorousCandle.cs index 6de8e51070..e203002839 100644 --- a/Items/Placeables/Furniture/VigorousCandle.cs +++ b/Items/Placeables/Furniture/VigorousCandle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } diff --git a/Items/Placeables/Furniture/WeightlessCandle.cs b/Items/Placeables/Furniture/WeightlessCandle.cs index b6ba17a590..834e56cb4d 100644 --- a/Items/Placeables/Furniture/WeightlessCandle.cs +++ b/Items/Placeables/Furniture/WeightlessCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } 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/Furniture/CraftingStations/AncientAltar.cs b/Items/Placeables/FurnitureAncient/AncientAltar.cs similarity index 66% rename from Items/Placeables/Furniture/CraftingStations/AncientAltar.cs rename to Items/Placeables/FurnitureAncient/AncientAltar.cs index 5af066ec73..0a34f22f7e 100644 --- a/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs +++ b/Items/Placeables/FurnitureAncient/AncientAltar.cs @@ -4,28 +4,23 @@ using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientAltar : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(10). AddIngredient(5). - AddTile(TileID.Anvils). + AddTile(ModContent.TileType()). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/AncientAltar.png b/Items/Placeables/FurnitureAncient/AncientAltar.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/AncientAltar.png rename to Items/Placeables/FurnitureAncient/AncientAltar.png diff --git a/Items/Placeables/FurnitureAncient/AncientBasin.cs b/Items/Placeables/FurnitureAncient/AncientBasin.cs index 13ce692fbb..ec7caa55c0 100644 --- a/Items/Placeables/FurnitureAncient/AncientBasin.cs +++ b/Items/Placeables/FurnitureAncient/AncientBasin.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(10). AddIngredient(5). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientBathtub.cs b/Items/Placeables/FurnitureAncient/AncientBathtub.cs index 6e4f0a4bf1..c95fa1da0e 100644 --- a/Items/Placeables/FurnitureAncient/AncientBathtub.cs +++ b/Items/Placeables/FurnitureAncient/AncientBathtub.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientBed.cs b/Items/Placeables/FurnitureAncient/AncientBed.cs index 09a2cc6c59..91b7f8f97f 100644 --- a/Items/Placeables/FurnitureAncient/AncientBed.cs +++ b/Items/Placeables/FurnitureAncient/AncientBed.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientBookcase.cs b/Items/Placeables/FurnitureAncient/AncientBookcase.cs index ff4c9d256c..f68aa1ae4e 100644 --- a/Items/Placeables/FurnitureAncient/AncientBookcase.cs +++ b/Items/Placeables/FurnitureAncient/AncientBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientChair.cs b/Items/Placeables/FurnitureAncient/AncientChair.cs index 2d72d10df0..69328c6969 100644 --- a/Items/Placeables/FurnitureAncient/AncientChair.cs +++ b/Items/Placeables/FurnitureAncient/AncientChair.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientChandelier.cs b/Items/Placeables/FurnitureAncient/AncientChandelier.cs index 8868fe6ff2..3c603f551d 100644 --- a/Items/Placeables/FurnitureAncient/AncientChandelier.cs +++ b/Items/Placeables/FurnitureAncient/AncientChandelier.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientDoor.cs b/Items/Placeables/FurnitureAncient/AncientDoor.cs index 6182a586f9..0ae58a1326 100644 --- a/Items/Placeables/FurnitureAncient/AncientDoor.cs +++ b/Items/Placeables/FurnitureAncient/AncientDoor.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientDresser.cs b/Items/Placeables/FurnitureAncient/AncientDresser.cs index 7724410586..62b6fc0f83 100644 --- a/Items/Placeables/FurnitureAncient/AncientDresser.cs +++ b/Items/Placeables/FurnitureAncient/AncientDresser.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientLamp.cs b/Items/Placeables/FurnitureAncient/AncientLamp.cs index ae71b05abc..9f61fda5fe 100644 --- a/Items/Placeables/FurnitureAncient/AncientLamp.cs +++ b/Items/Placeables/FurnitureAncient/AncientLamp.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientLantern.cs b/Items/Placeables/FurnitureAncient/AncientLantern.cs index 6dc360c7b1..74bcc5acfc 100644 --- a/Items/Placeables/FurnitureAncient/AncientLantern.cs +++ b/Items/Placeables/FurnitureAncient/AncientLantern.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientMonolith.cs b/Items/Placeables/FurnitureAncient/AncientMonolith.cs index afa334c193..992edc8224 100644 --- a/Items/Placeables/FurnitureAncient/AncientMonolith.cs +++ b/Items/Placeables/FurnitureAncient/AncientMonolith.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs index 8b31f31ee6..24651e8b78 100644 --- a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs +++ b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientSink.cs b/Items/Placeables/FurnitureAncient/AncientSink.cs index 5c80b977c8..11d515986b 100644 --- a/Items/Placeables/FurnitureAncient/AncientSink.cs +++ b/Items/Placeables/FurnitureAncient/AncientSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.LavaBucket). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientSofa.cs b/Items/Placeables/FurnitureAncient/AncientSofa.cs index 3b3465f326..2cef2b30a7 100644 --- a/Items/Placeables/FurnitureAncient/AncientSofa.cs +++ b/Items/Placeables/FurnitureAncient/AncientSofa.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientTable.cs b/Items/Placeables/FurnitureAncient/AncientTable.cs index 84a5e49443..d8ec7df3dc 100644 --- a/Items/Placeables/FurnitureAncient/AncientTable.cs +++ b/Items/Placeables/FurnitureAncient/AncientTable.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs index feec1ee3dd..88f5dab85d 100644 --- a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs +++ b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(). Register(); } } 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/FurnitureBotanic/BotanicBathtub.cs b/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs index 60c180e58a..5af97d2f14 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBed.cs b/Items/Placeables/FurnitureBotanic/BotanicBed.cs index 1acb0c3b02..6ca307fc30 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBed.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBench.cs b/Items/Placeables/FurnitureBotanic/BotanicBench.cs index 466cedef84..a4624d0dd3 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBench.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBench.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs b/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs index b648886bd6..90a4f6c43c 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs b/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs index 0e6140697e..cd646f304d 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicCandle.cs b/Items/Placeables/FurnitureBotanic/BotanicCandle.cs index 00abbcf2e1..b785331349 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicCandle.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicChair.cs b/Items/Placeables/FurnitureBotanic/BotanicChair.cs index b09dc4e440..d58cad346b 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChair.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChair.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs b/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs index 136936f5d5..3fbb85558b 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicChest.cs b/Items/Placeables/FurnitureBotanic/BotanicChest.cs index ea8c94157f..316f34fcc0 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChest.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicClock.cs b/Items/Placeables/FurnitureBotanic/BotanicClock.cs index 8687c3d0d0..b18deb8e2d 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicClock.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicDoor.cs b/Items/Placeables/FurnitureBotanic/BotanicDoor.cs index 2994122832..89e7e883c0 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicDoor.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicDoor.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicDresser.cs b/Items/Placeables/FurnitureBotanic/BotanicDresser.cs index bae1342b7f..f924debd78 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicDresser.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicDresser.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicLamp.cs b/Items/Placeables/FurnitureBotanic/BotanicLamp.cs index e1721c14f0..91a283b051 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicLamp.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicLantern.cs b/Items/Placeables/FurnitureBotanic/BotanicLantern.cs index 016f715296..81fe09456b 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicLantern.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicPiano.cs b/Items/Placeables/FurnitureBotanic/BotanicPiano.cs index bcb626d113..8f6496ee73 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicPiano.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs b/Items/Placeables/FurnitureBotanic/BotanicPlanter.cs similarity index 62% rename from Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs rename to Items/Placeables/FurnitureBotanic/BotanicPlanter.cs index bdaac5f684..c06b0e6e63 100644 --- a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicPlanter.cs @@ -1,28 +1,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicPlanter : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.JungleSpores, 5). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png b/Items/Placeables/FurnitureBotanic/BotanicPlanter.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png rename to Items/Placeables/FurnitureBotanic/BotanicPlanter.png diff --git a/Items/Placeables/FurnitureBotanic/BotanicSink.cs b/Items/Placeables/FurnitureBotanic/BotanicSink.cs index 7b2d93382e..f7780421f6 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicSink.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.HoneyBucket). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicTable.cs b/Items/Placeables/FurnitureBotanic/BotanicTable.cs index 72801307f6..a407f157fc 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicTable.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicTable.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs b/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs index 677b7876fc..6992bc754a 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } 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/FurnitureDriftwood/DriftwoodBaroqueCello.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.cs new file mode 100644 index 0000000000..2db737545a --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.FurnitureDriftwood; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBaroqueCello : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 4). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.png new file mode 100644 index 0000000000..d212716b57 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.cs new file mode 100644 index 0000000000..42217ec36b --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBathtub : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(14). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.png new file mode 100644 index 0000000000..73c7b19ed4 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBed.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.cs new file mode 100644 index 0000000000..7f41e9909e --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBed : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 4); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 5). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBed.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.png new file mode 100644 index 0000000000..39ef943058 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.cs new file mode 100644 index 0000000000..0ceb8e9e25 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBookcase : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(20). + AddIngredient(ItemID.Book, 10). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.png new file mode 100644 index 0000000000..8014290409 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.cs new file mode 100644 index 0000000000..c979a742d2 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodCandelabra : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 3); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Torch, 3). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.png b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.png new file mode 100644 index 0000000000..cf0798c369 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.cs new file mode 100644 index 0000000000..5d64ff15af --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodCandle : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.png b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.png new file mode 100644 index 0000000000..4bb35c5f2a Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChair.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.cs new file mode 100644 index 0000000000..324b392b8d --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodChair : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChair.png b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.png new file mode 100644 index 0000000000..ec6e9bd9ee Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.cs new file mode 100644 index 0000000000..67264739f7 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodChandelier : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch, 4). + AddIngredient(ItemID.Chain). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.png b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.png new file mode 100644 index 0000000000..59ca9bc75a Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChest.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.cs new file mode 100644 index 0000000000..09371eb58f --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodChest : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddRecipeGroup("IronBar", 2). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChest.png b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.png new file mode 100644 index 0000000000..1d0b01e9f3 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.cs new file mode 100644 index 0000000000..24a13ffa5d --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.FurnitureDriftwood; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodDoor : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 40); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.png b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.png new file mode 100644 index 0000000000..ed03fbc288 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.cs new file mode 100644 index 0000000000..c0e4945091 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodDresser : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(16). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.png b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.png new file mode 100644 index 0000000000..0e10813c48 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.cs new file mode 100644 index 0000000000..eb7ef97722 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodLamp : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Torch). + AddIngredient(3). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.png b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.png new file mode 100644 index 0000000000..fdcf21b3c4 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.cs new file mode 100644 index 0000000000..bc42935b65 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodLantern : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.png b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.png new file mode 100644 index 0000000000..952adc2cf2 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.cs new file mode 100644 index 0000000000..bebc858e99 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodPlatform : 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(2). + AddIngredient(). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.png b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.png new file mode 100644 index 0000000000..1bd785cc73 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSink.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.cs new file mode 100644 index 0000000000..4dd848f719 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodSink : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.WaterBucket). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSink.png b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.png new file mode 100644 index 0000000000..2ff5b161f6 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.cs new file mode 100644 index 0000000000..f15523527f --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodSofa : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Silk, 2). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.png b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.png new file mode 100644 index 0000000000..77730724c1 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.cs new file mode 100644 index 0000000000..5de21becdc --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodSundial : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddRecipeGroup("IronBar", 3). + AddIngredient(ItemID.Glass, 6). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.png b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.png new file mode 100644 index 0000000000..959cb779c9 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodTable.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.cs new file mode 100644 index 0000000000..49890c4505 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodTable : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodTable.png b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.png new file mode 100644 index 0000000000..a6db8a185b Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.cs new file mode 100644 index 0000000000..5b5863386e --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodToilet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.png b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.png new file mode 100644 index 0000000000..65321ca8fb Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.cs new file mode 100644 index 0000000000..d93e4a0817 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodWorkBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.png b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.png new file mode 100644 index 0000000000..e8125c908e Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.png differ diff --git a/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs b/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs index c74ae9cd78..ca19d16f17 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteBed.cs b/Items/Placeables/FurnitureMarnite/MarniteBed.cs index 75e39a9129..76bb5b7a42 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteBed.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Silk, 5). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs b/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs index d86b858582..3ba23a6beb 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Book, 10). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs b/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs index a7d2ebea32..2597db9c86 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch, 4). - AddTile(TileID.WorkBenches). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteClock.cs b/Items/Placeables/FurnitureMarnite/MarniteClock.cs index 2a65849521..d2e93221e6 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteClock.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteClock.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite AddIngredient(4). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteDresser.cs b/Items/Placeables/FurnitureMarnite/MarniteDresser.cs index 7eee4ef299..eab9197ea6 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteDresser.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteDresser.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs b/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs index d4e8f381f4..ad53340e47 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite AddIngredient(1). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteSofa.cs b/Items/Placeables/FurnitureMarnite/MarniteSofa.cs index f754aaf8a8..999add1972 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteSofa.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteSofa.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Silk, 2). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteToilet.cs b/Items/Placeables/FurnitureMarnite/MarniteToilet.cs index 9d91fac578..02d6a94e66 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteToilet.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteToilet.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(6). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs b/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs index 631e7ede23..fbe3a96370 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs b/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs index 156984f82d..385e5b8f69 100644 --- a/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs +++ b/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite public override void AddRecipes() { - CreateRecipe(). + CreateRecipe(4). AddIngredient(ItemID.Marble, 2). AddIngredient(ItemID.Granite, 2). AddRecipeGroup(RecipeSystem.AnyGoldOre, 1). 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/Furniture/CraftingStations/MonolithAmalgam.cs b/Items/Placeables/FurnitureMonolith/MonolithAmalgam.cs similarity index 63% rename from Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs rename to Items/Placeables/FurnitureMonolith/MonolithAmalgam.cs index 1f3116f9b6..daa3809586 100644 --- a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithAmalgam.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureMonolith { [LegacyName("MonolithCrafting")] public class MonolithAmalgam : ModItem, ILocalizedModType @@ -10,20 +10,15 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(20). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.png b/Items/Placeables/FurnitureMonolith/MonolithAmalgam.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.png rename to Items/Placeables/FurnitureMonolith/MonolithAmalgam.png diff --git a/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs b/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs index 180e480867..4b8b1ddb7a 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithBed.cs b/Items/Placeables/FurnitureMonolith/MonolithBed.cs index 1d333de777..11a5b1b15a 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBed.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBed.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithBench.cs b/Items/Placeables/FurnitureMonolith/MonolithBench.cs index 8498b4de74..a0c78194b3 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBench.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBench.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs b/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs index c2c7c915d8..3f1c9b7a85 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs b/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs index 70090c243b..873725f333 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithCandle.cs b/Items/Placeables/FurnitureMonolith/MonolithCandle.cs index f76318e634..3f829512f1 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithCandle.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithCandle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithChair.cs b/Items/Placeables/FurnitureMonolith/MonolithChair.cs index 25bd448184..d786a4ab6f 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChair.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChair.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs b/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs index e3a72a15c7..71dbcc7ccf 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithChest.cs b/Items/Placeables/FurnitureMonolith/MonolithChest.cs index 6192e86422..6b44623b5b 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChest.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChest.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithClock.cs b/Items/Placeables/FurnitureMonolith/MonolithClock.cs index 8878384da9..a45174c2c7 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithClock.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithClock.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithDoor.cs b/Items/Placeables/FurnitureMonolith/MonolithDoor.cs index 0f01131333..08cdd65ea1 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithDoor.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithDoor.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithDresser.cs b/Items/Placeables/FurnitureMonolith/MonolithDresser.cs index 1c1d788560..f77e09789d 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithDresser.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithDresser.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithLamp.cs b/Items/Placeables/FurnitureMonolith/MonolithLamp.cs index 2b9635cdad..d315b40511 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithLamp.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithLamp.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithLantern.cs b/Items/Placeables/FurnitureMonolith/MonolithLantern.cs index 63692653c1..5c0685f57f 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithLantern.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithLantern.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithPiano.cs b/Items/Placeables/FurnitureMonolith/MonolithPiano.cs index 2c6238a177..91af9b49fe 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithPiano.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithPiano.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithSink.cs b/Items/Placeables/FurnitureMonolith/MonolithSink.cs index 65f6164663..a6f2f4b910 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithSink.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithTable.cs b/Items/Placeables/FurnitureMonolith/MonolithTable.cs index af80d2f04d..8aa8eab032 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithTable.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithTable.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs b/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs index 7aab4573e8..a63ece403f 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(10). - AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs new file mode 100644 index 0000000000..f513a1a114 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBathtub")] + public class AncientNavystoneBathtub : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(14). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBathtub.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs new file mode 100644 index 0000000000..066f41bce1 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBed")] + public class AncientNavystoneBed : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 4); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 5). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBed.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBed.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs new file mode 100644 index 0000000000..1070db8bd9 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBench")] + public class AncientNavystoneBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBench.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBench.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs new file mode 100644 index 0000000000..6433472084 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBookcase")] + public class AncientNavystoneBookcase : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(20). + AddIngredient(ItemID.Book, 10). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBookcase.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs new file mode 100644 index 0000000000..186efab3fc --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandelabra")] + public class AncientNavystoneCandelabra : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 3); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Torch, 3). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs new file mode 100644 index 0000000000..a403118f45 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandle")] + public class AncientNavystoneCandle : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandle.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs new file mode 100644 index 0000000000..d560526fbf --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChair")] + public class AncientNavystoneChair : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChair.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicChair.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs new file mode 100644 index 0000000000..c68d8a9923 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs @@ -0,0 +1,29 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChandelier")] + public class AncientNavystoneChandelier : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch, 4). + AddIngredient(ItemID.Chain). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicChandelier.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs new file mode 100644 index 0000000000..b2dd187125 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChest")] + public class AncientNavystoneChest : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddRecipeGroup("IronBar", 2). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChest.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicChest.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs new file mode 100644 index 0000000000..a3877aca24 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs @@ -0,0 +1,29 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicClock")] + public class AncientNavystoneClock : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddRecipeGroup("IronBar", 3). + AddIngredient(ItemID.Glass, 6). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicClock.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicClock.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.cs new file mode 100644 index 0000000000..ed3d9c9052 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.cs @@ -0,0 +1,29 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureNavystone; +using CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDoor")] + public class AncientNavystoneDoor : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 40); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicDoor.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs new file mode 100644 index 0000000000..d24b1ec83c --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDresser")] + public class AncientNavystoneDresser : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(16). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicDresser.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs new file mode 100644 index 0000000000..32ffdfabe8 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLamp")] + public class AncientNavystoneLamp : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(3). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicLamp.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs new file mode 100644 index 0000000000..4a5de1d91b --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLantern")] + public class AncientNavystoneLantern : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicLantern.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs new file mode 100644 index 0000000000..baf2ee4181 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPiano")] + public class AncientNavystonePiano : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Bone, 4). + AddIngredient(ItemID.Book). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicPiano.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs new file mode 100644 index 0000000000..5508dbcad0 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPlatform")] + public class AncientNavystonePlatform : 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(2). + AddIngredient(). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicPlatform.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs new file mode 100644 index 0000000000..142c3deb30 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicSink")] + public class AncientNavystoneSink : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.WaterBucket). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicSink.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicSink.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs new file mode 100644 index 0000000000..0ec2790536 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicTable")] + public class AncientNavystoneTable : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicTable.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicTable.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs new file mode 100644 index 0000000000..622b46f7c0 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicWorkBench")] + public class AncientNavystoneWorkBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png diff --git a/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs similarity index 78% rename from Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs index 5fe203a28e..ef6ec61025 100644 --- a/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone { public class AncientSmoothNavystone : ModItem, ILocalizedModType { @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic 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/FurnitureEutrophic/AncientSmoothNavystone.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png diff --git a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs similarity index 66% rename from Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs index b403fe488c..bb40af0be1 100644 --- a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone { [LegacyName("EutrophicCrafting")] public class EutrophicShelf : ModItem, ILocalizedModType @@ -12,23 +12,18 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 50); // This is too easy to craft to sell for 2 gold } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(10). AddIngredient(5). AddIngredient(5). AddIngredient(3). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/EutrophicShelf.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicBench.cs rename to Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs index 20f4da4428..3bea3df35d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBench : ModItem, ILocalizedModType + public class NavystoneBathtub : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). - AddTile(). + AddIngredient(14). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneBathtub.png b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.png new file mode 100644 index 0000000000..d096c1edb4 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs b/Items/Placeables/FurnitureNavystone/NavystoneBed.cs similarity index 70% rename from Items/Placeables/FurnitureEutrophic/EutrophicBed.cs rename to Items/Placeables/FurnitureNavystone/NavystoneBed.cs index dd9074f28f..0331f11379 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneBed.cs @@ -3,23 +3,23 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBed : ModItem, ILocalizedModType + public class NavystoneBed : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 4); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneBed.png b/Items/Placeables/FurnitureNavystone/NavystoneBed.png new file mode 100644 index 0000000000..6336a84e7d Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneBed.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs rename to Items/Placeables/FurnitureNavystone/NavystoneBookcase.cs index 6ad2fb84a5..c15d2e9602 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.cs @@ -3,23 +3,23 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBookcase : ModItem, ILocalizedModType + public class NavystoneBookcase : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(20). + AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneBookcase.png b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.png new file mode 100644 index 0000000000..29cde351e8 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs rename to Items/Placeables/FurnitureNavystone/NavystoneCandelabra.cs index 8351687fae..0d7400ce54 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicCandelabra : ModItem, ILocalizedModType + public class NavystoneCandelabra : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 3); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.png b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.png new file mode 100644 index 0000000000..f238bbc491 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs b/Items/Placeables/FurnitureNavystone/NavystoneCandle.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs rename to Items/Placeables/FurnitureNavystone/NavystoneCandle.cs index e159fc7cfc..7dfdee5c2b 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneCandle.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicCandle : ModItem, ILocalizedModType + public class NavystoneCandle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneCandle.png b/Items/Placeables/FurnitureNavystone/NavystoneCandle.png new file mode 100644 index 0000000000..3bbac4d65c Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneCandle.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs b/Items/Placeables/FurnitureNavystone/NavystoneChair.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs rename to Items/Placeables/FurnitureNavystone/NavystoneChair.cs index 74c10dc6db..6ed1c890cb 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneChair.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicWorkBench : ModItem, ILocalizedModType + public class NavystoneChair : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 30); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). - AddTile(). + AddIngredient(4). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneChair.png b/Items/Placeables/FurnitureNavystone/NavystoneChair.png new file mode 100644 index 0000000000..bfb86147f9 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneChair.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.cs similarity index 71% rename from Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs rename to Items/Placeables/FurnitureNavystone/NavystoneChandelier.cs index ab029ab282..4c3527eea0 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.cs @@ -4,24 +4,24 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicChandelier : ModItem, ILocalizedModType + public class NavystoneChandelier : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneChandelier.png b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.png new file mode 100644 index 0000000000..e62c1e7c0e Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs b/Items/Placeables/FurnitureNavystone/NavystoneChest.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicChest.cs rename to Items/Placeables/FurnitureNavystone/NavystoneChest.cs index eb9f034571..5473c4adfd 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneChest.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicChest : ModItem, ILocalizedModType + public class NavystoneChest : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneChest.png b/Items/Placeables/FurnitureNavystone/NavystoneChest.png new file mode 100644 index 0000000000..3628fc230d Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneChest.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs b/Items/Placeables/FurnitureNavystone/NavystoneClock.cs similarity index 71% rename from Items/Placeables/FurnitureEutrophic/EutrophicClock.cs rename to Items/Placeables/FurnitureNavystone/NavystoneClock.cs index 30bc7622c0..b2e6d917db 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneClock.cs @@ -4,24 +4,24 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicClock : ModItem, ILocalizedModType + public class NavystoneClock : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneClock.png b/Items/Placeables/FurnitureNavystone/NavystoneClock.png new file mode 100644 index 0000000000..ccd6909fe6 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneClock.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs b/Items/Placeables/FurnitureNavystone/NavystoneDoor.cs similarity index 58% rename from Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs rename to Items/Placeables/FurnitureNavystone/NavystoneDoor.cs index 12b9a49e24..33bd862c0a 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneDoor.cs @@ -1,26 +1,26 @@ using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Tiles.Furniture.CraftingStations; -using CalamityMod.Tiles.FurnitureEutrophic; +using CalamityMod.Tiles.FurnitureNavystone; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicDoor : ModItem, ILocalizedModType + public class NavystoneDoor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 40); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). - AddTile(). + AddIngredient(6). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneDoor.png b/Items/Placeables/FurnitureNavystone/NavystoneDoor.png new file mode 100644 index 0000000000..3aeeedfb40 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneDoor.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs b/Items/Placeables/FurnitureNavystone/NavystoneDresser.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs rename to Items/Placeables/FurnitureNavystone/NavystoneDresser.cs index cc508f17c8..da81b3c8ef 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneDresser.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicDresser : ModItem, ILocalizedModType + public class NavystoneDresser : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(16). - AddTile(). + AddIngredient(16). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneDresser.png b/Items/Placeables/FurnitureNavystone/NavystoneDresser.png new file mode 100644 index 0000000000..24ed7def97 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneDresser.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs b/Items/Placeables/FurnitureNavystone/NavystoneLamp.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs rename to Items/Placeables/FurnitureNavystone/NavystoneLamp.cs index 7b366fb21a..0377f93cc4 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneLamp.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicLamp : ModItem, ILocalizedModType + public class NavystoneLamp : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(3). + AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneLamp.png b/Items/Placeables/FurnitureNavystone/NavystoneLamp.png new file mode 100644 index 0000000000..a058c3e769 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneLamp.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs b/Items/Placeables/FurnitureNavystone/NavystoneLantern.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs rename to Items/Placeables/FurnitureNavystone/NavystoneLantern.cs index 04a0ff5d2c..f7db6dde5d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneLantern.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicLantern : ModItem, ILocalizedModType + public class NavystoneLantern : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 30); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneLantern.png b/Items/Placeables/FurnitureNavystone/NavystoneLantern.png new file mode 100644 index 0000000000..a88ffc2099 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneLantern.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs b/Items/Placeables/FurnitureNavystone/NavystoneLyre.cs similarity index 71% rename from Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs rename to Items/Placeables/FurnitureNavystone/NavystoneLyre.cs index 40ef588135..fcc0a58f28 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneLyre.cs @@ -3,24 +3,24 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicPiano : ModItem, ILocalizedModType + public class NavystoneLyre : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneLyre.png b/Items/Placeables/FurnitureNavystone/NavystoneLyre.png new file mode 100644 index 0000000000..1dc721d732 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneLyre.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs b/Items/Placeables/FurnitureNavystone/NavystonePlatform.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs rename to Items/Placeables/FurnitureNavystone/NavystonePlatform.cs index f1ccad62a8..c603d7bbd0 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Items/Placeables/FurnitureNavystone/NavystonePlatform.cs @@ -3,9 +3,9 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicPlatform : ModItem, ILocalizedModType + public class NavystonePlatform : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetStaticDefaults() @@ -13,12 +13,12 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic Item.ResearchUnlockCount = 200; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { CreateRecipe(2). - AddIngredient(). + AddIngredient(). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystonePlatform.png b/Items/Placeables/FurnitureNavystone/NavystonePlatform.png new file mode 100644 index 0000000000..926737cb55 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystonePlatform.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs b/Items/Placeables/FurnitureNavystone/NavystoneSink.cs similarity index 70% rename from Items/Placeables/FurnitureEutrophic/EutrophicSink.cs rename to Items/Placeables/FurnitureNavystone/NavystoneSink.cs index 9eab014730..eea8e0073d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneSink.cs @@ -3,23 +3,23 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicSink : ModItem, ILocalizedModType + public class NavystoneSink : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneSink.png b/Items/Placeables/FurnitureNavystone/NavystoneSink.png new file mode 100644 index 0000000000..dc2dbdd522 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneSink.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs b/Items/Placeables/FurnitureNavystone/NavystoneTable.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicTable.cs rename to Items/Placeables/FurnitureNavystone/NavystoneTable.cs index e615b230a4..009034c1dd 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneTable.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicTable : ModItem, ILocalizedModType + public class NavystoneTable : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). - AddTile(). + AddIngredient(8). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneTable.png b/Items/Placeables/FurnitureNavystone/NavystoneTable.png new file mode 100644 index 0000000000..4dd36e89c9 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneTable.png differ diff --git a/Items/Placeables/FurnitureNavystone/NavystoneToilet.cs b/Items/Placeables/FurnitureNavystone/NavystoneToilet.cs new file mode 100644 index 0000000000..2a06c94973 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/NavystoneToilet.cs @@ -0,0 +1,26 @@ +using CalamityMod.Tiles.FurnitureNavystone; +using CalamityMod.Tiles.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone +{ + public class NavystoneToilet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureNavystone/NavystoneToilet.png b/Items/Placeables/FurnitureNavystone/NavystoneToilet.png new file mode 100644 index 0000000000..1ab7abf58e Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneToilet.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.cs similarity index 67% rename from Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs rename to Items/Placeables/FurnitureNavystone/NavystoneTriclinium.cs index 657e022d09..ce3b0b199f 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBathtub : ModItem, ILocalizedModType + public class NavystoneTriclinium : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(14). - AddTile(). + AddIngredient(8). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.png b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.png new file mode 100644 index 0000000000..b760662708 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicChair.cs rename to Items/Placeables/FurnitureNavystone/NavystoneWorkBench.cs index 6d0b102069..4979e521b3 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.cs @@ -4,22 +4,21 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicChair : ModItem, ILocalizedModType + public class NavystoneWorkBench : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 30); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). - AddTile(). + AddIngredient(10). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.png b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.png new file mode 100644 index 0000000000..6e12e7b36a Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.png differ 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/FurnitureEutrophic/SmoothNavystone.cs b/Items/Placeables/FurnitureNavystone/SmoothNavystone.cs similarity index 82% rename from Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs rename to Items/Placeables/FurnitureNavystone/SmoothNavystone.cs index 19a4f66101..737345d1a8 100644 --- a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs +++ b/Items/Placeables/FurnitureNavystone/SmoothNavystone.cs @@ -1,9 +1,10 @@ using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { public class SmoothNavystone : ModItem, ILocalizedModType { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - 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/FurnitureEutrophic/SmoothNavystone.png b/Items/Placeables/FurnitureNavystone/SmoothNavystone.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/SmoothNavystone.png rename to Items/Placeables/FurnitureNavystone/SmoothNavystone.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/Furniture/CraftingStations/EffulgentManipulator.cs b/Items/Placeables/FurnitureSilva/SilvaBasin.cs similarity index 56% rename from Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs rename to Items/Placeables/FurnitureSilva/SilvaBasin.cs index 38cd253bdc..73033cc0da 100644 --- a/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBasin.cs @@ -3,29 +3,24 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureSilva { - [LegacyName("SilvaBasin")] - public class EffulgentManipulator : ModItem, ILocalizedModType + [LegacyName("EffulgentManipulator")] + public class SilvaBasin : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(10). AddRecipeGroup("AnyGoldBar", 5). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.png b/Items/Placeables/FurnitureSilva/SilvaBasin.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.png rename to Items/Placeables/FurnitureSilva/SilvaBasin.png diff --git a/Items/Placeables/FurnitureSilva/SilvaBathtub.cs b/Items/Placeables/FurnitureSilva/SilvaBathtub.cs index 1334cde423..6491d8e879 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBathtub.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBathtub.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaBed.cs b/Items/Placeables/FurnitureSilva/SilvaBed.cs index 3d0c73f109..00230ac8b1 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBed.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaBench.cs b/Items/Placeables/FurnitureSilva/SilvaBench.cs index 333fed0272..afff559458 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBench.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBench.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaBookcase.cs b/Items/Placeables/FurnitureSilva/SilvaBookcase.cs index f036b18c6e..c240d76956 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBookcase.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs b/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs index 92ae20f92e..9305522a77 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaCandle.cs b/Items/Placeables/FurnitureSilva/SilvaCandle.cs index b5bedb72c0..ea0f420147 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCandle.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaChair.cs b/Items/Placeables/FurnitureSilva/SilvaChair.cs index 276ece5d5b..0199580bd9 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChair.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChair.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs index a10990fdd0..68578c6cd4 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaChest.cs b/Items/Placeables/FurnitureSilva/SilvaChest.cs index dc123f5db8..ad89ca7ca9 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChest.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChest.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaClock.cs b/Items/Placeables/FurnitureSilva/SilvaClock.cs index f4afb5cf0e..009882961a 100644 --- a/Items/Placeables/FurnitureSilva/SilvaClock.cs +++ b/Items/Placeables/FurnitureSilva/SilvaClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaDoor.cs b/Items/Placeables/FurnitureSilva/SilvaDoor.cs index 703348131f..7239023ff4 100644 --- a/Items/Placeables/FurnitureSilva/SilvaDoor.cs +++ b/Items/Placeables/FurnitureSilva/SilvaDoor.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaDresser.cs b/Items/Placeables/FurnitureSilva/SilvaDresser.cs index 7f149b01f1..e23238bb9e 100644 --- a/Items/Placeables/FurnitureSilva/SilvaDresser.cs +++ b/Items/Placeables/FurnitureSilva/SilvaDresser.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaLamp.cs b/Items/Placeables/FurnitureSilva/SilvaLamp.cs index 336d5e4d8e..1c344ab103 100644 --- a/Items/Placeables/FurnitureSilva/SilvaLamp.cs +++ b/Items/Placeables/FurnitureSilva/SilvaLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaLantern.cs b/Items/Placeables/FurnitureSilva/SilvaLantern.cs index bcd188b58c..a2f716f2e9 100644 --- a/Items/Placeables/FurnitureSilva/SilvaLantern.cs +++ b/Items/Placeables/FurnitureSilva/SilvaLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaPiano.cs b/Items/Placeables/FurnitureSilva/SilvaPiano.cs index 619ac5cdc8..19c0df3650 100644 --- a/Items/Placeables/FurnitureSilva/SilvaPiano.cs +++ b/Items/Placeables/FurnitureSilva/SilvaPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaSink.cs b/Items/Placeables/FurnitureSilva/SilvaSink.cs index 56e6f60507..dd76733ba0 100644 --- a/Items/Placeables/FurnitureSilva/SilvaSink.cs +++ b/Items/Placeables/FurnitureSilva/SilvaSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaTable.cs b/Items/Placeables/FurnitureSilva/SilvaTable.cs index 8b0175b74c..16cdb6305c 100644 --- a/Items/Placeables/FurnitureSilva/SilvaTable.cs +++ b/Items/Placeables/FurnitureSilva/SilvaTable.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs b/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs index 4311048e5d..c9494cc42b 100644 --- a/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs +++ b/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs b/Items/Placeables/FurnitureStatigel/StaticRefiner.cs similarity index 54% rename from Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs rename to Items/Placeables/FurnitureStatigel/StaticRefiner.cs index 105adef50b..cd4fdb2820 100644 --- a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs +++ b/Items/Placeables/FurnitureStatigel/StaticRefiner.cs @@ -2,28 +2,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureStatigel { public class StaticRefiner : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.Solidifier). - AddIngredient(5). - AddTile(TileID.Anvils). + AddIngredient(10). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.png b/Items/Placeables/FurnitureStatigel/StaticRefiner.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/StaticRefiner.png rename to Items/Placeables/FurnitureStatigel/StaticRefiner.png diff --git a/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs b/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs index 3f7fc58b21..dd9ee9988c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBed.cs b/Items/Placeables/FurnitureStatigel/StatigelBed.cs index cafa39bbcf..694148e826 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBed.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBlock.cs b/Items/Placeables/FurnitureStatigel/StatigelBlock.cs index d28fcccc64..db4e3aa915 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBlock.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBlock.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(25). AddIngredient(). - AddTile(). + AddTile(TileID.Solidifier). Register(); CreateRecipe(). AddIngredient(2). diff --git a/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs b/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs index 148c98fbc4..35aaf72798 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs b/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs index 4cab592c8a..69323827ba 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelCandle.cs b/Items/Placeables/FurnitureStatigel/StatigelCandle.cs index 2b615e086a..01c803ce2b 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelCandle.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChair.cs b/Items/Placeables/FurnitureStatigel/StatigelChair.cs index 5a67a9131a..5ac443729f 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChair.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChair.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs b/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs index 08014dcb98..65bebcb6af 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChest.cs b/Items/Placeables/FurnitureStatigel/StatigelChest.cs index 751521bc2a..14f8706915 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChest.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelClock.cs b/Items/Placeables/FurnitureStatigel/StatigelClock.cs index a3ad4e7f12..ae974e9446 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelClock.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelDoor.cs b/Items/Placeables/FurnitureStatigel/StatigelDoor.cs index 583efa5451..6de286fc7d 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelDoor.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelDoor.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelDresser.cs b/Items/Placeables/FurnitureStatigel/StatigelDresser.cs index 59b759b84c..0084913f3c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelDresser.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelDresser.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelLamp.cs b/Items/Placeables/FurnitureStatigel/StatigelLamp.cs index 01f6b7453c..ac7a37385d 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelLamp.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelLantern.cs b/Items/Placeables/FurnitureStatigel/StatigelLantern.cs index 8eea59ba86..572a4959fb 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelLantern.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelPiano.cs b/Items/Placeables/FurnitureStatigel/StatigelPiano.cs index 05b1cd26fd..3d3eee379c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelPiano.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelSink.cs b/Items/Placeables/FurnitureStatigel/StatigelSink.cs index 4f62ce1aca..bdb43753e5 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelSink.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelSofa.cs b/Items/Placeables/FurnitureStatigel/StatigelSofa.cs index 15e53c4ebc..3ba339302c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelSofa.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelTable.cs b/Items/Placeables/FurnitureStatigel/StatigelTable.cs index db940dd1d7..2f7980c52d 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelTable.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelTable.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs b/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs index e284ee43ed..0f45927793 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBathtub.cs b/Items/Placeables/FurnitureStratus/StratusBathtub.cs index ff810e5010..db3b5797b5 100644 --- a/Items/Placeables/FurnitureStratus/StratusBathtub.cs +++ b/Items/Placeables/FurnitureStratus/StratusBathtub.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(14). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBed.cs b/Items/Placeables/FurnitureStratus/StratusBed.cs index 65c93798ec..3a23cd3b1e 100644 --- a/Items/Placeables/FurnitureStratus/StratusBed.cs +++ b/Items/Placeables/FurnitureStratus/StratusBed.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBookcase.cs b/Items/Placeables/FurnitureStratus/StratusBookcase.cs index ac1226a1f8..63064b76b9 100644 --- a/Items/Placeables/FurnitureStratus/StratusBookcase.cs +++ b/Items/Placeables/FurnitureStratus/StratusBookcase.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBricks.cs b/Items/Placeables/FurnitureStratus/StratusBricks.cs index 36f87a04c9..64080d7e9c 100644 --- a/Items/Placeables/FurnitureStratus/StratusBricks.cs +++ b/Items/Placeables/FurnitureStratus/StratusBricks.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(3). AddIngredient(). AddIngredient(). - AddTile(TileID.AdamantiteForge). + AddTile(). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs index 63228f55f2..29b342236a 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusCandle.cs b/Items/Placeables/FurnitureStratus/StratusCandle.cs index f8dd4f71ea..6a60ac11de 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandle.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandle.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChair.cs b/Items/Placeables/FurnitureStratus/StratusChair.cs index 8a6ff76d53..bc41ac8a37 100644 --- a/Items/Placeables/FurnitureStratus/StratusChair.cs +++ b/Items/Placeables/FurnitureStratus/StratusChair.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChandelier.cs b/Items/Placeables/FurnitureStratus/StratusChandelier.cs index 5f21142e57..bd8fb08464 100644 --- a/Items/Placeables/FurnitureStratus/StratusChandelier.cs +++ b/Items/Placeables/FurnitureStratus/StratusChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(TileID.Anvils). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChest.cs b/Items/Placeables/FurnitureStratus/StratusChest.cs index 753df53dec..aa4f89e08c 100644 --- a/Items/Placeables/FurnitureStratus/StratusChest.cs +++ b/Items/Placeables/FurnitureStratus/StratusChest.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusClock.cs b/Items/Placeables/FurnitureStratus/StratusClock.cs index 01b94235d7..c36dd0c39c 100644 --- a/Items/Placeables/FurnitureStratus/StratusClock.cs +++ b/Items/Placeables/FurnitureStratus/StratusClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDoor.cs b/Items/Placeables/FurnitureStratus/StratusDoor.cs index 9182e72e40..c7b39082f0 100644 --- a/Items/Placeables/FurnitureStratus/StratusDoor.cs +++ b/Items/Placeables/FurnitureStratus/StratusDoor.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(6). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDresser.cs b/Items/Placeables/FurnitureStratus/StratusDresser.cs index 12e18ed01a..a05a61a315 100644 --- a/Items/Placeables/FurnitureStratus/StratusDresser.cs +++ b/Items/Placeables/FurnitureStratus/StratusDresser.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(16). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLamp.cs b/Items/Placeables/FurnitureStratus/StratusLamp.cs index 3d1e1f2488..2b778c19b0 100644 --- a/Items/Placeables/FurnitureStratus/StratusLamp.cs +++ b/Items/Placeables/FurnitureStratus/StratusLamp.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLantern.cs b/Items/Placeables/FurnitureStratus/StratusLantern.cs index 050ea27365..0943f5f6ee 100644 --- a/Items/Placeables/FurnitureStratus/StratusLantern.cs +++ b/Items/Placeables/FurnitureStratus/StratusLantern.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusPiano.cs b/Items/Placeables/FurnitureStratus/StratusPiano.cs index 8d305c2cc2..2985284bac 100644 --- a/Items/Placeables/FurnitureStratus/StratusPiano.cs +++ b/Items/Placeables/FurnitureStratus/StratusPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSink.cs b/Items/Placeables/FurnitureStratus/StratusSink.cs index 82c625509b..b1f842dd38 100644 --- a/Items/Placeables/FurnitureStratus/StratusSink.cs +++ b/Items/Placeables/FurnitureStratus/StratusSink.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSofa.cs b/Items/Placeables/FurnitureStratus/StratusSofa.cs index 705a35948b..703293629e 100644 --- a/Items/Placeables/FurnitureStratus/StratusSofa.cs +++ b/Items/Placeables/FurnitureStratus/StratusSofa.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusTable.cs b/Items/Placeables/FurnitureStratus/StratusTable.cs index 3e21e4e5b8..de3a38bc05 100644 --- a/Items/Placeables/FurnitureStratus/StratusTable.cs +++ b/Items/Placeables/FurnitureStratus/StratusTable.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(8). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusWorkBench.cs b/Items/Placeables/FurnitureStratus/StratusWorkBench.cs index 69f1b33b25..9d2cc08edc 100644 --- a/Items/Placeables/FurnitureStratus/StratusWorkBench.cs +++ b/Items/Placeables/FurnitureStratus/StratusWorkBench.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(10). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs b/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs index cfa4f34b81..3a7b5af97b 100644 --- a/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs +++ b/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(). AddIngredient(). AddIngredient(). - AddTile(TileID.Anvils). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs new file mode 100644 index 0000000000..0dbb5c4e03 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBathtub : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(14). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png new file mode 100644 index 0000000000..c8ab44889a Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs new file mode 100644 index 0000000000..024e48867a --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBookcase : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(20). + AddIngredient(ItemID.Book, 10). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png new file mode 100644 index 0000000000..57cf58bd96 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs new file mode 100644 index 0000000000..f2c71f63e8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChair : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png new file mode 100644 index 0000000000..649e6f9e82 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs new file mode 100644 index 0000000000..394de25e31 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChandelier : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch, 4). + AddIngredient(ItemID.Chain). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png new file mode 100644 index 0000000000..94b71006d0 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs new file mode 100644 index 0000000000..1372897fd8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChest : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddRecipeGroup("IronBar", 2). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png new file mode 100644 index 0000000000..44df951fe5 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png new file mode 100644 index 0000000000..7cb80254aa Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs new file mode 100644 index 0000000000..a0558ff07b --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDeskLight : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png new file mode 100644 index 0000000000..fad6a339c0 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.cs new file mode 100644 index 0000000000..1c491693b5 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDoor : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 40); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.png new file mode 100644 index 0000000000..dd4f7de09c Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs new file mode 100644 index 0000000000..ae67c2dac8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDresser : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(16). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png new file mode 100644 index 0000000000..b0f8cc58c4 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs new file mode 100644 index 0000000000..b27d2c8cbb --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumJukebox : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png new file mode 100644 index 0000000000..672db05d5a Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs new file mode 100644 index 0000000000..64738b8544 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLamp : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Torch). + AddIngredient(3). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png new file mode 100644 index 0000000000..a19882f1b3 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs new file mode 100644 index 0000000000..46fbde76df --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLantern : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.Torch). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png new file mode 100644 index 0000000000..8e530f9b95 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs new file mode 100644 index 0000000000..128827dbab --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSink : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.WaterBucket). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png new file mode 100644 index 0000000000..c96f440a2b Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs new file mode 100644 index 0000000000..66403bdb55 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSleepingPod : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 4); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 5). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png new file mode 100644 index 0000000000..b438294241 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs new file mode 100644 index 0000000000..79eb99b99c --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSofa : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Silk, 2). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png new file mode 100644 index 0000000000..c848b79b7c Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs new file mode 100644 index 0000000000..c00b901567 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs @@ -0,0 +1,25 @@ + +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumTable : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png new file mode 100644 index 0000000000..b24d120326 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs new file mode 100644 index 0000000000..9ced6a0dd8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs @@ -0,0 +1,26 @@ + +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumToilet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png new file mode 100644 index 0000000000..5483bcf85a Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs new file mode 100644 index 0000000000..c4ba7c3a04 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumWorkBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png new file mode 100644 index 0000000000..b066974f66 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png differ diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs b/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs index 45519cd146..009f33382c 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs b/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs index dba6f46033..44f940e7b5 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs b/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs index 183ac5df10..a0c1dd023f 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs b/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs index 6f0a7e44f5..ab250a0424 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs b/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs index be884f8399..dd749adeb3 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs b/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs index 87ee331186..5a39d707eb 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs b/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs index d023bcca90..7c8a34cdd1 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs b/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs index 16228bfe97..7bbd7662a1 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(10). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs b/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs index fd29ef50dc..d5c9fcfce0 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs b/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs index e18969357f..cb2d32e226 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.cs b/Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.cs similarity index 64% rename from Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.cs rename to Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.cs index 5f1ebc1011..8a3fc90abe 100644 --- a/Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.cs @@ -2,27 +2,21 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureWulfrum { public class WulfrumLabstationItem : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); // This is REALLY too easy to craft to sell for 2 gold } - - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(20). - AddTile(TileID.Anvils). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.png b/Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.png rename to Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.png diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs b/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs index b271efdb91..2a4d4f41ad 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs b/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs index 72ebb8ebc3..ee4af86b88 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs b/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs index 1000898784..4130a6902f 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs b/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs index 5cff22aca0..8209196161 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs b/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs index bc87369619..bf4c0e14fe 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs b/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs index 9f4ca75337..125629aa6b 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs b/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs index bb8189d1d8..9aa0a43fec 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs b/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs index 50db216abe..1148e3da9e 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(). AddIngredient(). AddIngredient(). - AddTile(TileID.Anvils). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs b/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs index a4b4e96e4a..4a914037c9 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } 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/SunkenSea/Navystone.cs b/Items/Placeables/SunkenSea/Navystone.cs index 247e14cc42..c38fb7d2e3 100644 --- a/Items/Placeables/SunkenSea/Navystone.cs +++ b/Items/Placeables/SunkenSea/Navystone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea Register(); CreateRecipe(). - AddIngredient(2). + AddIngredient(2). DisableDecraft(). Register(); } 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/AncientSmoothNavystoneWall .cs b/Items/Placeables/Walls/AncientSmoothNavystoneWall .cs new file mode 100644 index 0000000000..1e314cc02e --- /dev/null +++ b/Items/Placeables/Walls/AncientSmoothNavystoneWall .cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone; +using Terraria.ID; +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; +namespace CalamityMod.Items.Placeables.Walls +{ + public class AncientSmoothNavystoneWall : 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/AncientSmoothNavystoneWall.png b/Items/Placeables/Walls/AncientSmoothNavystoneWall.png new file mode 100644 index 0000000000..d867a30eb6 Binary files /dev/null and b/Items/Placeables/Walls/AncientSmoothNavystoneWall.png differ 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/Placeables/Walls/SmoothNavystoneWall.cs b/Items/Placeables/Walls/SmoothNavystoneWall.cs index a2104c8b5c..11667b7dc1 100644 --- a/Items/Placeables/Walls/SmoothNavystoneWall.cs +++ b/Items/Placeables/Walls/SmoothNavystoneWall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/SmoothNavystoneWall.png b/Items/Placeables/Walls/SmoothNavystoneWall.png index d867a30eb6..d58aa5330c 100644 Binary files a/Items/Placeables/Walls/SmoothNavystoneWall.png and b/Items/Placeables/Walls/SmoothNavystoneWall.png differ diff --git a/Items/Potions/Alcohol/OddMushroom.cs b/Items/Potions/Alcohol/OddMushroom.cs index 494d19a656..0c8166cea2 100644 --- a/Items/Potions/Alcohol/OddMushroom.cs +++ b/Items/Potions/Alcohol/OddMushroom.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions.Alcohol { Item.DefaultToFood(38, 50, ModContent.BuffType(), CalamityUtils.MinutesToFrames(60)); - Item.value = Item.sellPrice(gold: 10); + Item.value = Item.buyPrice(gold: 5); // Sold by Truffle Item.rare = ItemRarityID.LightRed; } diff --git a/Items/SummonItems/BloodyWormFood.cs b/Items/SummonItems/BloodyWormFood.cs index 590d5c5b4b..b5dd639393 100644 --- a/Items/SummonItems/BloodyWormFood.cs +++ b/Items/SummonItems/BloodyWormFood.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.SummonItems { CreateRecipe() .AddIngredient(ItemID.CrimtaneBar, 3) - .AddIngredient(7) + .AddIngredient(7) .AddIngredient(ItemID.Vertebrae, 13) .AddTile(TileID.DemonAltar) .AddDecraftCondition(CalamityConditions.DownedPerforator) 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/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index fabb86b0a4..9e09b791ae 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.SummonItems { CreateRecipe(). AddIngredient(ItemID.DemoniteBar, 3). - AddIngredient(7). + AddIngredient(7). AddIngredient(ItemID.RottenChunk, 13). AddTile(TileID.DemonAltar). AddDecraftCondition(CalamityConditions.DownedHiveMind). 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/Gelpick.cs b/Items/Tools/Gelpick.cs index 6b7fe5b12e..4146b16c6d 100644 --- a/Items/Tools/Gelpick.cs +++ b/Items/Tools/Gelpick.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Tools CreateRecipe(). AddIngredient(12). AddIngredient(12). - AddTile(). + AddTile(TileID.Solidifier). Register(); } 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/HiveMindBag.cs b/Items/TreasureBags/HiveMindBag.cs index 22c3df8060..bff6d42bfc 100644 --- a/Items/TreasureBags/HiveMindBag.cs +++ b/Items/TreasureBags/HiveMindBag.cs @@ -60,7 +60,6 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); // Materials - itemLoot.Add(ModContent.ItemType(), 1, 30, 40); itemLoot.Add(ItemID.DemoniteBar, 1, 15, 20); itemLoot.Add(ItemID.RottenChunk, 1, 15, 20); itemLoot.AddIf(() => Main.hardMode, ItemID.CursedFlame, 1, 25, 30); 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/PerforatorBag.cs b/Items/TreasureBags/PerforatorBag.cs index cec78d95d9..d1a2b58520 100644 --- a/Items/TreasureBags/PerforatorBag.cs +++ b/Items/TreasureBags/PerforatorBag.cs @@ -60,7 +60,6 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); // Materials - itemLoot.Add(ModContent.ItemType(), 1, 30, 40); itemLoot.Add(ItemID.CrimtaneBar, 1, 15, 20); itemLoot.Add(ItemID.Vertebrae, 1, 15, 20); itemLoot.AddIf(() => Main.hardMode, ItemID.Ichor, 1, 25, 30); 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/AdamantiteArmorSetChange.cs b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs index 97b89059ef..43c6867f92 100644 --- a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Adamantite"; public const int MaxManaBoost = 20; - public const int DefenseBoostMax = 15; + public const int DefenseBoostMax = 10; public const int TimeUntilDecayBeginsAfterAttacking = 60; public const int TimeUntilBoostCompletelyDecays = 210; diff --git a/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs b/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs deleted file mode 100644 index f284793d44..0000000000 --- a/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Terraria.ID; - -namespace CalamityMod.Items.VanillaArmorChanges -{ - public class ChlorophyteArmorSetChange : VanillaArmorChange - { - public override int? HeadPieceID => ItemID.ChlorophyteHeadgear; - - public override int? BodyPieceID => ItemID.ChlorophytePlateMail; - - public override int? LegPieceID => ItemID.ChlorophyteGreaves; - - public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.ChlorophyteMask, ItemID.ChlorophyteHelmet }; - - public override string ArmorSetName => "Chlorophyte"; - - public const int AmountToHealPerPulse = 5; - - public const int PulseReleaseRate = 300; - - public const int DelayBetweenHeals = 270; - - public const int BaseDamageToEnemies = 220; - - public override void UpdateSetBonusText(ref string setBonusText) - { - setBonusText = $"{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(PulseReleaseRate / 60f, BaseDamageToEnemies, AmountToHealPerPulse, DelayBetweenHeals / 60f)}"; - } - } -} diff --git a/Items/VanillaArmorChanges/CopperArmorSetChange.cs b/Items/VanillaArmorChanges/CopperArmorSetChange.cs index fbf35b1549..6f4d3ea46a 100644 --- a/Items/VanillaArmorChanges/CopperArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CopperArmorSetChange.cs @@ -1,5 +1,4 @@ -using System.Text; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,20 +14,11 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Copper"; - public const float HeadDamage = 0.05f; - public const float ChestCrit = 3f; - public const float LegsMoveSpeed = 0.05f; public const float SetBonusFlatDamage = 2.0f; - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.GetCritChance() += ChestCrit; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; - public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusFlatDamage.ToString("N0"))}"; } public override void ApplyArmorSetBonus(Player player) 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/VanillaArmorChanges/GladiatorArmorSetChange.cs b/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs index d1ebc8a41b..93c2886fbf 100644 --- a/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs +++ b/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Items.VanillaArmorChanges player.Calamity().wearingRogueArmor = true; player.GetDamage() += 0.05f; player.Calamity().rogueVelocity += 0.1f; - player.statDefense += 3; } } } diff --git a/Items/VanillaArmorChanges/GoldArmorSetChange.cs b/Items/VanillaArmorChanges/GoldArmorSetChange.cs index fbb7771b69..9b34eb9fc9 100644 --- a/Items/VanillaArmorChanges/GoldArmorSetChange.cs +++ b/Items/VanillaArmorChanges/GoldArmorSetChange.cs @@ -17,23 +17,14 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Gold"; - public const float HeadDamage = 0.05f; - public const float ChestDR = 0.05f; - public const float LegsMoveSpeed = 0.1f; public const float GoldDropChanceFromEnemies = 0.02f; public const int GoldFromBosses = 3; - public const float SetBonusCritPerGoldCoin = 0.1f; // 10 gold coins = +1% crit chance - public const float MaximumCritBonus = 7f; - - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.endurance += ChestDR; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float SetBonusCritPerGoldCoin = 0.2f; // 5 gold coins = +1% crit chance + public const float MaximumCritBonus = 5f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(GoldDropChanceFromEnemies.ToPercent(), GoldFromBosses, SetBonusCritPerGoldCoin, MaximumCritBonus)}"; } public override void ApplyArmorSetBonus(Player player) diff --git a/Items/VanillaArmorChanges/IronArmorSetChange.cs b/Items/VanillaArmorChanges/IronArmorSetChange.cs index ea739abcf5..3906498ffb 100644 --- a/Items/VanillaArmorChanges/IronArmorSetChange.cs +++ b/Items/VanillaArmorChanges/IronArmorSetChange.cs @@ -1,6 +1,6 @@ -using System.Text; -using Terraria; +using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { @@ -16,25 +16,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Iron"; - public const float ArmorPieceDR = 0.03f; - public const float SetBonusDR = 0.06f; - public const int SetBonusLifeRegen = 2; - - public override void ApplyHeadPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyBodyPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyLegPieceEffect(Player player) => player.endurance += ArmorPieceDR; + public const float KnockbackMultiplier = 1.5f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(KnockbackMultiplier)}"; } public override void ApplyArmorSetBonus(Player player) { - player.endurance += SetBonusDR; - player.lifeRegen += SetBonusLifeRegen; + player.GetKnockback() *= KnockbackMultiplier; } } } diff --git a/Items/VanillaArmorChanges/LeadArmorSetChange.cs b/Items/VanillaArmorChanges/LeadArmorSetChange.cs index 4fc7541f41..07dfe7c7e6 100644 --- a/Items/VanillaArmorChanges/LeadArmorSetChange.cs +++ b/Items/VanillaArmorChanges/LeadArmorSetChange.cs @@ -13,16 +13,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Lead"; - public const float ArmorPieceDR = 0.02f; - public const float SetBonusDR = 0.04f; - public const int SetBonusLifeRegen = 1; - - public override void ApplyHeadPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyBodyPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyLegPieceEffect(Player player) => player.endurance += ArmorPieceDR; - public override void UpdateSetBonusText(ref string setBonusText) { setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; @@ -30,8 +20,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyArmorSetBonus(Player player) { - player.endurance += SetBonusDR; - player.lifeRegen += SetBonusLifeRegen; player.noKnockback = true; } } diff --git a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs index 18fee450a0..ace816e610 100644 --- a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs @@ -1,7 +1,5 @@ -using System; -using Terraria; +using Terraria; using Terraria.ID; -using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { @@ -15,34 +13,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Platinum"; - public const float HeadDamage = 0.06f; - public const float ChestCrit = 3f; - public const float LegsMoveSpeed = 0.1f; - public const float SetBonusDamagePerDefense = 0.1f; // 10 defense = +1% damage, this gets divided by 100 - public const int SetBonusDefenseCap = 50; - - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.GetCritChance() += ChestCrit; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float SetBonusDR = 0.1f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusDR.ToPercent())}"; } public override void ApplyArmorSetBonus(Player player) { - // 07MAY2024: Ozzatron: Platinum armor doesn't count its own defense for its set bonus - // CIT 1MAR2025: Platinum armor should not count its set bonus defense here, because it hasn't been applied yet - int defenseBesidesThisArmor = player.statDefense - (5 + 6 + 5); - if (defenseBesidesThisArmor <= 0) - return; - - if (defenseBesidesThisArmor > SetBonusDefenseCap) - defenseBesidesThisArmor = SetBonusDefenseCap; - player.GetDamage() += (float)Math.Floor(defenseBesidesThisArmor * SetBonusDamagePerDefense) * 0.01f; + player.endurance += SetBonusDR; } } } diff --git a/Items/VanillaArmorChanges/SilverArmorSetChange.cs b/Items/VanillaArmorChanges/SilverArmorSetChange.cs index 9c9bc580e9..05372ca492 100644 --- a/Items/VanillaArmorChanges/SilverArmorSetChange.cs +++ b/Items/VanillaArmorChanges/SilverArmorSetChange.cs @@ -16,29 +16,17 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Silver"; - public const float HeadCrit = 5f; - public const int ChestLifeRegen = 2; - public const float LegsMoveSpeed = 0.08f; - public const int SetBonusLifeRegen = 1; - public const double SetBonusMinimumDamageToHeal = 20.0; public const int SetBonusHealTime = 120; public const int SetBonusHealAmount = 10; - public override void ApplyHeadPieceEffect(Player player) => player.GetCritChance() += HeadCrit; - - public override void ApplyBodyPieceEffect(Player player) => player.lifeRegen += ChestLifeRegen; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; - public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusHealTime.FramesToSeconds(), SetBonusMinimumDamageToHeal.ToString("N0"), SetBonusHealAmount)}"; } public override void ApplyArmorSetBonus(Player player) { - player.lifeRegen += SetBonusLifeRegen; player.Calamity().silverMedkit = true; } diff --git a/Items/VanillaArmorChanges/TinArmorSetChange.cs b/Items/VanillaArmorChanges/TinArmorSetChange.cs index 12a2c7f88e..a46b8b9f21 100644 --- a/Items/VanillaArmorChanges/TinArmorSetChange.cs +++ b/Items/VanillaArmorChanges/TinArmorSetChange.cs @@ -1,5 +1,4 @@ -using System.Text; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,25 +14,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Tin"; - public const float HeadCrit = 4f; - public const int ChestLifeRegen = 1; - public const float LegsMoveSpeed = 0.05f; - public const float SetBonusArmorPen = 5.0f; - - public override void ApplyHeadPieceEffect(Player player) => player.GetCritChance() += HeadCrit; - - public override void ApplyBodyPieceEffect(Player player) => player.lifeRegen += ChestLifeRegen; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float SetBonusCrit = 10f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusCrit)}"; } public override void ApplyArmorSetBonus(Player player) { - player.GetArmorPenetration() += SetBonusArmorPen; + player.GetCritChance() += SetBonusCrit; } } } diff --git a/Items/VanillaArmorChanges/TungstenArmorSetChange.cs b/Items/VanillaArmorChanges/TungstenArmorSetChange.cs index 50c4be4121..fc4a333b7e 100644 --- a/Items/VanillaArmorChanges/TungstenArmorSetChange.cs +++ b/Items/VanillaArmorChanges/TungstenArmorSetChange.cs @@ -1,6 +1,4 @@ -using System.Text; -using Microsoft.Xna.Framework; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,37 +14,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Tungsten"; - public const float HeadDamage = 0.07f; - public const int ChestLifeRegen = 1; - public const float LegsMoveSpeed = 0.08f; - public const float KnockbackMultiplier = 1.33f; - public const float MaxKnockbackCritConversion = 10f; - - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.lifeRegen += ChestLifeRegen; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float HookBoost = 0.5f; public override void UpdateSetBonusText(ref string setBonusText) { - Player player = Main.LocalPlayer; - float kb = player.GetWeaponKnockback(player.ActiveItem()); - float bonus = MathHelper.Clamp(kb, 0f, MaxKnockbackCritConversion); - - string bonusText = bonus.ToString("n2"); - string kbText = kb.ToString("n2"); - setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(bonusText, kbText)}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(HookBoost.ToPercent())}"; } public override void ApplyArmorSetBonus(Player player) { - // Apply the 33% knockback boost first, so it applies to the following crit boost - player.GetKnockback() *= KnockbackMultiplier; - - // Give the player crit chance equal to the (now boosted) knockback of their held weapon. - float kbToUse = player.GetWeaponKnockback(player.ActiveItem()); - player.GetCritChance() += MathHelper.Clamp(kbToUse, 0f, MaxKnockbackCritConversion); + player.Calamity().tungstenArmorHookBoost = true; } } } diff --git a/Items/Weapons/DraedonsArsenal/Auger.cs b/Items/Weapons/DraedonsArsenal/Auger.cs new file mode 100644 index 0000000000..cac2c11b2f --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/Auger.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Projectiles.DraedonsArsenal; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + public class Auger : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public override void SetDefaults() + { + Item.width = 26; + Item.height = 26; + Item.damage = 68; + Item.DamageType = TrueMeleeDamageClass.Instance; + Item.useTime = Item.useAnimation = 12; + Item.knockBack = 12f; + Item.autoReuse = true; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.shoot = ModContent.ProjectileType(); + Item.noMelee = true; + Item.channel = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/AugerGlow").Value); + } + public override bool MeleePrefix() => true; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool AltFunctionUse(Player player) => true; + public override void HoldItem(Player player) + { + if (Main.myPlayer == player.whoAmI) + player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + float swordType = 0; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && player.Calamity().arsenalCooldown <= 0) + swordType = 5; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, swordType); + + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(7). + AddIngredient(4). + AddIngredient(7). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/Auger.png b/Items/Weapons/DraedonsArsenal/Auger.png new file mode 100644 index 0000000000..deb4092662 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/Auger.png differ diff --git a/Items/Weapons/DraedonsArsenal/AugerGlow.png b/Items/Weapons/DraedonsArsenal/AugerGlow.png new file mode 100644 index 0000000000..5c8a5771a1 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/AugerGlow.png differ diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs deleted file mode 100644 index e8e51a0954..0000000000 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.SunkenSea; -using CalamityMod.Projectiles.DraedonsArsenal; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.DraedonsArsenal -{ - public class GaussDagger : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - public override void SetDefaults() - { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.width = 26; - Item.height = 26; - Item.damage = 25; - Item.DamageType = DamageClass.Melee; - Item.useTime = 24; - Item.useAnimation = 24; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.knockBack = 7f; - - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; - Item.rare = ItemRarityID.Orange; - - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - - modItem.UsesCharge = true; - modItem.MaxCharge = 50f; - modItem.ChargePerUse = 0.05f; - } - - public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - if (target.Calamity().GaussFluxTimer == 0) - { - target.Calamity().GaussFluxTimer = 50; - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.GetSource_ItemUse(Item), target.Center, Vector2.Zero, ModContent.ProjectileType(), Item.damage, 0f, player.whoAmI, 0f, target.whoAmI); - } - } - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(5). - AddIngredient(7). - AddIngredient(4). - AddIngredient(7). - AddTile(TileID.Anvils). - Register(); - } - } -} diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.png b/Items/Weapons/DraedonsArsenal/GaussDagger.png deleted file mode 100644 index 77ac1dfc11..0000000000 Binary files a/Items/Weapons/DraedonsArsenal/GaussDagger.png and /dev/null differ 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/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index afd9ba1dd8..955d04c411 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.rare = ItemRarityID.Orange; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 8.2f; + Item.shootSpeed = 8f; } 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/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/AbyssalTome.cs b/Items/Weapons/Magic/AbyssalTome.cs index 12edcf818c..005898e5f7 100644 --- a/Items/Weapons/Magic/AbyssalTome.cs +++ b/Items/Weapons/Magic/AbyssalTome.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.SlimeGod; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs.SlimeGod; using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Magic public class AbyssalTome : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; 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/AlulaAustralis.cs b/Items/Weapons/Magic/AlulaAustralis.cs index 7211108bdf..a4f9a3b733 100644 --- a/Items/Weapons/Magic/AlulaAustralis.cs +++ b/Items/Weapons/Magic/AlulaAustralis.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -12,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AnahitasArpeggio.cs b/Items/Weapons/Magic/AnahitasArpeggio.cs index 07505a8cf2..12687cad69 100644 --- a/Items/Weapons/Magic/AnahitasArpeggio.cs +++ b/Items/Weapons/Magic/AnahitasArpeggio.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -19,7 +21,10 @@ namespace CalamityMod.Items.Weapons.Magic public static readonly SoundStyle CapSound = new("CalamityMod/Sounds/Item/HarpLV6"); public static readonly SoundStyle EndSound = new("CalamityMod/Sounds/Item/HarpEnd"); public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/HarpNoteHit"); - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 56; diff --git a/Items/Weapons/Magic/Atlantis.cs b/Items/Weapons/Magic/Atlantis.cs index a6bf35a3c3..9a3d1edf4d 100644 --- a/Items/Weapons/Magic/Atlantis.cs +++ b/Items/Weapons/Magic/Atlantis.cs @@ -7,6 +7,7 @@ using CalamityMod.Particles; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Weapons.Summon; namespace CalamityMod.Items.Weapons.Magic { @@ -16,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/BloodBath.cs b/Items/Weapons/Magic/BloodBath.cs index 5bdcb4e06f..b5e7b46e52 100644 --- a/Items/Weapons/Magic/BloodBath.cs +++ b/Items/Weapons/Magic/BloodBath.cs @@ -1,5 +1,7 @@ using System; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -15,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -90,15 +93,5 @@ namespace CalamityMod.Items.Weapons.Magic } return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 3). - AddIngredient(9). - AddIngredient(ItemID.Vertebrae, 3). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Magic/DeathValleyDuster.cs b/Items/Weapons/Magic/DeathValleyDuster.cs index 0a19d54c0c..78a54eeab3 100644 --- a/Items/Weapons/Magic/DeathValleyDuster.cs +++ b/Items/Weapons/Magic/DeathValleyDuster.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 36; Item.height = 40; - Item.damage = 159; + Item.damage = 130; Item.DamageType = DamageClass.Magic; - Item.mana = 45; + Item.mana = 38; Item.useTime = 50; Item.useAnimation = 50; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index c06f2343cd..d63e6f57c0 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() { Item.width = 80; diff --git a/Items/Weapons/Magic/Downpour.cs b/Items/Weapons/Magic/Downpour.cs index 0bede5d021..65e5e80756 100644 --- a/Items/Weapons/Magic/Downpour.cs +++ b/Items/Weapons/Magic/Downpour.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index 3021f53ee0..993e63b377 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic public class EldritchTome : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; 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/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index 26f28c4056..7a692a38c4 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/GhastlyVisage.cs b/Items/Weapons/Magic/GhastlyVisage.cs index 086b54ccde..05bf23161e 100644 --- a/Items/Weapons/Magic/GhastlyVisage.cs +++ b/Items/Weapons/Magic/GhastlyVisage.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Magic public class GhastlyVisage : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; diff --git a/Items/Weapons/Magic/Hematemesis.cs b/Items/Weapons/Magic/Hematemesis.cs index 5ccbd20082..8071e3633f 100644 --- a/Items/Weapons/Magic/Hematemesis.cs +++ b/Items/Weapons/Magic/Hematemesis.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -13,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 5b215872ec..55230bb5f9 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Terraria; using Terraria.DataStructures; @@ -14,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/HyphaeRod.cs b/Items/Weapons/Magic/HyphaeRod.cs index dc7b12a637..e0052dbee8 100644 --- a/Items/Weapons/Magic/HyphaeRod.cs +++ b/Items/Weapons/Magic/HyphaeRod.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() 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/LashesofChaos.cs b/Items/Weapons/Magic/LashesofChaos.cs index e993083d8c..e3e1f630a4 100644 --- a/Items/Weapons/Magic/LashesofChaos.cs +++ b/Items/Weapons/Magic/LashesofChaos.cs @@ -1,4 +1,6 @@ using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Particles; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; @@ -16,7 +18,10 @@ namespace CalamityMod.Items.Weapons.Magic public int FiringMode = 0; // 0 = hellfireballs, 1 = hellblasts public int ProjectilesFired = 0; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; 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/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 9e50922cde..118911fbaf 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -15,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/PlagueStaff.cs b/Items/Weapons/Magic/PlagueStaff.cs index c9cd97def5..eacb05e87f 100644 --- a/Items/Weapons/Magic/PlagueStaff.cs +++ b/Items/Weapons/Magic/PlagueStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -13,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() 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 0e5ae09073..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 = 5000; + 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/PurgeGuzzler.cs b/Items/Weapons/Magic/PurgeGuzzler.cs index b39487c4e9..9675c27234 100644 --- a/Items/Weapons/Magic/PurgeGuzzler.cs +++ b/Items/Weapons/Magic/PurgeGuzzler.cs @@ -1,4 +1,7 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -13,7 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic { public new string LocalizationCategory => "Items.Weapons.Magic"; private const float Spread = 0.025f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 64; diff --git a/Items/Weapons/Magic/RougeSlash.cs b/Items/Weapons/Magic/RougeSlash.cs index e9975d1d74..06930e2bf0 100644 --- a/Items/Weapons/Magic/RougeSlash.cs +++ b/Items/Weapons/Magic/RougeSlash.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic public class RougeSlash : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.mana = 30; diff --git a/Items/Weapons/Magic/SandstreamScepter.cs b/Items/Weapons/Magic/SandstreamScepter.cs index 2478aed15c..d80b24a5a6 100644 --- a/Items/Weapons/Magic/SandstreamScepter.cs +++ b/Items/Weapons/Magic/SandstreamScepter.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -14,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/SeethingDischarge.cs b/Items/Weapons/Magic/SeethingDischarge.cs index 63aeac78ab..2d8ec34175 100644 --- a/Items/Weapons/Magic/SeethingDischarge.cs +++ b/Items/Weapons/Magic/SeethingDischarge.cs @@ -1,4 +1,6 @@ -using CalamityMod.NPCs.BrimstoneElemental; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.Projectiles.Magic; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -14,6 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public int DartTimer = 0; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; diff --git a/Items/Weapons/Magic/ShaderainStaff.cs b/Items/Weapons/Magic/ShaderainStaff.cs index cb4d8ccff9..fe4378f2ec 100644 --- a/Items/Weapons/Magic/ShaderainStaff.cs +++ b/Items/Weapons/Magic/ShaderainStaff.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public class ShaderainStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + #region Other stats // Stats for the shaderain. @@ -26,10 +28,10 @@ namespace CalamityMod.Items.Weapons.Magic public const float DeaccelerationStrenght = 0.95f; // A number lower than 1, non-including 1, changing it very slightly will have drastic results. #endregion - public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -77,15 +79,5 @@ namespace CalamityMod.Items.Weapons.Magic return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 3). - AddIngredient(9). - AddIngredient(ItemID.RottenChunk, 3). - AddTile(TileID.DemonAltar). - Register(); - } } } 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/SnowstormStaff.cs b/Items/Weapons/Magic/SnowstormStaff.cs index 4d4c8e00f5..39c0f133b2 100644 --- a/Items/Weapons/Magic/SnowstormStaff.cs +++ b/Items/Weapons/Magic/SnowstormStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +9,10 @@ namespace CalamityMod.Items.Weapons.Magic public class SnowstormStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; 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/StarShower.cs b/Items/Weapons/Magic/StarShower.cs index f699464be8..349ac20155 100644 --- a/Items/Weapons/Magic/StarShower.cs +++ b/Items/Weapons/Magic/StarShower.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using System; using Terraria; @@ -14,7 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; internal const float ShootSpeed = 28f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 38; diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index 25da1eb71e..a33d1a3aca 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -17,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/VitriolicViper.cs b/Items/Weapons/Magic/VitriolicViper.cs index 681c2e9007..a931b51f65 100644 --- a/Items/Weapons/Magic/VitriolicViper.cs +++ b/Items/Weapons/Magic/VitriolicViper.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,7 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic public class VitriolicViper : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 60; 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/Magic/Volterion.cs b/Items/Weapons/Magic/Volterion.cs index 5579403159..10636642ae 100644 --- a/Items/Weapons/Magic/Volterion.cs +++ b/Items/Weapons/Magic/Volterion.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -12,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Magic public class Volterion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 220; 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/Aorta.cs b/Items/Weapons/Melee/Aorta.cs index 6552a7ee34..b6092caa54 100644 --- a/Items/Weapons/Melee/Aorta.cs +++ b/Items/Weapons/Melee/Aorta.cs @@ -1,4 +1,6 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.ID; @@ -21,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -46,15 +49,5 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Orange; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 3). - AddIngredient(9). - AddIngredient(ItemID.Vertebrae, 3). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Melee/Avalanche.cs b/Items/Weapons/Melee/Avalanche.cs index af32ff182b..745a1360a0 100644 --- a/Items/Weapons/Melee/Avalanche.cs +++ b/Items/Weapons/Melee/Avalanche.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Avalanche : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 64; diff --git a/Items/Weapons/Melee/BansheeHook.cs b/Items/Weapons/Melee/BansheeHook.cs index 0c788bd3ff..311a9d72ff 100644 --- a/Items/Weapons/Melee/BansheeHook.cs +++ b/Items/Weapons/Melee/BansheeHook.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.Spears[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() 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/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 891c17c57e..46913bec43 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee.Spears; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.Melee.Spears; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.Spears[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() { Item.width = 56; diff --git a/Items/Weapons/Melee/BurningRevelation.cs b/Items/Weapons/Melee/BurningRevelation.cs index c0bdd8753b..8d4f9d133a 100644 --- a/Items/Weapons/Melee/BurningRevelation.cs +++ b/Items/Weapons/Melee/BurningRevelation.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -24,6 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() 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/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index 3b7300228c..8358f4fdaf 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +9,10 @@ namespace CalamityMod.Items.Weapons.Melee public class DragonRage : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 128; 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 ad3d886059..28f35fe250 100644 --- a/Items/Weapons/Melee/Excelsus.cs +++ b/Items/Weapons/Melee/Excelsus.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,15 +13,18 @@ namespace CalamityMod.Items.Weapons.Melee public class Excelsus : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { 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; @@ -58,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/GeliticBlade.cs b/Items/Weapons/Melee/GeliticBlade.cs index 7fd0f6babb..6c6c677157 100644 --- a/Items/Weapons/Melee/GeliticBlade.cs +++ b/Items/Weapons/Melee/GeliticBlade.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index e278081d7e..c51ec4f628 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -1,39 +1,49 @@ -using CalamityMod.Projectiles.Melee.Spears; +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/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index 14adbd1f69..877ec86454 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -21,6 +23,10 @@ namespace CalamityMod.Items.Weapons.Melee internal const int TotalRows = 2; internal const int TotalTeeth = 3; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Melee/HolyCollider.cs b/Items/Weapons/Melee/HolyCollider.cs index 8829a63b1c..88240d2b8e 100644 --- a/Items/Weapons/Melee/HolyCollider.cs +++ b/Items/Weapons/Melee/HolyCollider.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.BaseItems; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Melee public class HolyCollider : CustomUseProjItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 114; diff --git a/Items/Weapons/Melee/InsidiousImpaler.cs b/Items/Weapons/Melee/InsidiousImpaler.cs index 61e02ad1f3..e481325e65 100644 --- a/Items/Weapons/Melee/InsidiousImpaler.cs +++ b/Items/Weapons/Melee/InsidiousImpaler.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,7 +14,10 @@ namespace CalamityMod.Items.Weapons.Melee public class InsidiousImpaler : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; diff --git a/Items/Weapons/Melee/MirrorBlade.cs b/Items/Weapons/Melee/MirrorBlade.cs index 08ad1543fe..684601d2fa 100644 --- a/Items/Weapons/Melee/MirrorBlade.cs +++ b/Items/Weapons/Melee/MirrorBlade.cs @@ -10,6 +10,8 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; +using Terraria.Audio; +using CalamityMod.Items.Weapons.Summon; using Terraria.ModLoader; using static System.Net.Mime.MediaTypeNames; @@ -33,6 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.AnimatesAsSoul[Type] = true; ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; base.SetStaticDefaults(); + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { 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/MycelialClaws.cs b/Items/Weapons/Melee/MycelialClaws.cs index d8ed6d9a09..b8da26e630 100644 --- a/Items/Weapons/Melee/MycelialClaws.cs +++ b/Items/Weapons/Melee/MycelialClaws.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -9,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Melee public class MycelialClaws : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 22; diff --git a/Items/Weapons/Melee/Nebulash.cs b/Items/Weapons/Melee/Nebulash.cs index d9b6e29fd2..4858d975ea 100644 --- a/Items/Weapons/Melee/Nebulash.cs +++ b/Items/Weapons/Melee/Nebulash.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Nebulash : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 16; diff --git a/Items/Weapons/Melee/Oblivion.cs b/Items/Weapons/Melee/Oblivion.cs index 01c3ab635d..f836bb4d0b 100644 --- a/Items/Weapons/Melee/Oblivion.cs +++ b/Items/Weapons/Melee/Oblivion.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -20,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() 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/PerfectDark.cs b/Items/Weapons/Melee/PerfectDark.cs index 666b744d04..73949cbb30 100644 --- a/Items/Weapons/Melee/PerfectDark.cs +++ b/Items/Weapons/Melee/PerfectDark.cs @@ -1,5 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Melee public class PerfectDark : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 50; @@ -37,14 +43,5 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(ModContent.BuffType(), 300); } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 5). - AddIngredient(15). - AddIngredient(ItemID.RottenChunk, 5). - AddTile(TileID.DemonAltar). - Register(); - } } } 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/SaharaSlicers.cs b/Items/Weapons/Melee/SaharaSlicers.cs index 40549fec04..4a6023a941 100644 --- a/Items/Weapons/Melee/SaharaSlicers.cs +++ b/Items/Weapons/Melee/SaharaSlicers.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Shortswords; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; @@ -18,6 +19,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index d43d86bd7f..6fbf590a5c 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee.Spears; using Terraria; using Terraria.ID; @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.Spears[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -36,15 +38,5 @@ namespace CalamityMod.Items.Weapons.Melee } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } 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/SkytideDragoon.cs b/Items/Weapons/Melee/SkytideDragoon.cs index eb4c791c2c..a406565bb4 100644 --- a/Items/Weapons/Melee/SkytideDragoon.cs +++ b/Items/Weapons/Melee/SkytideDragoon.cs @@ -1,5 +1,7 @@ using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,7 +15,10 @@ namespace CalamityMod.Items.Weapons.Melee public class SkytideDragoon : CustomUseProjItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 86; diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 8efaa7e44f..56fad47d94 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -17,9 +17,8 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 100; Item.height = 118; - Item.damage = 110; + Item.damage = 143; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useAnimation = Item.useTime = 33; Item.useTurn = 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/SubmarineShocker.cs b/Items/Weapons/Melee/SubmarineShocker.cs index 3ec096138d..757cb2ce38 100644 --- a/Items/Weapons/Melee/SubmarineShocker.cs +++ b/Items/Weapons/Melee/SubmarineShocker.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Shortswords; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Shortswords; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Melee public class SubmarineShocker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; 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/TerrorBlade.cs b/Items/Weapons/Melee/TerrorBlade.cs index 4d786f1baf..3f04aeed65 100644 --- a/Items/Weapons/Melee/TerrorBlade.cs +++ b/Items/Weapons/Melee/TerrorBlade.cs @@ -1,4 +1,6 @@ using System.Collections.Generic; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,7 +15,10 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; internal const float TerrorBlastMultiplier = 0.3f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 88; diff --git a/Items/Weapons/Melee/TheBurningSky.cs b/Items/Weapons/Melee/TheBurningSky.cs index 88597dead0..743506420f 100644 --- a/Items/Weapons/Melee/TheBurningSky.cs +++ b/Items/Weapons/Melee/TheBurningSky.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -17,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - // Visually a sword, but with no true melee capability. The Burning Sky is held out like a staff. Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheGodsGambit.cs b/Items/Weapons/Melee/TheGodsGambit.cs index d17e980aa4..7b188bfdf3 100644 --- a/Items/Weapons/Melee/TheGodsGambit.cs +++ b/Items/Weapons/Melee/TheGodsGambit.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Melee/TheMicrowave.cs b/Items/Weapons/Melee/TheMicrowave.cs index 21be661ebd..d89a786352 100644 --- a/Items/Weapons/Melee/TheMicrowave.cs +++ b/Items/Weapons/Melee/TheMicrowave.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -22,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index f1b8d996c2..e00105a1a8 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -26,12 +26,11 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 90; Item.height = 90; Item.damage = 1005; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = 30; 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 07c02ed83e..7033254faf 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -1,4 +1,7 @@ using System.Collections.Generic; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Rarities; using Terraria; @@ -21,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -28,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/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs index c24a749c40..4ca93ea57a 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 168; Item.height = 168; - Item.damage = 5000; + Item.damage = 2000; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; - Item.useAnimation = Item.useTime = 36; + Item.useAnimation = Item.useTime = 40; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 14f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 2dbd3efbd9..36b0850ef5 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int BaseDamage = 115; - public static int DefaultAttunement_BaseDamage = 100; + public static int DefaultAttunement_BaseDamage = 90; public static int DefaultAttunement_SigilTime = 900; public static int DefaultAttunement_BeamTime = 90; public static float DefaultAttunement_LungeDamageMult = 2f; @@ -48,27 +48,27 @@ namespace CalamityMod.Items.Weapons.Melee public static float EvilAttunement_SlashDamageBoost = 3f; public static int EvilAttunement_SlashIFrames = 60; - public static int ColdAttunement_BaseDamage = 150; + public static int ColdAttunement_BaseDamage = 140; public static float ColdAttunement_ThirdSwingBoost = 1.25f; public static float ColdAttunement_MistDamageReduction = 0.11f; - public static int HotAttunement_BaseDamage = 135; + public static int HotAttunement_BaseDamage = 126; public static int HotAttunement_PlayerShredIFrames = 8; public static float HotAttunement_ShotDamageBoost = 4.5f; public static int HotAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2 public static float HotAttunement_ShredDecayRate = 0.65f; //How much charge is lost per frame. - public static int TropicalAttunement_BaseDamage = 150; + public static int TropicalAttunement_BaseDamage = 132; public static float TropicalAttunement_ChainDamageReduction = 0.6f; public static float TropicalAttunement_VineDamageReduction = 0.3f; public static float TropicalAttunement_SweetSpotDamageMultiplier = 1.5f; //It also crits, so be mindful of that public static int TropicalAttunement_LocalIFrames = 60; //Be warned its got 2 extra updates so all the iframes should be divided in 3 - public static int HolyAttunement_BaseDamage = 66; - public static float HolyAttunement_BaseSwingDamageMult = 0.75f; - public static float HolyAttunement_FullSwingDamageMult = 1.5f; - public static float HolyAttunement_ThrowDamageBoost = 3.8f; - public static int HolyAttunement_LocalIFrames = 16; //Be warned its got 1 extra update yadda yadda + public static int HolyAttunement_BaseDamage = 84; + public static float HolyAttunement_BaseSwingDamageMult = 0.5f; + public static float HolyAttunement_FullSwingDamageMult = 1f; + public static float HolyAttunement_ThrowDamageBoost = 3f; + public static int HolyAttunement_LocalIFrames = 20; //Be warned its got 1 extra update yadda yadda public static float HolyAttunement_MonolithDamage = 0.5f; #endregion diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index d910cee78b..a4e97d574d 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; @@ -12,7 +14,10 @@ namespace CalamityMod.Items.Weapons.Melee public class UltimusCleaver : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 72; diff --git a/Items/Weapons/Melee/VeinBurster.cs b/Items/Weapons/Melee/VeinBurster.cs index c8d2f1f9d7..e23cc6bb6b 100644 --- a/Items/Weapons/Melee/VeinBurster.cs +++ b/Items/Weapons/Melee/VeinBurster.cs @@ -1,5 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Melee public class VeinBurster : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 52; @@ -37,14 +43,5 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(ModContent.BuffType(), 300); } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 5). - AddIngredient(15). - AddIngredient(ItemID.Vertebrae, 5). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs index a5c14dd92e..70362f76b4 100644 --- a/Items/Weapons/Melee/Violence.cs +++ b/Items/Weapons/Melee/Violence.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Violence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 142; diff --git a/Items/Weapons/Melee/Virulence.cs b/Items/Weapons/Melee/Virulence.cs index 97f4b5a5ac..b9320c46fd 100644 --- a/Items/Weapons/Melee/Virulence.cs +++ b/Items/Weapons/Melee/Virulence.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Virulence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 74; 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 342af60f9c..8c11300b71 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Ranged; @@ -23,8 +25,11 @@ namespace CalamityMod.Items.Weapons.Ranged public float SniperVelocityMult = 2f; public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - + public override void SetStaticDefaults() + { + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 70; @@ -45,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) @@ -170,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/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index 0cc08831d2..168753fe67 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class AuroraBlazer : 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 = 68; diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index aae8b9e920..acd1cd5aa3 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Weapons.Ranged public class Barinade : 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 = 52; @@ -28,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 12d468c942..a3b381d0b9 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -1,4 +1,7 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Barinautical : 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 = 30; @@ -30,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 50e3df7a73..c9696beced 100644 --- a/Items/Weapons/Ranged/BlightSpewer.cs +++ b/Items/Weapons/Ranged/BlightSpewer.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -42,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/BlissfulBombardier.cs b/Items/Weapons/Ranged/BlissfulBombardier.cs index 4f76ab7311..b429d4cd86 100644 --- a/Items/Weapons/Ranged/BlissfulBombardier.cs +++ b/Items/Weapons/Ranged/BlissfulBombardier.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class BlissfulBombardier : 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 = 88; 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/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index 2300098a78..1832cea17c 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -12,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class ChickenCannon : 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 = 126; 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 8132546927..4588b6b709 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -16,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -35,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 6a3667da12..ab347b043c 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class DaemonsFlame : 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 = 62; @@ -33,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 9632dcfee7..99603e8425 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,14 +14,17 @@ namespace CalamityMod.Items.Weapons.Ranged public class Deathwind : 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 = 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; @@ -30,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) @@ -46,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/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index f313c05955..34eab37a86 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -21,7 +23,10 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle WeldingShoot = new("CalamityMod/Sounds/Item/WeldingShoot") { Volume = 0.45f }; public int Counter = 0; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 124; 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 6a6d5e6b82..420161a8c4 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -1,4 +1,6 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Eviscerator : 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 = 58; @@ -29,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 @@ -46,15 +51,5 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 6027e5535d..12c1023bb0 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class FetidEmesis : 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 = 76; 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 32d4028e9a..9515420395 100644 --- a/Items/Weapons/Ranged/Fungicide.cs +++ b/Items/Weapons/Ranged/Fungicide.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Fungicide : 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 = 40; @@ -28,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 87e94b5a7c..c0611fc259 100644 --- a/Items/Weapons/Ranged/GoldenEagle.cs +++ b/Items/Weapons/Ranged/GoldenEagle.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -10,7 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; private const float Spread = 0.0425f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 46; @@ -29,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 6b51c5ba4b..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) @@ -62,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index 175b7691be..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() @@ -54,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } 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/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index c259c226ab..1d82cba55f 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -1,6 +1,7 @@ using System.Linq; using CalamityMod.Cooldowns; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -18,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { 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 6dcc2a5750..03947cc5eb 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class HoarfrostBow : 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 = 26; @@ -29,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 26978f9907..50f41fa042 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -1,5 +1,7 @@ using System; using System.Diagnostics.Metrics; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Particles; using CalamityMod.Projectiles.Ranged; using Microsoft.Build.Tasks; @@ -21,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -40,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/M1Garand.cs b/Items/Weapons/Ranged/M1Garand.cs new file mode 100644 index 0000000000..ff034f96b2 --- /dev/null +++ b/Items/Weapons/Ranged/M1Garand.cs @@ -0,0 +1,62 @@ +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.DataStructures; +using static Terraria.ModLoader.ModContent; +using CalamityMod.Cooldowns; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class M1Garand : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetDefaults() + { + Item.width = 102; + Item.height = 22; + Item.damage = 75; + Item.DamageType = DamageClass.Ranged; + + Item.useTime = 40; + Item.useAnimation = 40; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.knockBack = 2f; + Item.autoReuse = false; // Because holdout + Item.channel = true; // Because holdout + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 12f; + Item.useAmmo = AmmoID.Bullet; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; + } + + public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) + { + if (player.Calamity().cooldowns.TryGetValue(M1GarandShots.ID, out var cooldown)) + { + cooldown.timeLeft = 8 - player.Calamity().garandShots; + } + else + { + player.AddCooldown(M1GarandShots.ID, 8); + } + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ProjectileType(), damage, knockback, player.whoAmI); + + // Seting its velocity like this is what aims to the mouse + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + + return false; + } + } +} diff --git a/Items/Weapons/Ranged/M1Garand.png b/Items/Weapons/Ranged/M1Garand.png new file mode 100644 index 0000000000..a0b47c6f6d Binary files /dev/null and b/Items/Weapons/Ranged/M1Garand.png differ 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 0645679232..e37f4b5964 100644 --- a/Items/Weapons/Ranged/Malevolence.cs +++ b/Items/Weapons/Ranged/Malevolence.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -11,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; @@ -29,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) @@ -49,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/OverloadedBlaster.cs b/Items/Weapons/Ranged/OverloadedBlaster.cs index 509277d994..94f3c69f60 100644 --- a/Items/Weapons/Ranged/OverloadedBlaster.cs +++ b/Items/Weapons/Ranged/OverloadedBlaster.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class OverloadedBlaster : 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 = 42; 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 f8eebf70e4..93e90c6d72 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -29,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 baaed6a188..6846184c84 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class RealmRavager : 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 = 76; @@ -28,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/SepticSkewer.cs b/Items/Weapons/Ranged/SepticSkewer.cs index ab572d256f..4227b9cd41 100644 --- a/Items/Weapons/Ranged/SepticSkewer.cs +++ b/Items/Weapons/Ranged/SepticSkewer.cs @@ -9,6 +9,8 @@ using System; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Boss; using Terraria.Audio; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Magic; namespace CalamityMod.Items.Weapons.Ranged { @@ -20,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/Shadethrower.cs b/Items/Weapons/Ranged/Shadethrower.cs index 24ffb6e7cb..7abe62d724 100644 --- a/Items/Weapons/Ranged/Shadethrower.cs +++ b/Items/Weapons/Ranged/Shadethrower.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Shadethrower : 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 = 76; @@ -32,15 +37,5 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 4). - AddIngredient(12). - AddIngredient(ItemID.RottenChunk, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } 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/StarSputter.cs b/Items/Weapons/Ranged/StarSputter.cs index f8c21806ff..6bd01f58d0 100644 --- a/Items/Weapons/Ranged/StarSputter.cs +++ b/Items/Weapons/Ranged/StarSputter.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,7 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; private int counter = 0; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 80; 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 08adaa405d..56277e2258 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -20,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Main.RegisterItemAnimation(Type, new DrawAnimationVertical(3, 5)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { @@ -42,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 a5365bc034..cc2a7042ba 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -16,7 +16,10 @@ namespace CalamityMod.Items.Weapons.Ranged public static float MaxCharge = 90f; public static int OriginalUseTime = 34; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.damage = 92; 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/TheStorm.cs b/Items/Weapons/Ranged/TheStorm.cs index 62013d29ee..531499c4e2 100644 --- a/Items/Weapons/Ranged/TheStorm.cs +++ b/Items/Weapons/Ranged/TheStorm.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -18,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ItemID.Sets.AnimatesAsSoul[Type] = true; Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 9)); + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { 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/TitaniumRailgun.cs b/Items/Weapons/Ranged/TitaniumRailgun.cs index 34ad55a974..ce97852a7d 100644 --- a/Items/Weapons/Ranged/TitaniumRailgun.cs +++ b/Items/Weapons/Ranged/TitaniumRailgun.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 16f; } - public override Vector2? HoldoutOffset() => new Vector2(-5, 4); + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/TitaniumRailgun.png b/Items/Weapons/Ranged/TitaniumRailgun.png index 869227b094..1122b96be4 100644 Binary files a/Items/Weapons/Ranged/TitaniumRailgun.png and b/Items/Weapons/Ranged/TitaniumRailgun.png differ 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/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index 04409f3752..95aae5cd59 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class AuroradicalThrow : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 34; 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/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 39a5b4a75d..378cee23de 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class CosmicKunai : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 26; diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index 5ef882b4c0..7c33cb6419 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class CraniumSmasher : RogueWeapon { private bool throwExplosive = false; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 50; 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 e9d74d021e..bf74a45769 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,28 +13,30 @@ namespace CalamityMod.Items.Weapons.Rogue public class Eradicator : RogueWeapon { public static float Speed = 10.5f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { 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/GelDart.cs b/Items/Weapons/Rogue/GelDart.cs index c01f1fb608..53b4185afa 100644 --- a/Items/Weapons/Rogue/GelDart.cs +++ b/Items/Weapons/Rogue/GelDart.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Rogue/GhoulishGouger.cs b/Items/Weapons/Rogue/GhoulishGouger.cs index e3b26d6f38..86dce8ed23 100644 --- a/Items/Weapons/Rogue/GhoulishGouger.cs +++ b/Items/Weapons/Rogue/GhoulishGouger.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class GhoulishGouger : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 74; 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/Icebreaker.cs b/Items/Weapons/Rogue/Icebreaker.cs index 2e7bee34db..c0074f74c9 100644 --- a/Items/Weapons/Rogue/Icebreaker.cs +++ b/Items/Weapons/Rogue/Icebreaker.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Icebreaker : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 60; diff --git a/Items/Weapons/Rogue/InfestedClawmerang.cs b/Items/Weapons/Rogue/InfestedClawmerang.cs index 829c59c962..347338642b 100644 --- a/Items/Weapons/Rogue/InfestedClawmerang.cs +++ b/Items/Weapons/Rogue/InfestedClawmerang.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue [LegacyName("Shroomerang")] public class InfestedClawmerang : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 26; diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index 8ea4e320a3..fb6f34714a 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -9,6 +9,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class LeviathanTeeth : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 36; @@ -24,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 5.5f; + Item.shootSpeed = 7.5f; Item.DamageType = RogueDamageClass.Instance; } @@ -32,14 +36,13 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity * 1.5f, type, damage, knockback * 12, player.whoAmI, 0f, 4f); + Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.SafeNormalize(Vector2.UnitX), ModContent.ProjectileType(), damage, 0, player.whoAmI, 0, 0); tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 140; } else { for (int i = 0; i < 2; i++) - Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.7f, 1f), type, damage, knockback, player.whoAmI, 0f, Main.rand.Next(1, 3+1)); + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.8f, 1f), type, damage, knockback, player.whoAmI, 0f, Main.rand.Next(1, 3+1)); } return false; } diff --git a/Items/Weapons/Rogue/MoltenAmputator.cs b/Items/Weapons/Rogue/MoltenAmputator.cs index 6b61c1d864..ef1ddd4839 100644 --- a/Items/Weapons/Rogue/MoltenAmputator.cs +++ b/Items/Weapons/Rogue/MoltenAmputator.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class MoltenAmputator : RogueWeapon { public float speed = 16; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 92; diff --git a/Items/Weapons/Rogue/Mycoroot.cs b/Items/Weapons/Rogue/Mycoroot.cs index ee618d77d6..0975e41c26 100644 --- a/Items/Weapons/Rogue/Mycoroot.cs +++ b/Items/Weapons/Rogue/Mycoroot.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Mycoroot : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; 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/RegulusRiot.cs b/Items/Weapons/Rogue/RegulusRiot.cs index 02c40309ce..9aa73883e5 100644 --- a/Items/Weapons/Rogue/RegulusRiot.cs +++ b/Items/Weapons/Rogue/RegulusRiot.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class RegulusRiot : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; diff --git a/Items/Weapons/Rogue/RotBall.cs b/Items/Weapons/Rogue/RotBall.cs index 374b63d451..64b31ae366 100644 --- a/Items/Weapons/Rogue/RotBall.cs +++ b/Items/Weapons/Rogue/RotBall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class RotBall : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 30; @@ -46,15 +51,5 @@ namespace CalamityMod.Items.Weapons.Rogue } return true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 4). - AddIngredient(12). - AddIngredient(ItemID.RottenChunk, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index 5d8628eb35..763489019b 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Sacrifice : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 68; diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.cs b/Items/Weapons/Rogue/ScourgeoftheDesert.cs index 3686253aea..5b26a0f0e6 100644 --- a/Items/Weapons/Rogue/ScourgeoftheDesert.cs +++ b/Items/Weapons/Rogue/ScourgeoftheDesert.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +11,11 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ScourgeoftheDesert : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } + public override void SetDefaults() { Item.width = 112; diff --git a/Items/Weapons/Rogue/ScourgeoftheSeas.cs b/Items/Weapons/Rogue/ScourgeoftheSeas.cs index 73754f4fb0..2bdbb91d65 100644 --- a/Items/Weapons/Rogue/ScourgeoftheSeas.cs +++ b/Items/Weapons/Rogue/ScourgeoftheSeas.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ScourgeoftheSeas : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 64; 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/TheFinalDawn.cs b/Items/Weapons/Rogue/TheFinalDawn.cs index e85e7b59a3..2500dc9318 100644 --- a/Items/Weapons/Rogue/TheFinalDawn.cs +++ b/Items/Weapons/Rogue/TheFinalDawn.cs @@ -12,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class TheFinalDawn : RogueWeapon { public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/FinalDawnSlash"); + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 78; diff --git a/Items/Weapons/Rogue/TheSyringe.cs b/Items/Weapons/Rogue/TheSyringe.cs index 0275281647..d367bb675f 100644 --- a/Items/Weapons/Rogue/TheSyringe.cs +++ b/Items/Weapons/Rogue/TheSyringe.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,7 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public static float Knockback = 5f; public static float Speed = 15f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 14; 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/ToothBall.cs b/Items/Weapons/Rogue/ToothBall.cs index 686a7719a8..3a7602e4bb 100644 --- a/Items/Weapons/Rogue/ToothBall.cs +++ b/Items/Weapons/Rogue/ToothBall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ToothBall : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 30; @@ -46,15 +51,5 @@ namespace CalamityMod.Items.Weapons.Rogue } return true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index df12311f53..653b69f403 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ToxicantTwister : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 42; diff --git a/Items/Weapons/Rogue/Whitewater.cs b/Items/Weapons/Rogue/Whitewater.cs index 2f34530323..7bdce47561 100644 --- a/Items/Weapons/Rogue/Whitewater.cs +++ b/Items/Weapons/Rogue/Whitewater.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class Whitewater : RogueWeapon { public bool splitDirection = false; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 36; diff --git a/Items/Weapons/Rogue/Wrathwing.cs b/Items/Weapons/Rogue/Wrathwing.cs index 649e31cfba..dbfb608a2e 100644 --- a/Items/Weapons/Rogue/Wrathwing.cs +++ b/Items/Weapons/Rogue/Wrathwing.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue [LegacyName("ProfanedTrident")] public class Wrathwing : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 152; diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 440167f3fd..3a3f689635 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -7,6 +7,7 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Utilities; namespace CalamityMod.Items.Weapons.Rogue { @@ -37,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; @@ -50,13 +51,28 @@ namespace CalamityMod.Items.Weapons.Rogue stealthStrikeStarted = false; Item.UseSound = Throw3Sound; - - if (Item.stack == 2) - Item.UseSound = Throw2Sound; - if (Item.stack == 1) - Item.UseSound = Throw1Sound; } + public override void HoldItem(Player player) + { + if (player.controlUseTile && !player.mouseInterface && !player.ItemAnimationActive) + { + if (Main.rand.NextBool(7)) + { + Particle streak = new ManaDrainStreak(player, Main.rand.NextFloat(0.2f, 0.5f), Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(170f, 670f), Main.rand.NextFloat(30f, 44f), Color.GreenYellow, Color.DeepSkyBlue, Main.rand.Next(15, 30)); + GeneralParticleHandler.SpawnParticle(streak); + } + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType() && item.owner == player.whoAmI && item.ai[0] > 0) + { + item.ai[0] = -1; + } + } + } + } + public override bool AltFunctionUse(Player player) => false; + public override float StealthDamageMultiplier => 1.5f; public override bool AdditionalStealthCheck() => stealthStrikeStarted; @@ -71,6 +87,17 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + if (player.altFunctionUse == 2) + { + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType() && item.owner == player.whoAmI && item.ai[0] > 0) + { + item.ai[0] = -1; + } + } + return false; + } if (player.Calamity().StealthStrikeAvailable() || stealthStrikeStarted) { stealthStrikeStarted = true; 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/BorealisBomber.cs b/Items/Weapons/Summon/BorealisBomber.cs index 5252545e0e..4de6655254 100644 --- a/Items/Weapons/Summon/BorealisBomber.cs +++ b/Items/Weapons/Summon/BorealisBomber.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -13,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index a69c43a5a0..b6c15f5dd2 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -1,4 +1,7 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; @@ -28,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; } @@ -36,18 +39,16 @@ namespace CalamityMod.Items.Weapons.Summon { Item.staff[Type] = true; ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { 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/CadaverousCarrion.cs b/Items/Weapons/Summon/CadaverousCarrion.cs index e2ff231070..db5db6b8fb 100644 --- a/Items/Weapons/Summon/CadaverousCarrion.cs +++ b/Items/Weapons/Summon/CadaverousCarrion.cs @@ -11,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class CadaverousCarrion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 54; 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 bdaf95d306..edd2f9d35f 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.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; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class CorroslimeStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 52; @@ -24,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 e1a878b754..3a6cd6413e 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -19,7 +21,11 @@ namespace CalamityMod.Items.Weapons.Summon public const float LanternSummonCost = 2f; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { @@ -35,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; } @@ -44,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 24fa2614c3..467eaf14e4 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class CrimslimeStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 52; @@ -24,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 9f99226039..f996dae50c 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DankStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 58; @@ -25,33 +30,17 @@ 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; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 4). - AddIngredient(12). - AddIngredient(ItemID.RottenChunk, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 147aaa5450..b36a388f5b 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DazzlingStabberStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 56; @@ -26,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(); @@ -38,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 b68a90c690..f65d3f9ae6 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DeepseaStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 44; @@ -23,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/DormantBrimseeker.cs b/Items/Weapons/Summon/DormantBrimseeker.cs index 1dbc591245..52a09aff36 100644 --- a/Items/Weapons/Summon/DormantBrimseeker.cs +++ b/Items/Weapons/Summon/DormantBrimseeker.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DormantBrimseeker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 32; 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 8e1c572b4b..6b74919eb6 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -16,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.staff[Type] = true; ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -24,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; @@ -42,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++) @@ -52,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 e1103cbc49..66dbca0b57 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,13 +14,17 @@ namespace CalamityMod.Items.Weapons.Summon public class EtherealSubjugator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; Item.height = 70; Item.damage = 200; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -38,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 a7f73e84fa..638e048448 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,13 +12,17 @@ namespace CalamityMod.Items.Weapons.Summon public class FleshOfInfidelity : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 42; Item.height = 42; Item.damage = 20; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -33,18 +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) { - 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; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } 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/FuelCellBundle.cs b/Items/Weapons/Summon/FuelCellBundle.cs index 6e0f725d93..7fdcddc557 100644 --- a/Items/Weapons/Summon/FuelCellBundle.cs +++ b/Items/Weapons/Summon/FuelCellBundle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Summon public class FuelCellBundle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; 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 242608f0b0..7e7233f8cf 100644 --- a/Items/Weapons/Summon/GastricBelcherStaff.cs +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Summon public class GastricBelcherStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; @@ -24,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 1fb197c03a..86d6a3d058 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -1,6 +1,8 @@ -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; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -10,10 +12,32 @@ namespace CalamityMod.Items.Weapons.Summon { public class IgneousExaltation : ModItem, ILocalizedModType { + public static int ChargeDuration = 30; + public static int ChargeCooldown = 120; public new string LocalizationCategory => "Items.Weapons.Summon"; + private static Texture2D BladeOutline = null; + public static Texture2D GetBladeOutlineTex() + { + if (BladeOutline == null) + { + var texture = ModContent.Request("CalamityMod/Projectiles/Summon/IgneousBlade").Value; + BladeOutline = new Texture2D(Main.graphics.GraphicsDevice, texture.Width, texture.Height); + + var BaseArray = new Color[BladeOutline.Width * BladeOutline.Height]; + var ColorArray = new Color[BladeOutline.Width * BladeOutline.Height]; + texture.GetData(BaseArray); + for (var i = 0; i < BaseArray.Length; i++) + { + ColorArray[i] = new Color(255, 255, 255) * (((float)BaseArray[i].A) / 255f); + } + BladeOutline.SetData(ColorArray); + } + return BladeOutline; + } public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() @@ -30,58 +54,42 @@ 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) => 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) { - float totalMinionSlots = 0f; - foreach (Projectile pro in Main.ActiveProjectiles) + if (player.altFunctionUse == 2) { - if (pro.minion && pro.owner == player.whoAmI) + foreach (Projectile pro in Main.ActiveProjectiles) { - totalMinionSlots += pro.minionSlots; + if (pro.type == type && pro.owner == player.whoAmI && pro.ai[1] >= 0 && pro.ai[0] == 0) + { + pro.ModProjectile().CurrentState = IgneousBlade.AIState.TransitionToLaunch; + pro.netUpdate = true; + } } } - if (player.altFunctionUse != 2 && totalMinionSlots < player.maxMinions) + else { - 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; - int swordCount = 0; + 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) { if (pro.type == type && pro.owner == player.whoAmI) { - if ((pro.ModProjectile as IgneousBlade).Firing) - continue; - swordCount++; - for (int j = 0; j < 22; j++) - { - Dust dust = Dust.NewDustDirect(pro.position, pro.width, pro.height, DustID.Torch); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); - dust.noGravity = true; - } - } - } - float angleVariance = MathHelper.TwoPi / swordCount; - float angle = 0f; - foreach (Projectile pro in Main.ActiveProjectiles) - { - if (pro.type == type && pro.owner == player.whoAmI && pro.localAI[1] == 0f) - { - if ((pro.ModProjectile as IgneousBlade).Firing) - continue; - pro.ai[0] = angle; - angle += angleVariance; - for (int j = 0; j < 22; j++) - { - Dust dust = Dust.NewDustDirect(pro.position, pro.width, pro.height, DustID.Torch); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); - dust.noGravity = true; - } + pro.ModProjectile().BladeIndex = bladeIndex++; + pro.ModProjectile().AITimer = -ChargeCooldown; + pro.ModProjectile().CurrentState = IgneousBlade.AIState.CircleOwner; + pro.netUpdate = true; } } } @@ -91,6 +99,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). + AddIngredient(). AddIngredient(10). AddIngredient(5). AddTile(TileID.MythrilAnvil). diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index afde753a8f..7410951304 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -32,7 +34,11 @@ namespace CalamityMod.Items.Weapons.Summon public const float EnemyTargetingRange = 1300f; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { @@ -45,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; @@ -58,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 145cc7d099..5b577b75d8 100644 --- a/Items/Weapons/Summon/MutatedTruffle.cs +++ b/Items/Weapons/Summon/MutatedTruffle.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -29,7 +31,11 @@ namespace CalamityMod.Items.Weapons.Summon #endregion - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { @@ -37,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; @@ -49,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 e610e10089..338f86fb93 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.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; @@ -13,14 +14,19 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { 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. @@ -33,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 b1e933d4d3..d12ee0ac1e 100644 --- a/Items/Weapons/Summon/PuffShroom.cs +++ b/Items/Weapons/Summon/PuffShroom.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class PuffShroom : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; @@ -24,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/SlimePuppetStaff.cs b/Items/Weapons/Summon/SlimePuppetStaff.cs index 96f57f7c7c..aaae400ae7 100644 --- a/Items/Weapons/Summon/SlimePuppetStaff.cs +++ b/Items/Weapons/Summon/SlimePuppetStaff.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Summon CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index d9eb1fdafa..78b856a010 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class SpikecragStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 50; 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 bbd57dae6f..83e6d27796 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -1,4 +1,6 @@ using System.Linq; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,11 +14,15 @@ namespace CalamityMod.Items.Weapons.Summon public class StaffoftheMechworm : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { 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; @@ -26,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; } @@ -99,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 333bdf5ce4..48701eb7dc 100644 --- a/Items/Weapons/Summon/StarspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Summon public class StarspawnHelixStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 54; @@ -19,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; @@ -32,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 99845a7cb9..bd8f7d453a 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Summon public class Vigilance : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 32; @@ -22,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; @@ -32,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 332e3bc54d..e9263db742 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,7 +15,11 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { @@ -27,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(); } @@ -44,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 104e4933e0..724f7a5e09 100644 --- a/Items/Weapons/Summon/YharonsKindleStaff.cs +++ b/Items/Weapons/Summon/YharonsKindleStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -15,7 +17,11 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public const float ReboundRamDamageFactor = 2f; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { @@ -31,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 e04f4def90..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 @@ -891,7 +886,7 @@ SilvaRevival: { SpiritDefense: { DisplayName: Spirit Defense - Description: Defense increased by {0} and damage reduction increased by {1}% + Description: Defense increased by {0} } SpiritPower: { @@ -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 413fa82e21..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,12 +23,9 @@ 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 critcal strike chance" +SummonTagCrit: "{0}% summon tag critical strike chance" DodgeInformation: ''' Attacks that deal less than 5% of your max life in damage will not be dodged diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index f9e209883b..d99892c2dd 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -50,8 +50,8 @@ 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 HasWings: While wearing wings InAstral: In the Astral Infection @@ -60,10 +60,3 @@ InSulph: In the Sulphurous Sea InSunken: In the Sunken Sea InRev: In Revengeance Mode InRevOrMM: In Revengeance Mode or in Master Mode -AlcoholPoison: While inflicted with Alcohol Poisoning -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 f1558562c2..a86ca1bd36 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -7,7 +7,6 @@ CalamityClientConfig: { UI: UI Changes MeterPositions: Meter Positions MusicToggles: Music Toggles - Multithreading: Multi-Threading } AbyssLayer3Alt: { @@ -51,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: @@ -254,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. @@ -389,21 +394,6 @@ CalamityClientConfig: { Label: "[i:Book] Wiki Status Message" Tooltip: Enable or disable the status message promoting the Official Calamity Wiki that plays on world entry. } - - MultiThreadingType: { - Label: Sunken Sea Multi-Threading Option - Tooltip: - ''' - Option 0 will disable worldgen multi-threading. - Option 1 will enable ReLogic's multi-threading. - Option 2 will enable custom multi-threading. - ''' - } - - SunkenSeaMultiThreading: { - Label: Sunken Sea Multi Threading - Tooltip: "" - } } CalamityServerConfig: { @@ -567,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 94978834e8..3f47c9dff9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -65,7 +65,7 @@ AeroStone: { Affliction: { DisplayName: Affliction - Tooltip: Gives all teammates +0.5 HP/s life regen, +10% max life, 7% damage reduction, 13 defense and 10% increased damage + Tooltip: Gives all teammates +0.5 HP/s life regen, +10% max life, 7% damage reduction, 9 defense and 10% increased damage } AlchemicalFlask: { @@ -105,7 +105,7 @@ AmbrosialAmpoule: { Tooltip: ''' +50 max life - Grants +2 to +6 HP/s life regen based on missing health + Grants +2 to +5 HP/s life regen based on missing health Standing still grants +1.5 HP/s life regen and +1 HP/s life regen when inflicted with a damage debuff Current boost: +[REGEN] HP/s Fire and sickness debuff durations are halved @@ -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 ''' } @@ -493,7 +496,6 @@ CrownJewel: { ''' +1 HP/s life regen You gain an additional +1.5 HP/s life regen while afflicted with any debuff - Massively boosts natural life regen while afflicted with any debuff ''' } @@ -554,8 +556,8 @@ DarkSunRing: { HoldShiftTooltip: ''' During the day, grants +2 HP/s life regen - During the night, grants +20 defense - During an eclipse, grants +1 HP/s life regen and +10 defense + During the night, grants +16 defense + During an eclipse, grants +1 HP/s life regen and +8 defense ''' FlavorTooltip: "'Contains the power of the dark sun'" } @@ -599,6 +601,22 @@ DepthCharm: { ''' } +DiamondOfTheDeep: { + DisplayName: Diamond of the Deep + Tooltip: + ''' + Multiplies all water debuff damage by 1.6x + Slowly accrue up to three different abyssal spirits + Dash to disperse the spirits and have them attack enemies + When dispersed [c/CB7AD7:below 50% life], the spirits support you instead + The spirits appear in order and have different effects based on color: + [c/3CB371: Explodes on impact and inflicts Crush Depth] / [c/CB7AD7:Heals for 8 HP] + [c/FF4500: Pierces enemies and inflicts Hellfire] / [c/CB7AD7:Increases defense by 10 temporarily] + [c/1E90FF: Hits multiple times and inflicts Hadopelagic Pressure] / [c/CB7AD7:Heals 5% of max HP] + Spirits are transparent and silent when visibility is toggled off + ''' +} + DimensionalSoulArtifact: { DisplayName: Dimensional Soul Artifact Tooltip: @@ -704,6 +722,11 @@ ElementalGauntlet: { ''' } +ElementalinaBottle: { + DisplayName: Elemental in a Bottle + Tooltip: Summons a sand elemental to fight for you +} + ElysianAegis: { DisplayName: Elysian Aegis Tooltip: @@ -817,7 +840,7 @@ FrostFlare: { All attacks and projectiles inflict Frostbite Grants immunity to Frostburn, Chilled and Frozen Being above 50% life grants 10% increased damage - Being below 50% life grants 20 defense and 15% increased max movement speed and acceleration + Being below 50% life grants 15 defense and 15% increased max movement speed and acceleration Grants resistance against cold attacks ''' } @@ -836,7 +859,7 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, granting 8 defense and +1 HP/s life regen + Consuming mushrooms provides the Mushy buff, granting 5 defense and +1 HP/s life regen 10% increased damage while you have the Mushy buff ''' } @@ -919,7 +942,7 @@ HallowedRune: { HoldShiftTooltip: ''' [c/8ce0ff: Hallowed Power] [c/ccf1ff: grants 10% increased summon damage and rains stars on enemies] - [c/d08aff: Hallowed Defense] [c/eed4ff: grants 8 defense and 4% damage reduction] + [c/d08aff: Hallowed Defense] [c/eed4ff: grants 4 defense and 4% damage reduction] [c/ff8cb5: Hallowed Regen] [c/ffccde: grants +1.5 HP/s life regen] ''' } @@ -959,7 +982,7 @@ HoneyDew: { DisplayName: Honey Dew Tooltip: ''' - +30 max life + +10 max life Grants +1 HP/s life regen, and +1 HP/s life regen when inflicted with a damaging debuff Standing still in Honey grants +1.5 HP/s life regen Sickness debuff durations are halved @@ -990,10 +1013,9 @@ InfectedJewel: { Tooltip: ''' Passively grants +1 HP/s life regen - Grants 16 defense and +2 HP/s life regen while afflicted with any debuff - Massively boosts natural life regen while afflicted with any debuff + Grants 12 defense and +2 HP/s life regen while afflicted with any debuff Granted defense fades away quickly when not afflicted with any debuffs - Each debuff beyond the first grants 5 additional defense + Each debuff beyond the first grants 4 additional defense Nullifies the Astral Infection debuff 'A beautiful gemstone tarnished by spaceborne rot' ''' @@ -1003,7 +1025,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 @@ -1082,29 +1103,13 @@ LivingDew: { DisplayName: Living Dew Tooltip: ''' - +50 max life + +25 max life Grants +1 HP/s life regen and an additional 1 HP/s life regen when inflicted with a damaging debuff Standing still in Honey grants +1.5 HP/s life regen Fire and sickness debuff durations are halved ''' } -DiamondOfTheDeep: { - DisplayName: Diamond of the Deep - Tooltip: - ''' - Multiplies all water debuff damage by 1.75x - Slowly accrue up to three different abyssal spirits - Dash to disperse the spirits and have them attack enemies - When dispersed [c/CB7AD7:below 50% life], the spirits support you instead - The spirits appear in order and have different effects based on color: - [c/3CB371: Explodes on impact and inflicts Crush Depth] / [c/CB7AD7:Heals for 8 HP] - [c/FF4500: Pierces enemies and inflicts Hellfire] / [c/CB7AD7:Increases defense by 15 temporarily] - [c/1E90FF: Hits multiple times and inflicts Hadopelagic Pressure] / [c/CB7AD7:Heals 5% of max HP] - Spirits are transparent and silent when visibility is toggled off - ''' -} - LuxorsGift: { DisplayName: Luxor's Gift Tooltip: @@ -1391,7 +1396,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'] ''' @@ -1421,12 +1426,12 @@ Radiance: { ''' HoldShiftTooltip: ''' - [c/CDF69C:Grants +2 to +6 HP/s life regen based on missing health] + [c/CDF69C:Grants +2 to +5 HP/s life regen based on missing health] [c/CDF69C:Recover an additional 6 HP/s while inflicted with a debuff] [c/CDF69C:This eventually slows to 1.33 HP/s when debuffed for an extended time period] [c/CDF69C:Standing still provides +2 HP/s life regen and faster natural regen recovery] - [c/CDF69C:+20 defense and faster natural regen recovery while afflicted with any debuff] - [c/CDF69C:Each additional debuff grants 8 defense, which slowly decays while not debuffed] + [c/CDF69C:Grants 15 defense while afflicted with any debuff] + [c/CDF69C:Each additional debuff grants 5 defense, which slowly decays while not debuffed] [c/CDF69C:Weak damaging debuffs are harmless and halves the duration of most other debuffs] ''' } @@ -1435,7 +1440,7 @@ RadiantOoze: { DisplayName: Radiant Ooze Tooltip: ''' - Grants +2 to +6 HP/s life regen based on missing health + Grants +2 to +5 HP/s life regen based on missing health Current boost: +[REGEN] HP/s You emit yellow light if visibility is enabled ''' @@ -1455,11 +1460,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: @@ -1474,9 +1488,9 @@ Regenerator: { DisplayName: Regenerator Tooltip: ''' - Your health cannot exceed 50% of its maximum + Your health cannot exceed {0}% of its maximum Increases length of invincibility after taking damage - Provides powerful special life regen to heal you for 8.5 HP/s + Provides powerful special life regen to heal you for {1} HP/s All normal life regen is negated and converted into damage Current damage boost: [DAMAGE]% ''' @@ -1511,9 +1525,9 @@ RoverDrive: { DisplayName: Rover Drive Tooltip: ''' - Gain a barrier with 20 health, which grants 10 defense while active + Gain a barrier with {0} health [ADREN] - If depleted, the barrier's health regenerates after not receiving damage for 10 seconds + The barrier will regenerate {1} seconds after being hit, taking {2} seconds to completely regenerate Getting hit resets the timer Can also be scrapped at an extractinator ''' @@ -1535,7 +1549,7 @@ SandCloak: { ''' Dashing creates a large protective sand veil which damages enemies inside it The sand veil lasts 15 seconds, but dissipates early if you dash again - The veil slowly follows you, and any player inside it gains 10 defense and 1.75x acceleration + The veil slowly follows you, and any player inside it gains 4 defense and 1.75x acceleration After dissipating, the sand veil has a 15 second cooldown before it can be used again ''' } @@ -1688,7 +1702,7 @@ SpiritGlyph: { HoldShiftTooltip: ''' [c/8ce0ff: Spirit Power] [c/ccf1ff:grants 10% increased summon damage] - [c/d08aff: Spirit Defense] [c/eed4ff:grants 6 defense and 3% damage reduction] + [c/d08aff: Spirit Defense] [c/eed4ff:grants 4 defense] [c/ff8cb5: Spirit Regen] [c/ffccde:grants +1 HP/s life regeneration] ''' } @@ -1737,11 +1751,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 +1763,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}" } @@ -1957,10 +1969,10 @@ TheSponge: { Tooltip: ''' Grants immunity to knockback - Gain a barrier with 180 health - The barrier grants 20 defense and 10% damage reduction while active + Gain a barrier with {0} health + The barrier grants {1}% damage reduction while active [ADREN] - The barrier will regenerate 8 seconds after being hit, taking 10 seconds to completely regenerate + The barrier will regenerate {2} seconds after being hit, taking {3} seconds to completely regenerate Getting hit resets the timer ''' ShieldAdren: Halved Adrenaline loss if all damage is absorbed @@ -2085,20 +2097,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 3c36a9195c..48fe6a2888 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 and +20 max life + {$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,9 +152,8 @@ FathomSwarmerBreastplate: { DisplayName: Fathom Swarmer Breastplate Tooltip: ''' - 6% increased damage reduction - Increases your max number of minions by 1 - 10% increased summon damage + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Reduces defense loss within the Abyss ''' } @@ -171,29 +162,30 @@ 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 ''' } @@ -202,12 +194,12 @@ HydrothermicArmor: { DisplayName: Hydrothermic Armor Tooltip: ''' - +20 max life - 8% increased damage and 4% increased critical strike chance + {$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 ''' } @@ -216,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 ''' } @@ -246,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 ''' } @@ -277,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 ''' } @@ -291,8 +271,8 @@ HydrothermicSubligar: { DisplayName: Hydrothermic Subligar Tooltip: ''' - 5% increased critical strike chance - 10% increased movement speed + {$CommonItemTooltip.PercentIncreasedCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -300,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 ''' } @@ -310,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 ''' } @@ -350,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 ''' } @@ -365,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 ''' } @@ -374,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 ''' } @@ -384,8 +356,9 @@ 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 ''' } @@ -393,27 +366,31 @@ PlaguebringerVisor: { DisplayName: Plaguebringer Visor Tooltip: ''' - 15% increased summon damage - +20 max life + {$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 - 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. + {0}% increased flight time + Enemies afflicted by the Plague take {1}x damage from ranged projectiles + [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}] ''' } @@ -421,8 +398,8 @@ PlagueReaperStriders: { DisplayName: Plague Reaper Striders Tooltip: ''' - 3% increased ranged critical strike chance - 15% increased movement speed + {$CommonItemTooltip.PercentIncreasedRangedCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -430,100 +407,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 - +20 max life - ''' + 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} ''' } @@ -531,17 +493,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 ''' @@ -549,5 +511,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 0b3e63d665..fd76047f68 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -176,7 +176,7 @@ BloodflareBodyArmor: { Tooltip: ''' 12% increased damage and 8% increased critical strike chance - +40 max life + +25 max life ''' CommonSetBonus: ''' @@ -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 ''' @@ -274,7 +274,7 @@ DemonshadeBreastplate: { ''' 25% increased melee speed, 15% increased damage and critical strike chance Enemies take ungodly damage when they touch you - Increased max life and mana by 200 + Increased max life by 50 and max mana by 200 Standing still absorbs shadows to grant exponentially accelerating life regen ''' } @@ -292,27 +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 - +20 max life - 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} ''' } @@ -320,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 ''' @@ -346,8 +340,6 @@ FearmongerGreathelm: { Minions no longer deal less damage while wielding non-summoner weapons Immunity to all but the strongest forms of frost and flame Minion attacks grant +3.5 HP/s life regen and massively accelerate life regen - 15% increased damage reduction during the Pumpkin and Frost Moons - This extra damage reduction ignores the soft cap ''' } @@ -417,7 +409,7 @@ GodSlayerChestplate: { DisplayName: God Slayer Chestplate Tooltip: ''' - +60 max life + +50 max life Enemies take damage when they hit you 11% increased damage and 8% increased critical strike chance ''' @@ -506,7 +498,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 @@ -545,7 +537,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 ''' } @@ -556,7 +548,7 @@ PrismaticRegalia: { ''' 12% increased magic damage and 15% increased magic crit 20% decreased non-magic damage - +20 max life and +40 max mana + +40 max mana Magic attacks occasionally fire a pair of homing rockets ''' } @@ -565,7 +557,7 @@ SilvaArmor: { DisplayName: Silva Armor Tooltip: ''' - +80 max life + +50 max life 11% increased damage and 8% increased critical strike chance ''' CommonSetBonus: @@ -649,7 +641,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 10ff9b2c7a..ca300913fa 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -1,151 +1,154 @@ AerospecBreastplate: { DisplayName: Aerospec Breastplate - Tooltip: 3% increased damage and critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamageCritChance}" CommonSetBonus: ''' - Taking over 25 damage in one hit will cause a spread of homing feathers to fall + Taking over {0} damage in one hit will cause a spread of homing feathers to fall Allows you to fall more quickly and disables fall damage ''' } AerospecHeadMagic: { DisplayName: Aerospec Hat - Tooltip: 10% increased magic damage and +30 max mana + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxManaBy} + {$CommonItemTooltip.PercentIncreasedMagicDamage@1} + ''' SetBonus: ''' - 8% reduced mana cost - 5% increased movement speed and magic critical strike chance + {$CommonItemTooltip.PercentReducedManaCost} + {1}% increased movement speed and magic critical strike chance ''' } AerospecHeadRogue: { DisplayName: Aerospec Headgear - Tooltip: 10% increased rogue damage and 5% increased movement speed + Tooltip: "{$Common.RogueDamage} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@1}" SetBonus: ''' - 5% increased movement speed and rogue critical strike chance - +80 maximum stealth + {$Common.RogueStealth} + {1}% increased movement speed and rogue critical strike chance ''' } AerospecHeadMelee: { DisplayName: Aerospec Helm - Tooltip: 10% increased melee damage + Tooltip: "{$CommonItemTooltip.PercentIncreasedMeleeDamage}" SetBonus: ''' - 5% increased movement speed and melee critical strike chance - Enemies are more likely to target you + {0}% increased movement speed and melee critical strike chance + {$Common.AggroBoost} ''' } AerospecHeadSummon: { DisplayName: Aerospec Helmet - Tooltip: 10% increased summon damage and 5% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedSummonDamage} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@1}" SetBonus: ''' - 11% increased summon damage and +1 max minion + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a valkyrie to protect you ''' } AerospecHeadRanged: { DisplayName: Aerospec Hood - Tooltip: 10% increased ranged damage - SetBonus: 5% increased movement speed and ranged critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage}" + SetBonus: "{0}% increased movement speed and ranged critical strike chance" } AerospecLeggings: { DisplayName: Aerospec Leggings - Tooltip: 12% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed}" } DesertProwlerHat: { DisplayName: Desert Prowler Hat - Tooltip: 4% increased rogue critical strike chance + Tooltip: "{$Common.RogueCrit}" SetBonus: ''' - 5% increased rogue damage - +50 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: 10% increased movement speed and immunity to the Mighty Wind debuff + Tooltip: + ''' + {$Common.RogueCrit} + Grants immunity to {$BuffName.WindPushed} + ''' } DesertProwlerShirt: { DisplayName: Desert Prowler Shirt - Tooltip: 5% increased rogue critical strike chance + Tooltip: "{$Common.RogueDamage}" } MarniteArchitectHeadgear: { DisplayName: Marnite Architect Headgear - Tooltip: Increases block placement & tool range by 5 - AbilityBrief: Marnite Lift - You can summon a lift under your feet to reach higher up - AbilityDescription: + Tooltip: Increases block placement & tool range by {0} + 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] ''' } MarniteArchitectToga: { DisplayName: Marnite Architect Toga - Tooltip: Increases block & wall placement speed by 50% + Tooltip: Increases block & wall placement speed by {0}% } SnowRuffianChestplate: { DisplayName: Snow Ruffian Chestplate - Tooltip: 4% increased ranged critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianGreaves: { DisplayName: Snow Ruffian Greaves - Tooltip: 10% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianMask: { DisplayName: Snow Ruffian Mask - Tooltip: 2% increased ranged damage + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" SetBonus: ''' - 4% 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: 5% increased critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedCritChance}" CommonSetBonus: ''' - When you take over 100 damage in one hit you become immune to damage for an extended period of time Grants an extra jump and increased jump height - 12% increased jump speed + {0}% increased jump speed ''' } StatigelGreaves: { DisplayName: Statigel Greaves - Tooltip: 5% increased damage and movement speed + Tooltip: "{0}% increased damage and movement speed" } StatigelHeadMagic: { DisplayName: Statigel Cap Tooltip: ''' - 10% increased magic damage and 10% reduced mana cost - 7% increased magic critical strike chance and +40 max mana + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' } @@ -153,18 +156,18 @@ StatigelHeadMelee: { DisplayName: Statigel Helm Tooltip: ''' - 10% increased melee damage and melee speed - 7% increased melee critical strike chance + {0}% increased melee damage and melee speed + {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} ''' - SetBonus: Enemies are more likely to target you + SetBonus: "{$Common.AggroBoost}" } StatigelHeadRanged: { DisplayName: Statigel Headgear Tooltip: ''' - 10% increased ranged damage - 7% increased ranged critical strike chance + {$CommonItemTooltip.PercentIncreasedRangedDamage} + {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} ''' } @@ -172,117 +175,108 @@ StatigelHeadRogue: { DisplayName: Statigel Mask Tooltip: ''' - 10% increased rogue damage - 7% increased rogue critical strike chance and 5% increased movement speed + {$Common.RogueDamage} + {$Common.RogueCrit@1} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' - SetBonus: +90 maximum stealth + SetBonus: "{$Common.RogueStealth}" } StatigelHeadSummon: { DisplayName: Statigel Hood - Tooltip: Increased minion knockback + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' - 18% increased summon damage and +1 max minion + {$CommonItemTooltip.PercentIncreasedSummonDamage} Summons a mini paladin to fight for you, the type depends on what world evil you have ''' } SulphurousBreastplate: { DisplayName: Sulphurous Breastplate - Tooltip: 6% increased rogue damage and 4% increased rogue critical strike chance + Tooltip: "{$Common.RogueDamage}" } SulphurousHelmet: { DisplayName: Sulphurous Helmet Tooltip: ''' - 4% increased rogue damage - 2% increased rogue critical strike chance + {$Common.RogueCrit} Grants underwater breathing ''' SetBonus: ''' - +65 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 10% - Movement speed increased an additional 25% 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 +294,24 @@ WulfrumHat: { DisplayName: Wulfrum Hat & Goggles Tooltip: ''' - 10% increased summon damage + {$CommonItemTooltip.PercentIncreasedSummonDamage} Comes equipped with hair extensions ''' - SetBonus: +1 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: 5% increased damage reduction + Tooltip: "{$CommonItemTooltip.IncreasesMaxMinionsBy}" } WulfrumOveralls: { DisplayName: Wulfrum Overalls - Tooltip: Movement speed increased by 5% + 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.Dyes.hjson b/Localization/en-US/Mods.CalamityMod.Items.Dyes.hjson index 5ccba37d5d..9b45147d45 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Dyes.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Dyes.hjson @@ -123,6 +123,11 @@ WingTimeHairDye: { Tooltip: "" } +InvisibleDye: { + DisplayName: Invisible Dye + Tooltip: "" +} + LivingShardDye: { DisplayName: Living Shard Dye Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson index 5856fdccf4..020e9628dd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson @@ -53,11 +53,6 @@ BloodOrb: { Tooltip: "" } -BloodSample: { - DisplayName: Blood Sample - Tooltip: "" -} - Bloodstone: { DisplayName: Bloodstone Tooltip: "" @@ -247,11 +242,6 @@ ReaperTooth: { Tooltip: Sharp enough to cut diamonds } -RottenMatter: { - DisplayName: Rotten Matter - Tooltip: "" -} - RuinousSoul: { DisplayName: Ruinous Soul Tooltip: A shard of the distant past diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index c62fea1db5..c70ba5a81b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -82,6 +82,7 @@ PlaguebringerBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" PlagueChargerBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" PlagueshellBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" PrismBackBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" +ProbesnoutBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ProfanedEnergyBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" RadiatorBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ReaperSharkBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" @@ -96,6 +97,7 @@ ScryllarBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SeaFloatyBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SeaMinnowBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SeaSerpentBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" +SharkoonBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ShockstormShuttleBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ShroombleBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SightseerColliderBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" @@ -704,21 +706,11 @@ AltarOfTheAccursedItem: { ''' } -AncientAltar: { - DisplayName: Ancient Altar - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - AshenAltar: { DisplayName: Ashen Altar Tooltip: "{$CommonItemTooltip.SpecialCrafting}" } -BotanicPlanter: { - DisplayName: Botanic Planter - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - CosmicAnvilItem: { DisplayName: Cosmic Anvil Tooltip: @@ -737,21 +729,6 @@ DraedonsForge: { ''' } -EffulgentManipulator: { - DisplayName: Effulgent Manipulator - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - -EutrophicShelf: { - DisplayName: Eutrophic Shelf - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - -MonolithAmalgam: { - DisplayName: Monolith Amalgam - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - PlagueInfuser: { DisplayName: Plague Infuser Tooltip: "{$CommonItemTooltip.SpecialCrafting}" @@ -762,21 +739,11 @@ ProfanedCrucible: { Tooltip: "{$CommonItemTooltip.SpecialCrafting}" } -StaticRefiner: { - DisplayName: Static Refiner - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - VoidCondenser: { DisplayName: Void Condenser Tooltip: "{$CommonItemTooltip.SpecialCrafting}" } -WulfrumLabstationItem: { - DisplayName: Wulfrum Labstation - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - CrimsonEffigy: { DisplayName: Crimson Effigy Tooltip: @@ -892,6 +859,11 @@ KelpTorch: { Tooltip: Can be placed in water } +OldDukeMonolith: { + DisplayName: Elden Diorama + Tooltip: "" +} + OtonilouStatue: { DisplayName: Otonilou Memorial Tooltip: "" @@ -1419,6 +1391,11 @@ AcidwoodWorkBench: { Tooltip: "" } +AncientAltar: { + DisplayName: Ancient Altar + Tooltip: "" +} + AncientBasin: { DisplayName: Ancient Basin Tooltip: "" @@ -1758,6 +1735,11 @@ BotanicPiano: { Tooltip: "" } +BotanicPlanter: { + DisplayName: Botanic Planter + Tooltip: "" +} + BotanicPlatform: { DisplayName: Botanic Platform Tooltip: "" @@ -1888,103 +1870,308 @@ CosmiliteWorkBench: { Tooltip: "" } +DriftwoodBaroqueCello: { + DisplayName: Driftwood Baroque Cello + Tooltip: "" +} + +DriftwoodBathtub: { + DisplayName: Driftwood Bathtub + Tooltip: "" +} + +DriftwoodBed: { + DisplayName: Driftwood Bed + Tooltip: "" +} + +DriftwoodBookcase: { + DisplayName: Driftwood Bookcase + Tooltip: "" +} + +DriftwoodCandelabra: { + DisplayName: Driftwood Candelabra + Tooltip: "" +} + +DriftwoodCandle: { + DisplayName: Driftwood Candle + Tooltip: "" +} + +DriftwoodChair: { + DisplayName: Driftwood Chair + Tooltip: "" +} + +DriftwoodChandelier: { + DisplayName: Driftwood Chandelier + Tooltip: "" +} + +DriftwoodChest: { + DisplayName: Driftwood Chest + Tooltip: "" +} + +DriftwoodDoor: { + DisplayName: Driftwood Door + Tooltip: "" +} + +DriftwoodDresser: { + DisplayName: Driftwood Dresser + Tooltip: "" +} + +DriftwoodLamp: { + DisplayName: Driftwood Lamp + Tooltip: "" +} + +DriftwoodLantern: { + DisplayName: Driftwood Lantern + Tooltip: "" +} + +DriftwoodPlatform: { + DisplayName: Driftwood Platform + Tooltip: "" +} + +DriftwoodSink: { + DisplayName: Driftwood Sink + Tooltip: Counts as a water source +} + +DriftwoodSofa: { + DisplayName: Driftwood Sofa + Tooltip: "" +} + +DriftwoodSundial: { + DisplayName: Driftwood Sundial + Tooltip: "" +} + +DriftwoodTable: { + DisplayName: Driftwood Table + Tooltip: "" +} + +DriftwoodToilet: { + DisplayName: Driftwood Toilet + Tooltip: "" +} + +DriftwoodWorkBench: { + DisplayName: Driftwood Work Bench + Tooltip: "" +} + +AncientNavystoneBathtub: { + DisplayName: Ancient Navystone Bathtub + Tooltip: "" +} + +AncientNavystoneBed: { + DisplayName: Ancient Navystone Bed + Tooltip: "" +} + +AncientNavystoneBench: { + DisplayName: Ancient Navystone Bench + Tooltip: "" +} + +AncientNavystoneBookcase: { + DisplayName: Ancient Navystone Bookcase + Tooltip: "" +} + +AncientNavystoneCandelabra: { + DisplayName: Ancient Navystone Candelabra + Tooltip: "" +} + +AncientNavystoneCandle: { + DisplayName: Ancient Navystone Candle + Tooltip: "" +} + +AncientNavystoneChair: { + DisplayName: Ancient Navystone Chair + Tooltip: "" +} + +AncientNavystoneChandelier: { + DisplayName: Ancient Navystone Chandelier + Tooltip: "" +} + +AncientNavystoneChest: { + DisplayName: Ancient Navystone Chest + Tooltip: "" +} + +AncientNavystoneClock: { + DisplayName: Ancient Navystone Clock + Tooltip: "" +} + +AncientNavystoneDoor: { + DisplayName: Ancient Navystone Door + Tooltip: "" +} + +AncientNavystoneDresser: { + DisplayName: Ancient Navystone Dresser + Tooltip: "" +} + +AncientNavystoneLamp: { + DisplayName: Ancient Navystone Lamp + Tooltip: "" +} + +AncientNavystoneLantern: { + DisplayName: Ancient Navystone Lantern + Tooltip: "" +} + +AncientNavystonePiano: { + DisplayName: Ancient Navystone Piano + Tooltip: "" +} + +AncientNavystonePlatform: { + DisplayName: Ancient Navystone Platform + Tooltip: "" +} + +AncientNavystoneSink: { + DisplayName: Ancient Navystone Sink + Tooltip: Counts as a water source +} + +AncientNavystoneTable: { + DisplayName: Ancient Navystone Table + Tooltip: "" +} + +AncientNavystoneWorkBench: { + DisplayName: Ancient Navystone Work Bench + Tooltip: "" +} + AncientSmoothNavystone: { DisplayName: Ancient Smooth Navystone Tooltip: "" } -EutrophicBathtub: { - DisplayName: Eutrophic Bathtub +EutrophicShelf: { + DisplayName: Eutrophic Shelf Tooltip: "" } -EutrophicBed: { - DisplayName: Eutrophic Bed +NavystoneBathtub: { + DisplayName: Navystone Bathtub Tooltip: "" } -EutrophicBench: { - DisplayName: Eutrophic Bench +NavystoneBed: { + DisplayName: Navystone Bed Tooltip: "" } -EutrophicBookcase: { - DisplayName: Eutrophic Bookcase +NavystoneBookcase: { + DisplayName: Navystone Bookcase Tooltip: "" } -EutrophicCandelabra: { - DisplayName: Eutrophic Candelabra +NavystoneCandelabra: { + DisplayName: Navystone Candelabra Tooltip: "" } -EutrophicCandle: { - DisplayName: Eutrophic Candle +NavystoneCandle: { + DisplayName: Navystone Candle Tooltip: "" } -EutrophicChair: { - DisplayName: Eutrophic Chair +NavystoneChair: { + DisplayName: Navystone Chair Tooltip: "" } -EutrophicChandelier: { - DisplayName: Eutrophic Chandelier +NavystoneChandelier: { + DisplayName: Navystone Chandelier Tooltip: "" } -EutrophicChest: { - DisplayName: Eutrophic Chest +NavystoneChest: { + DisplayName: Navystone Chest Tooltip: "" } -EutrophicClock: { - DisplayName: Eutrophic Clock +NavystoneClock: { + DisplayName: Navystone Clock Tooltip: "" } -EutrophicDoor: { - DisplayName: Eutrophic Door +NavystoneDoor: { + DisplayName: Navystone Door Tooltip: "" } -EutrophicDresser: { - DisplayName: Eutrophic Dresser +NavystoneDresser: { + DisplayName: Navystone Dresser Tooltip: "" } -EutrophicLamp: { - DisplayName: Eutrophic Lamp +NavystoneLamp: { + DisplayName: Navystone Lamp Tooltip: "" } -EutrophicLantern: { - DisplayName: Eutrophic Lantern +NavystoneLantern: { + DisplayName: Navystone Lantern Tooltip: "" } -EutrophicPiano: { - DisplayName: Eutrophic Piano +NavystoneLyre: { + DisplayName: Navystone Lyre Tooltip: "" } -EutrophicPlatform: { - DisplayName: Eutrophic Platform +NavystonePlatform: { + DisplayName: Navystone Platform Tooltip: "" } -EutrophicSink: { - DisplayName: Eutrophic Sink +NavystoneSink: { + DisplayName: Navystone Sink Tooltip: Counts as a water source } -EutrophicTable: { - DisplayName: Eutrophic Table +NavystoneTable: { + DisplayName: Navystone Table Tooltip: "" } -EutrophicWorkBench: { - DisplayName: Eutrophic Work Bench +NavystoneToilet: { + DisplayName: Navystone Toilet + Tooltip: "" +} + +NavystoneTriclinium: { + DisplayName: Navystone Triclinium + Tooltip: "" +} + +NavystoneWorkBench: { + DisplayName: Navystone Work Bench Tooltip: "" } @@ -2248,6 +2435,11 @@ PolishedMarniteWall: { Tooltip: "" } +MonolithAmalgam: { + DisplayName: Monolith Amalgam + Tooltip: "" +} + MonolithBathtub: { DisplayName: Monolith Bathtub Tooltip: "" @@ -2792,6 +2984,11 @@ SacrilegiousWorkBench: { Tooltip: "" } +SilvaBasin: { + DisplayName: Silva Basin + Tooltip: "" +} + SilvaBathtub: { DisplayName: Silva Bathtub Tooltip: "" @@ -2892,6 +3089,11 @@ SilvaWorkBench: { Tooltip: "" } +StaticRefiner: { + DisplayName: Static Refiner + Tooltip: "" +} + StatigelBathtub: { DisplayName: Statigel Bathtub Tooltip: "" @@ -3202,6 +3404,16 @@ VoidWorkBench: { Tooltip: "" } +ChargedWulfrumEnergyBarrier: { + DisplayName: Charged Wulfrum Energy Barrier + Tooltip: "" +} + +ChargedWulfrumWallMountedBulb: { + DisplayName: Charged Wulfrum Wall Mounted Bulb + Tooltip: "" +} + WulfrumBathtub: { DisplayName: Wulfrum Bathtub Tooltip: "" @@ -3247,6 +3459,16 @@ WulfrumDresser: { Tooltip: "" } +WulfrumEnergyBarrier: { + DisplayName: Wulfrum Energy Barrier + Tooltip: "" +} + +WulfrumLabstationItem: { + DisplayName: Wulfrum Labstation + Tooltip: "" +} + WulfrumLamp: { DisplayName: Wulfrum Lamp Tooltip: "" @@ -3257,19 +3479,39 @@ WulfrumLantern: { Tooltip: "" } +WulfrumPanels: { + DisplayName: Wulfrum Panels + Tooltip: "" +} + WulfrumPiano: { DisplayName: Wulfrum Piano Tooltip: "" } +WulfrumPlatform: { + DisplayName: Wulfrum Platform + Tooltip: "" +} + WulfrumPlating: { DisplayName: Wulfrum Plating Tooltip: "" } +WulfrumSheets: { + DisplayName: Wulfrum Sheets + Tooltip: "" +} + +WulfrumSiding: { + DisplayName: Wulfrum Siding + Tooltip: "" +} + WulfrumSink: { DisplayName: Wulfrum Sink - Tooltip: "" + Tooltip: Counts as a water source } WulfrumSofa: { @@ -3287,11 +3529,121 @@ WulfrumToilet: { Tooltip: "" } +WulfrumWallMountedBulb: { + DisplayName: Wulfrum Wall Mounted Bulb + Tooltip: "" +} + WulfrumWorkBench: { DisplayName: Wulfrum Work Bench Tooltip: "" } +AnodizedWulfrumBathtub: { + DisplayName: Anodized Wulfrum Bathtub + Tooltip: "" +} + +AnodizedWulfrumBookcase: { + DisplayName: Anodized Wulfrum Bookcase + Tooltip: "" +} + +AnodizedWulfrumChair: { + DisplayName: Anodized Wulfrum Chair + Tooltip: "" +} + +AnodizedWulfrumChandelier: { + DisplayName: Anodized Wulfrum Chandelier + Tooltip: "" +} + +AnodizedWulfrumChest: { + DisplayName: Anodized Wulfrum Chest + Tooltip: "" +} + +AnodizedWulfrumDeskLight: { + DisplayName: Anodized Wulfrum Desk Light + Tooltip: "" +} + +AnodizedWulfrumDoor: { + DisplayName: Anodized Wulfrum Door + Tooltip: "" +} + +AnodizedWulfrumDresser: { + DisplayName: Anodized Wulfrum Dresser + Tooltip: "" +} + +AnodizedWulfrumJukebox: { + DisplayName: Anodized Wulfrum Jukebox + Tooltip: "" +} + +AnodizedWulfrumLamp: { + DisplayName: Anodized Wulfrum Lamp + Tooltip: "" +} + +AnodizedWulfrumLantern: { + DisplayName: Anodized Wulfrum Lantern + Tooltip: "" +} + +AnodizedWulfrumPanels: { + DisplayName: Anodized Wulfrum Panels + Tooltip: "" +} + +AnodizedWulfrumPlatform: { + DisplayName: Anodized Wulfrum Platform + Tooltip: "" +} + +AnodizedWulfrumSink: { + DisplayName: Anodized Wulfrum Sink + Tooltip: Counts as a water source +} + +AnodizedWulfrumSleepingPod: { + DisplayName: Anodized Wulfrum Sleeping Pod + Tooltip: "" +} + +AnodizedWulfrumSofa: { + DisplayName: Anodized Wulfrum Sofa + Tooltip: "" +} + +AnodizedWulfrumTable: { + DisplayName: Anodized Wulfrum Table + Tooltip: "" +} + +AnodizedWulfrumTrim: { + DisplayName: Anodized Wulfrum Trim + Tooltip: "" +} + +AnodizedWulfrumToilet: { + DisplayName: Anodized Wulfrum Toilet + Tooltip: "" +} + +AnodizedWulfrumWorkBench: { + DisplayName: Anodized Wulfrum Work Bench + Tooltip: "" +} + +RoundedAnodizedWulfrumPanels: { + DisplayName: Rounded Anodized Wulfrum Panels + Tooltip: "" +} + HardenedAstralSand: { DisplayName: Hardened Astral Sand Tooltip: "" @@ -3511,6 +3863,11 @@ Driftwood: { Tooltip: "" } +Dunesand: { + DisplayName: Dunesand + Tooltip: "" +} + Navystone: { DisplayName: Navystone Tooltip: "" @@ -3598,6 +3955,11 @@ VolcanicSand: { // End of Sunken Sea +Dreadstone: { + DisplayName: Dreadstone + Tooltip: "" +} + UelibloomBrick: { DisplayName: Uelibloom Brick Tooltip: "" @@ -3628,6 +3990,11 @@ AerialiteBrickWall: { Tooltip: "" } +AncientSmoothNavystoneWall: { + DisplayName: Ancient Smooth Navystone Wall + Tooltip: "" +} + AshenSlabWall: { DisplayName: Ashen Slab Wall Tooltip: "" @@ -3747,6 +4114,16 @@ RustedPlatingWall: { // End of Draedon +AnodizedWulfrumTrimWall: { + DisplayName: Anodized Wulfrum Trim Wall + Tooltip: "" +} + +ChargedWulfrumEnergyBarrierWall: { + DisplayName: Charged Wulfrum Energy Barrier Wall + Tooltip: "" +} + DriftwoodWall: { DisplayName: Driftwood Wall Tooltip: "" @@ -3757,6 +4134,11 @@ ElumplateWall: { Tooltip: "" } +EutrophicGlassWall: { + DisplayName: Eutrophic Glass Wall + Tooltip: "" +} + EutrophicSandWall: { DisplayName: Unsafe Eutrophic Sand Wall Tooltip: "" @@ -3797,6 +4179,11 @@ HavocplateWall: { Tooltip: "" } +LimestoneWall: { + DisplayName: Limestone Wall + Tooltip: "" +} + NavyplateWall: { DisplayName: Navyplate Wall Tooltip: "" @@ -3862,6 +4249,16 @@ PyreMantleWall: { Tooltip: "" } +RoundedAnodizedWulfrumPanelWall: { + DisplayName: Rounded Anodized Wulfrum Panel Wall + Tooltip: "" +} + +RunestoneWall: { + DisplayName: Runestone Wall + Tooltip: "" +} + RunicProfanedBrickWall: { DisplayName: Runic Profaned Brick Wall Tooltip: "" @@ -3952,11 +4349,41 @@ VoidstoneWall: { Tooltip: "" } +WulfrumComplexPanelWall: { + DisplayName: Wulfrum Complex Panel Wall + Tooltip: "" +} + +WulfrumEnergyBarrierWall: { + DisplayName: Wulfrum Energy Barrier Wall + Tooltip: "" +} + +WulfrumPanelWall: { + DisplayName: Wulfrum Panel Wall + Tooltip: "" +} + +WulfrumPillar: { + DisplayName: Wulfrum Pillar + Tooltip: "" +} + WulfrumPlatingWall: { DisplayName: Wulfrum Plating Wall Tooltip: "" } +WulfrumSheetWall: { + DisplayName: Wulfrum Sheet Wall + Tooltip: "" +} + +WulfrumSidingWall: { + DisplayName: Wulfrum Siding Wall + Tooltip: "" +} + FireTurret: { DisplayName: Fire Turret Tooltip: @@ -4197,140 +4624,27 @@ MiniAgedFloodlightItem: { Tooltip: "" } -ProbesnoutBanner.DisplayName: Probesnout Banner -SharkoonBanner.DisplayName: Sharkoon Banner - -LimestoneWall: { - DisplayName: Limestone Wall +AridSoil: { + DisplayName: Arid Soil Tooltip: "" } -RunestoneWall: { - DisplayName: Runestone Wall +RunestoneTerracotta: { + DisplayName: Runestone Terracotta Tooltip: "" } -WulfrumEnergyBarrier: { - DisplayName: Wulfrum Energy Barrier +ShellTrimBrick: { + DisplayName: Shell Trim Brick Tooltip: "" } -WulfrumPanels: { - DisplayName: Wulfrum Panels +ShellTrimBrickWall: { + DisplayName: Shell Trim Brick Wall Tooltip: "" } -ChargedWulfrumEnergyBarrier: { - DisplayName: Charged Wulfrum Energy Barrier - Tooltip: "" -} - -WulfrumEnergyBarrierWall: { - DisplayName: Wulfrum Energy Barrier Wall - Tooltip: "" -} - -ChargedWulfrumEnergyBarrierWall: { - DisplayName: Charged Wulfrum Energy Barrier Wall - Tooltip: "" -} - -WulfrumPlatform: { - DisplayName: Wulfrum Platform - Tooltip: "" -} - -WulfrumSheets: { - DisplayName: Wulfrum Sheets - Tooltip: "" -} - -WulfrumSiding: { - DisplayName: Wulfrum Siding - Tooltip: "" -} - -WulfrumPillar: { - DisplayName: Wulfrum Pillar - Tooltip: "" -} - -WulfrumComplexPanelWall: { - DisplayName: Wulfrum Complex Panel Wall - Tooltip: "" -} - -AnodizedWulfrumPlatform: { - DisplayName: Anodized Wulfrum Platform - Tooltip: "" -} - -AnodizedWulfrumTrim: { - DisplayName: Anodized Wulfrum Trim - Tooltip: "" -} - -RoundedAnodizedWulfrumPanels: { - DisplayName: Rounded Anodized Wulfrum Panels - Tooltip: "" -} - -AnodizedWulfrumTrimWall: { - DisplayName: Anodized Wulfrum Trim Wall - Tooltip: "" -} - -RoundedAnodizedWulfrumPanelWall: { - DisplayName: Rounded Anodized Wulfrum Panel Wall - Tooltip: "" -} - -AnodizedWulfrumPanels: { - DisplayName: Anodized Wulfrum Panels - Tooltip: "" -} - -WulfrumPanelWall: { - DisplayName: Wulfrum Panel Wall - Tooltip: "" -} - -ChargedWulfrumWallMountedBulb: { - DisplayName: Charged Wulfrum Wall Mounted Bulb - Tooltip: "" -} - -WulfrumWallMountedBulb: { - DisplayName: Wulfrum Wall Mounted Bulb - Tooltip: "" -} - -WulfrumSheetWall: { - DisplayName: Wulfrum Sheet Wall - Tooltip: "" -} - -WulfrumSidingWall: { - DisplayName: Wulfrum Siding Wall - Tooltip: "" -} - -Dunesand: { - DisplayName: Dunesand - Tooltip: "" -} - -EutrophicGlassWall: { - DisplayName: Eutrophic Glass Wall - Tooltip: "" -} - -Dreadstone: { - DisplayName: Dreadstone - Tooltip: "" -} - -OldDukeMonolith: { - DisplayName: Elden Diorama +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.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index eb7ca12116..a1ee116328 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -10,6 +10,17 @@ AerialTracker: { ''' } +Auger: { + DisplayName: P-GSS: Auger + Tooltip: + ''' + A wrist-mounted device which emits a magnetic energy blade + to create a brief magnetic pull at your cursor and amplify your next slash + [c/1FFBFF:'Initially manufactured to serrate and separate chunks of raw material for transport.] + [c/1FFBFF:Keeping both hands free without compromising on power made it exceptionally ergonomic.'] + ''' +} + CountermeasureMitt: { DisplayName: B-LSR: Countermeasure Mitt Tooltip: 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.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 021008f3c8..2d767078ac 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -676,6 +676,17 @@ LunarianBow: { ''' } +M1Garand: { + DisplayName: M1 Garand + Tooltip: + ''' + Shots fired only inherit the damage of the bullet used + Fires 8 bullets before ejecting the rifle's cartridge + Bullets which ricochet off coins can ricochet off cartridges too + 'Mind your thumb' + ''' +} + MagnaCannon: { DisplayName: Magna Cannon Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 6957cd297e..4fe952f5bc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -676,7 +676,7 @@ LeviathanTeeth: { ''' Rapidly throws a spread of teeth that stick into enemies After sticking to an enemy, the teeth will gouge through them and shoot out the other side - Stealth strikes throw a single piercing tooth that creates a jawline of teeth to maul your foes + Stealth strikes create a clamping jaw of teeth to maul your foes ''' } @@ -1391,7 +1391,8 @@ WulfrumKnife: { DisplayName: Wulfrum Knife Tooltip: ''' - Fires wulfrum knives in bursts of 3 + Fires wulfrum knives in bursts of 3 that stick in enemies Stealth strikes make the knife fly further and hit several times at once + to magnetize all stuck knives back to you, restoring stealth ''' } 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.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index b69ea992c0..9dc5d84ee5 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -8,6 +8,9 @@ AnomalysNanogunHoldout.DisplayName: The Anomaly's Nanogun AnomalysNanogunMPFBBoom.DisplayName: MPFB Explosion AnomalysNanogunMPFBDevastator.DisplayName: MPFB Devastator AnomalysNanogunPlasmaBeam.DisplayName: Plasma Beam +AugerHoldout.DisplayName: P-GSS Auger +AugerSlash.DisplayName: Auger Slash +AugerPull.DisplayName: Auger Pull CountermeasurePalmBlast.DisplayName: Palm Blast GaussEnergy.DisplayName: Gauss Energy GaussFlux.DisplayName: Gauss Flux diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index c6be216f3d..e7a674c92d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -262,3 +262,5 @@ LeviatitanMeteor.DisplayName: Leviatitan Meteor LeviatitanExplosion.DisplayName: Leviatitan Explosion SulphuricDrop.DisplayName: Sulphuric Drop AcidRocket.DisplayName: Acid Rocket +M1GarandBulletCasing.DisplayName: M1 Garand Bullet Casing +M1GarandEmptyClip.DisplayName: M1 Garand Empty Clip diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 5328e2d17b..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 @@ -158,6 +157,7 @@ LeonidCometSmall.DisplayName: Leonid Comet LeonidProgenitorBombshell.DisplayName: Leonid Bombshell LeonidStar.DisplayName: Leonid Star LeviathanTooth.DisplayName: Leviathan Tooth +LeviathanToothStealth.DisplayName: Leviathan Jaw LionfishProj.DisplayName: Lionfish LostSoulFriendly.DisplayName: Lost Soul LuminousShard.DisplayName: Stardust Shard 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..fe21625893 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -31,7 +31,6 @@ BossRushEndEffectThing.DisplayName: Boss Rush End Effect Thing BossRushFailureEffectThing.DisplayName: Boss Rush Failure Effect Thing BossRushTierAnimation.DisplayName: Boss Rush Tier Animation ChaoticGeyser.DisplayName: Chaotic Geyser -ChlorophyteLifePulse.DisplayName: Life Pulse ChronoClock.DisplayName: Chrono Clock ClaretCannonProj.DisplayName: Claret Round CoralBubble.DisplayName: Bubble @@ -110,7 +109,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 +144,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.Tiles.hjson b/Localization/en-US/Mods.CalamityMod.Tiles.hjson index 32316202fc..a88b068345 100644 --- a/Localization/en-US/Mods.CalamityMod.Tiles.hjson +++ b/Localization/en-US/Mods.CalamityMod.Tiles.hjson @@ -9,6 +9,8 @@ PirateCrate: Abandoned Crate // Basic Calamity Furniture Basin: Basin LavaFountain: Lava Fountain +BaroqueCello: Baroque Cello +Jukebox: Jukebox PipeOrgan: Pipe Organ Sconce: Sconce // Draedon Lab Furniture diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 7279ec8d86..03539e1b76 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -33,11 +33,7 @@ DifficultyClickText: "[c/919191:Click to select a difficulty mode]" ExpertDifficultyLock: "[c/919191:Higher difficulty modes can only be toggled in Expert Mode or above]" ChangingTheRules: "[c/919191:You cannot change the rules now!]" DifficultySwitch: Difficulty changed from [c/{0}:{1}] to [c/{2}:{3}]. -Classic: Classic -ClassicEnabled: Classic Mode is enabled ClassicInfo: Your Adventure Begins... A far more relaxed Terraria experience -Expert: Expert -ExpertEnabled: Expert Mode is enabled ExpertShortInfo: "[c/FFBA75:Fortune & Glory, Kid. For those looking for a more difficult vanilla experience]" ExpertExpandedInfo: ''' @@ -47,8 +43,6 @@ ExpertExpandedInfo: [c/A87A07:Enemies drop more loot, as well as having higher chances] [c/A87A07:Players drop more of their coins on death] ''' -Master: Master -MasterEnabled: Master Mode is enabled MasterShortInfo: "[c/1CFFAA:Game over man, game over! A tougher step up in stats from Expert Mode]" MasterExpandedInfo: ''' @@ -58,7 +52,6 @@ MasterExpandedInfo: [c/029C6D:Players gain an additional accessory slot at the start of the game] ''' Revengeance: Revengeance -RevengeanceEnabled: Revengeance Mode is enabled RevengeanceShortInfo: "[c/F54254:The intended Calamity experience! Can only be enabled in Expert Mode!]" RevengeanceExpandedInfo: ''' @@ -71,8 +64,6 @@ RevengeanceExpandedInfo: [c/F7342A:This mode is more difficult than Expert. Be sure to prepare for the challenge] ''' Death: Death -DeathLegend: Death+Legend -DeathEnabled: Death Mode is enabled DeathShortInfo: "[c/E066F7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]" DeathExpandedInfo: ''' @@ -81,6 +72,8 @@ DeathExpandedInfo: [c/B834E0:Debuffs are especially lethal and the Abyss is significantly more dangerous] [c/E945FF:Vigilance and tenacity are crucial to survival] ''' +// Legendary (FTW + Master) + Death Mode +Malice: Malice // Calamity Health Bar ExoTwinsNameNormal: XS-01 Artemis and XS-03 Apollo ExoTwinsNameHekate: Eyes of XB-∞ Hekate @@ -105,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 @@ -124,6 +119,7 @@ Cooldowns: { KillModeCooldown: Kill Mode Cooldown LifeSteal: Life Steal Cooldown LionHeartShield: Energy Shell Cooldown + M1GarandShots: Chambered Rounds MasterChefShieldDurability: MJOLNIR Shield Level MasterChefShieldRecharge: MJOLNIR Shield Recharge NebulousCore: Nebulous Core Cooldown @@ -152,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 @@ -167,7 +164,7 @@ Evoke: Evoke Exit: Exit Communicate: Communicate ConfirmationText: Are you sure? -UpgradesRequired: Encryption unsolveable: Upgrades required. +UpgradesRequired: Encryption unsolvable: Upgrades required. ThanatosIcon: Thanatos, a serpentine terror with impervious armor and innumerable laser turrets. AresIcon: Ares, a heavyweight, diabolical monstrosity with four Exo superweapons. ArtemisApolloIcon: Artemis and Apollo, a pair of extremely persistent automatons with unstable energy reserves. @@ -226,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 @@ -244,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 f0b52b16a2..3ea54b5b73 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -10,15 +10,6 @@ SetBonus: { Melee: 15% increased melee speed and 20% increased movement speed } - Chlorophyte: - ''' - Summons a powerful leaf crystal to shoot pulses of life every {0} seconds - The pulses do a base damage of {1} to enemies within its range - The pulses also provide a {2} health boost to you and all players on your team - Players healed by pulses cannot be healed by another pulse until {3} seconds have passed - Both the health boost and the damage scale based on your strongest class - ''' - Cobalt: { $parentVal: ''' @@ -28,7 +19,7 @@ SetBonus: { Melee: 10% increased melee damage } - Copper: Increases all damage by 2 + Copper: Increases all damage by {0} Crimson: ''' Greatly increased natural life regen @@ -49,7 +40,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: @@ -60,27 +51,18 @@ SetBonus: { ''' Gladiator: ''' - +3 defense +60 maximum stealth 5% increased rogue damage and 10% increased velocity ''' Gold: ''' - All enemies have a 2% chance to drop 1 gold; bosses killed drop 3 gold - You gain 1% critical strike chance for every 10 gold in your inventory, capped at 7% - ''' - Iron: - ''' - Increases damage reduction by 6% - +1 HP/s life regen + All enemies have a {0}% chance to drop 1 extra gold + All bosses drop {1} extra gold + You gain {2}% critical strike chance for every gold in your inventory, capped at {3}% ''' + Iron: Multiplies all player-inflicted knockback by {0}x Jungle: 10% reduced mana costs - Lead: - ''' - Increases damage reduction by 4% - +0.5 HP/s life regen - Grants immunity to knockback - ''' + Lead: Grants immunity to knockback Meteor: All magic guns cost 33% mana Mining: Mining ore will sometimes have additional yield Molten: @@ -126,28 +108,20 @@ SetBonus: { Grants +2 HP/s life regeneration after striking an enemy This life regeneration bypasses negative life regeneration ''' - PlatinumChainmail: 3% increased critical strike chance - Platinum: - ''' - Every 10 extra defense gives you 1% increased damage - The 20 defense from the Platinum Armor itself does not contribute to this effect - Bonus damage caps at 50 extra defense - ''' + Platinum: Increases damage reduction by {0}% Silver: ''' - +0.5 HP/s life regen - Two seconds after getting hit for 20 or more damage, you heal for 10 + {0} seconds after getting hit for {1} or more damage, you heal for {2} Getting hit again resets the timer, delaying the heal ''' - Tin: Increases armor penetration by 5 - Tungsten: - ''' - Increases your critical strike chance by 100% of the knockback of your held weapon - This effect caps at Insane knockback, which gives 10% increased critical strike chance - Increases all knockback by 33%, this counts for the above boost - Current bonus: {0}% critical strike chance from {1} knockback - ''' + 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 10bd536446..befd463aaa 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 @@ -14,7 +15,7 @@ AddedTooltip: { Enrages outside the Ocean ''' SlimeGun: Slimed enemies take more damage from fire-based debuffs - FleshKnucklesLine: Max life increased by 45 + FleshKnucklesLine: Max life increased by 25 RodofDiscord: Teleportation is disabled while Chaos State is active Pwnhammer: ''' @@ -46,12 +47,9 @@ AddedTooltip: { FairyBoots: ''' Fairies can spawn at any time on the surface and spawn far more frequently - Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed + 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 @@ -59,29 +57,6 @@ AddedTooltip: { YoyoGlove: Secondary yoyos will do 50% less damage DefensePrefix: +{0}% damage reduction LuckyPrefix: +0.05 luck - /* - Armor - */ - CopperHelmet: 5% increased damage - CopperChainmail: 3% increased critical strike chance - CopperGreaves: 5% increased movement speed - TinHelmet: 3% increased critical strike chance - TinChainmail: +0.5 HP/s life regen - TinGreaves: 5% increased movement speed - IronPieces: Increases damage reduction by 3% - LeadPieces: Increases damage reduction by 2% - SilverHelmet: 5% increased critical strike chance - SilverChainmail: +1 HP/s life regen - SilverGreaves: 8% increased movement speed - TungstenHelmet: 7% increased damage - TungstenChainmail: +0.5 HP/s life regen - TungstenGreaves: 8% increased movement speed - GoldHelmet: 5% increased damage - GoldChainmail: Increases damage reduction by 5% - GoldGreaves: 10% increased movement speed - PlatinumHelmet: 6% increased damage - PlatinumChainmail: 3% increased critical strike chance - PlatinumGreaves: 10% increased movement speed CrimsonBreastplate: +1 HP/s life regen CrimsonOtherPieces: +0.5 HP/s life regen Picksaw: Can mine Scoria Ore located in the Abyss @@ -99,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: ''' @@ -118,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 @@ -170,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: @@ -204,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 @@ -294,7 +255,6 @@ BuffDescription: { Banner: You have increased damage and defense against the following: BeetleMight: Melee damage and speed increase by {0}% and {1}% respectively ChaosState: Rod of Discord teleports are disabled - LeafCrystal: Emits powerful life pulses at nearby enemies Rabies: Decreased life regen, Causes status effects WarmthExtra: Reduced durations of Chilled and Frozen WeaponImbueConfetti: All attacks cause confetti to appear 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/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index e739ea19e3..56f82e1529 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -28,10 +28,10 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 74; NPC.height = 94; NPC.defense = 100; - NPC.lifeMax = 9000; + NPC.lifeMax = 7200; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.9f; diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 3f5c0e84ea..682b2f106e 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -31,18 +31,16 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; NPC.damage = 150; NPC.width = 80; NPC.height = 40; NPC.defense = 50; - NPC.DR_NERD(0.25f); - NPC.lifeMax = 7500; + NPC.lifeMax = 6000; NPC.knockBackResist = 0f; AIType = -1; NPC.noGravity = true; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index 50a1f17866..255c805081 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -29,12 +29,12 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 44; NPC.width = 30; NPC.height = 33; - NPC.defense = 5; - NPC.lifeMax = 115; + NPC.defense = 8; + NPC.lifeMax = 100; NPC.alpha = 20; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index e07162ad68..831ac54719 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -42,10 +42,10 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 54; NPC.height = 76; NPC.defense = 0; - NPC.lifeMax = 500; + NPC.lifeMax = 400; NPC.knockBackResist = 0f; NPC.alpha = 100; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index a050ec9730..68bb4d3709 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -41,11 +41,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 78; NPC.height = 78; NPC.defense = 50; - NPC.lifeMax = 7000; + NPC.lifeMax = 5600; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.HitSound = SoundID.NPCHit23; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index ea898a7f67..7ae65a5c09 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -38,13 +38,12 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 180; NPC.height = 180; NPC.defense = 50; - NPC.DR_NERD(0.05f); NPC.lifeMax = 130000; // Previously 220,000 NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; NPC.timeLeft = NPC.activeTime * 30; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.HitSound = SoundID.NPCHit20; NPC.DeathSound = SoundID.NPCDeath23; NPC.rarity = 2; diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index bdebc2ba7f..149a80cc69 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -36,11 +36,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 58; NPC.height = 30; NPC.defense = 8; - NPC.lifeMax = 140; + NPC.lifeMax = 160; NPC.aiStyle = -1; AIType = -1; NPC.alpha = 150; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath28; NPC.knockBackResist = 0.3f; diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 952a15dfcb..0688935939 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -46,15 +46,14 @@ namespace CalamityMod.NPCs.Abyss { NPC.noGravity = true; NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 90; NPC.width = 136; NPC.height = 62; NPC.defense = 999999; - NPC.lifeMax = 500; + NPC.lifeMax = 800; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; @@ -105,7 +104,7 @@ namespace CalamityMod.NPCs.Abyss { brokenMask = true; NPC.HitSound = SoundID.NPCHit1; - NPC.defense = 15; + NPC.defense = 25; if (!Main.dedServ) { for (int i = 1; i < 4; i++) diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 68cfb20eb1..1c3be97b1f 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -36,15 +36,14 @@ namespace CalamityMod.NPCs.Abyss { NPC.noGravity = true; NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 90; NPC.width = 136; NPC.height = 62; NPC.defense = 999999; - NPC.lifeMax = 500; + NPC.lifeMax = 800; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; @@ -87,7 +86,7 @@ namespace CalamityMod.NPCs.Abyss { brokenMask = true; NPC.HitSound = SoundID.NPCHit1; - NPC.defense = 15; + NPC.defense = 25; if (!Main.dedServ) { for (int i = 1; i < 4; i++) diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 952e03e079..b2baa46d7f 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -59,12 +59,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 126; //36 NPC.height = 76; //20 NPC.defense = 70; - NPC.DR_NERD(0.15f); NPC.lifeMax = 160000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 4fb8bd8269..6dc686e1a9 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.Abyss NPC.lifeMax = 1000; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index c031afc467..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 @@ -56,7 +55,7 @@ namespace CalamityMod.NPCs.Abyss NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 1, 0, 0); + NPC.value = Item.buyPrice(gold: 1); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index d96d487a4c..086c106472 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -34,11 +34,11 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 0; // 0 contact damage, laser damage is handled in the general swimming AI NPC.width = 58; NPC.height = 32; - NPC.defense = 15; + NPC.defense = 20; NPC.lifeMax = 600; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit51; NPC.DeathSound = SoundID.NPCDeath26; NPC.knockBackResist = 0.65f; diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index 333399a810..3e130f4f9e 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -44,11 +44,11 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 10; NPC.width = 68; NPC.height = 58; - NPC.defense = 12; - NPC.lifeMax = 1000; + NPC.defense = 18; + NPC.lifeMax = 800; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index ea78b758ad..a8082e8719 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -46,12 +46,12 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 100; NPC.width = 78; NPC.height = 170; - NPC.defense = 10; - NPC.lifeMax = 7500; + NPC.defense = 30; + NPC.lifeMax = 6000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 25, 0); + NPC.value = Item.buyPrice(silver: 25); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 46cbb367d7..030fa2cfde 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -34,10 +34,10 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 136; NPC.height = 40; NPC.defense = 8; - NPC.lifeMax = 450; + NPC.lifeMax = 360; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.75f; diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index 6e99430331..e87f136a82 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 16; //28 NPC.height = 16; //28 NPC.defense = 20; - NPC.lifeMax = 5000; + NPC.lifeMax = 4000; NPC.aiStyle = -1; //new AIType = -1; //new NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 2520175760..fec514fc15 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -43,11 +43,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 59; NPC.height = 38; NPC.defense = 10; - NPC.lifeMax = 5000; + NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index 3286a0a347..f4d57a3847 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 14; //28 NPC.height = 16; //28 NPC.defense = 30; - NPC.lifeMax = 5000; + NPC.lifeMax = 4000; NPC.aiStyle = -1; //new AIType = -1; //new NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index 5a0ac556ee..c210ea3271 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Abyss NPC.aiStyle = -1; AIType = -1; NPC.timeLeft = NPC.activeTime * 30; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.HitSound = SoundID.NPCHit56; NPC.DeathSound = SoundID.NPCDeath60; NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index 5f416c8320..99d5a112fe 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -55,12 +55,12 @@ namespace CalamityMod.NPCs.Abyss NPC.height = 30; NPC.damage = BaseAttack; - NPC.lifeMax = 375; + NPC.lifeMax = 300; NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 04e5c38808..00bc39d0ec 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Abyss NPC.lifeMax = 300; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.15f; diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 96d27fa2cc..9a0f137dd9 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Abyss NPC.lifeMax = 400; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 28ba9079b6..e14f4b2d3c 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -59,7 +59,6 @@ namespace CalamityMod.NPCs.AcidRain if (DownedBossSystem.downedPolterghast) { - NPC.DR_NERD(0.05f); NPC.damage = 100; NPC.lifeMax = 2000; NPC.defense = 20; @@ -71,7 +70,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.lifeMax = 180; } - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.aiStyle = -1; AIType = -1; NPC.lavaImmune = false; diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 376a638d63..612dec6211 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 66; NPC.lifeMax = 4000; NPC.defense = 25; - NPC.value = Item.buyPrice(0, 2, 0, 0); + NPC.value = Item.buyPrice(gold: 2); if (DownedBossSystem.downedPolterghast) { diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index c27962302d..a2f6a64262 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -43,11 +43,10 @@ namespace CalamityMod.NPCs.AcidRain if (DownedBossSystem.downedPolterghast) { NPC.lifeMax = 4200; - NPC.DR_NERD(0.2f); } NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index 71a732a3c4..c3bae2cc77 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -43,14 +43,13 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 110; NPC.lifeMax = 5000; - NPC.DR_NERD(0.15f); NPC.defense = 25; NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 66d0cb8297..eee58ef4a5 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; AIType = NPCID.ToxicSludge; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 0ab66f14c6..51ed39b3da 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -67,6 +67,10 @@ namespace CalamityMod.NPCs.AcidRain } } + public static int DropletDamage = 55; // 220 + public static int BubbleDamage = 55; // 220 + public static int GFBDeathBombDamage = 100; // 400 + public override void SetDefaults() { NPC.noGravity = true; @@ -74,11 +78,10 @@ namespace CalamityMod.NPCs.AcidRain NPC.width = 180; NPC.height = 90; NPC.defense = 50; - NPC.DR_NERD(0.05f); NPC.lifeMax = 90000; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 20, 0, 0); + NPC.value = Item.buyPrice(gold: 20); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath60; NPC.knockBackResist = 0f; @@ -194,12 +197,11 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { int bubbleShootType = ModContent.ProjectileType(); - int bubbleDamage = NPC.GetProjectileDamage(bubbleShootType); Vector2 baseBubbleShootVelocity = NPC.SafeDirectionTo(mouthPosition) * 13.5f; for (int i = 0; i < bubblesPerBurst; i++) { Vector2 bubbleShootVelocity = baseBubbleShootVelocity + Main.rand.NextVector2Circular(4f, 4f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, bubbleShootVelocity, bubbleShootType, bubbleDamage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, bubbleShootVelocity, bubbleShootType, BubbleDamage, 0f); } // Get launched back after firing. This only happens if in water and there's no obstacles behind. @@ -290,10 +292,9 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { int acidShootType = ModContent.ProjectileType(); - int acidDamage = NPC.GetProjectileDamage(acidShootType); Vector2 acidSpawnPosition = NPC.Center + Main.rand.NextVector2Circular(30f, 10f).RotatedBy(NPC.rotation); Vector2 acidShootVelocity = -Vector2.UnitY.RotatedByRandom(0.33f) * Main.rand.NextFloat(8f, 10.5f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), acidSpawnPosition, acidShootVelocity, acidShootType, acidDamage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), acidSpawnPosition, acidShootVelocity, acidShootType, DropletDamage, 0f); NPC.netUpdate = true; } } @@ -496,15 +497,14 @@ namespace CalamityMod.NPCs.AcidRain double deltaAngleBoom = spreadBoom / 8f; double offsetAngleBoom; int iBoom; - int damageBoom = Main.masterMode ? 127 : Main.expertMode ? 150 : 200; for (iBoom = 0; iBoom < 25; iBoom++) { int projectileType = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; if (Main.netMode != NetmodeID.MultiplayerClient) { - int boom1 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); - int boom2 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom1 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, GFBDeathBombDamage, 0f, Main.myPlayer, 0f, 0f); + int boom2 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, GFBDeathBombDamage, 0f, Main.myPlayer, 0f, 0f); } } for (int i = 0; i < 25; i++) diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 95dcf1abeb..60e00cc3cf 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -113,8 +113,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.defense = 50; NPC.damage = 135; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 20, 0, 0); - NPC.DR_NERD(0.3f); + NPC.value = Item.buyPrice(gold: 20); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index 4522f6d9f5..5e97dd2d05 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.7f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 6a47a8c9d1..13eaba493e 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -47,18 +47,16 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 45; NPC.lifeMax = 280; NPC.defense = 15; - NPC.DR_NERD(0.075f); if (DownedBossSystem.downedPolterghast) { NPC.damage = 120; NPC.lifeMax = 3850; NPC.defense = 35; - NPC.DR_NERD(0.15f); } NPC.knockBackResist = 0.6f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 272718dd9b..54e09b8fbb 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index f2363ac68b..5b8f9fe270 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -45,16 +45,14 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 88; NPC.lifeMax = 3025; NPC.defense = 18; - NPC.DR_NERD(0.05f); } else if (DownedBossSystem.downedAquaticScourge) { NPC.damage = 38; NPC.lifeMax = 220; - NPC.DR_NERD(0.05f); } - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index f0ed36485c..51a9914263 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; @@ -99,7 +99,6 @@ namespace CalamityMod.NPCs.AcidRain public void JumpToDestination() { NPC.knockBackResist = 0.8f; - NPC.DR_NERD(0.35f); NPC.noGravity = false; Projectile closestBubble = SearchForNearestBubble(out float distanceToBubbele); @@ -157,7 +156,6 @@ namespace CalamityMod.NPCs.AcidRain public void DoFlyMovement() { NPC.knockBackResist = 0.5f; - NPC.DR_NERD(0f); float flySpeed = DownedBossSystem.downedPolterghast ? 17f : 14f; float flyInertia = DownedBossSystem.downedPolterghast ? 20f : 24.5f; diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 26dfcc202a..4aea2a0687 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -39,7 +39,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 45; NPC.lifeMax = 300; NPC.defense = 15; - NPC.DR_NERD(0.25f); if (DownedBossSystem.downedPolterghast) { @@ -49,7 +48,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.2f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 7d5ea3826c..b9f91cbcc0 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -27,9 +27,12 @@ namespace CalamityMod.NPCs.AquaticScourge this.HideFromBestiary(); } + public static int ToothDamage = 25; // 100 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 52; // 104 + NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 32; NPC.height = 32; NPC.defense = 20; @@ -39,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; @@ -57,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; @@ -96,13 +97,14 @@ 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) { // Kiss my motherfucking ass you piece of shit game NPC.timeLeft *= 20; NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); calamityGlobalNPC.KillTime = revKillTime; calamityGlobalNPC.newAI[0] = 1f; @@ -183,9 +185,8 @@ namespace CalamityMod.NPCs.AquaticScourge float toothVelocity = death ? 9f : 8f; Vector2 projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float accelerate = phase4 ? 1f : 0f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * toothVelocity, type, damage, 0f, Main.myPlayer, accelerate, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * toothVelocity, type, ToothDamage, 0f, Main.myPlayer, accelerate, 0f); } NPC.netUpdate = true; @@ -233,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; } } @@ -256,7 +257,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 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; @@ -274,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; } @@ -312,21 +313,6 @@ namespace CalamityMod.NPCs.AquaticScourge else if (scourgeTargetX > 0f) NPC.spriteDirection = 1; } - - // Calculate contact damage based on velocity - if (!nonHostile) - { - float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f; - float minimalDamageVelocity = scourgeMaxSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - NPC.damage = 0; - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -376,7 +362,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 87eecca930..2bcd18a1d5 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -29,7 +29,8 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 48; // 96 + NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 32; NPC.height = 32; NPC.defense = 15; @@ -39,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; @@ -57,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; @@ -96,13 +95,14 @@ 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) { // Kiss my motherfucking ass you piece of shit game NPC.timeLeft *= 20; NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); calamityGlobalNPC.KillTime = revKillTime; calamityGlobalNPC.newAI[0] = 1f; @@ -203,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; } } @@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 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; @@ -244,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; } @@ -282,21 +282,6 @@ namespace CalamityMod.NPCs.AquaticScourge else if (scourgeTargetX > 0f) NPC.spriteDirection = 1; } - - // Calculate contact damage based on velocity - if (!nonHostile) - { - float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f; - float minimalDamageVelocity = scourgeMaxSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - NPC.damage = 0; - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -346,7 +331,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index e0f4cd83d9..4ec01007da 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -54,9 +54,12 @@ namespace CalamityMod.NPCs.AquaticScourge NPCID.Sets.MPAllowedEnemies[Type] = true; } + public static int MistDamage = 25; // 100 + public static int CloudDamage = 28; // 112; applies to both Sand and Toxic + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 90; NPC.height = 90; @@ -65,10 +68,8 @@ 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(0, 16, 0, 0); + NPC.value = Item.buyPrice(gold: 12); NPC.behindTiles = true; NPC.chaseable = false; NPC.noGravity = true; @@ -84,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; @@ -138,13 +139,14 @@ 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) { // Kiss my motherfucking ass you piece of shit game NPC.timeLeft *= 20; NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); calamityGlobalNPC.KillTime = revKillTime; calamityGlobalNPC.newAI[0] = 1f; @@ -227,8 +229,7 @@ namespace CalamityMod.NPCs.AquaticScourge float mistVelocity = death ? 10f : 8f; Vector2 projectileVelocity = (NPC.Center + NPC.velocity * 10f - NPC.Center).SafeNormalize(Vector2.UnitY); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * mistVelocity, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * mistVelocity, type, MistDamage, 0f, Main.myPlayer); Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft = getFuckedAI ? 240 : 600; } @@ -241,7 +242,6 @@ namespace CalamityMod.NPCs.AquaticScourge if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int totalProjectiles = (phase4 ? 6 : 9) + (getFuckedAI ? Main.rand.Next(-2, 3) : (int)((calamityGlobalNPC.newAI[3] - spiralGateValue) / toxicCloudBarfDivisor) * (phase4 ? 2 : 3)); float radians = MathHelper.TwoPi / totalProjectiles; float cloudVelocity = 1f + enrageScale; @@ -249,7 +249,7 @@ namespace CalamityMod.NPCs.AquaticScourge for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, CloudDamage, 0f, Main.myPlayer); } } } @@ -353,7 +353,6 @@ namespace CalamityMod.NPCs.AquaticScourge totalProjectiles *= 2; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); @@ -364,7 +363,7 @@ namespace CalamityMod.NPCs.AquaticScourge if (expertMode) velocity *= 1f + (maximumVelocityMult * (0.5f - lifeRatio)); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + velocity.SafeNormalize(Vector2.UnitY) * 5f, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + velocity.SafeNormalize(Vector2.UnitY) * 5f, velocity, type, CloudDamage, 0f, Main.myPlayer); } } } @@ -389,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; } } @@ -409,7 +408,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.alpha = 0; Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 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; @@ -442,7 +441,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeAcceleration *= accelerationMultiplier; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { scourgeMaxSpeed *= 1.15f; scourgeAcceleration *= 1.15f; @@ -571,20 +570,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; } - - // Calculate contact damage based on velocity - if (!nonHostile) - { - float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f; - float minimalDamageVelocity = scourgeMaxSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -658,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; @@ -756,7 +741,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index a9c2eb2544..75935256b7 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 36; // 72 NPC.width = 32; NPC.height = 32; NPC.defense = 25; @@ -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,13 +92,14 @@ 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) { // Kiss my motherfucking ass you piece of shit game NPC.timeLeft *= 20; NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); calamityGlobalNPC.KillTime = revKillTime; calamityGlobalNPC.newAI[0] = 1f; @@ -201,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; } } @@ -224,7 +223,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 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; @@ -242,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; } @@ -280,21 +279,6 @@ namespace CalamityMod.NPCs.AquaticScourge else if (scourgeTargetX > 0f) NPC.spriteDirection = 1; } - - // Calculate contact damage based on velocity - if (!nonHostile) - { - float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f; - float minimalDamageVelocity = scourgeMaxSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - NPC.damage = 0; - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -344,7 +328,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) @@ -370,7 +353,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180, true); + target.AddBuff(ModContent.BuffType(), 300, true); } } } diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index 51e258d065..070908c158 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -33,20 +33,19 @@ namespace CalamityMod.NPCs.Astral NPC.width = 66; NPC.height = 64; NPC.aiStyle = NPCAIStyleID.Herpling; - NPC.defense = 14; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 380; + NPC.defense = 22; + NPC.lifeMax = 300; NPC.knockBackResist = 0.6f; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; - NPC.defense = 24; + NPC.defense = 32; NPC.knockBackResist = 0.5f; - NPC.lifeMax = 570; + NPC.lifeMax = 450; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/Astraglomerate.cs b/NPCs/Astral/Astraglomerate.cs index ea002411d8..b6b8cd566f 100644 --- a/NPCs/Astral/Astraglomerate.cs +++ b/NPCs/Astral/Astraglomerate.cs @@ -37,18 +37,17 @@ namespace CalamityMod.NPCs.Astral NPC.height = 62; NPC.aiStyle = -1; NPC.damage = 0; - NPC.defense = 15; - NPC.DR_NERD(0.15f); + NPC.defense = 30; NPC.lifeMax = 600; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 25; + NPC.defense = 40; NPC.lifeMax = 900; } NPC.Calamity().VulnerableToHeat = true; diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 3732726744..dea2e8be53 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -36,13 +36,12 @@ namespace CalamityMod.NPCs.Astral NPC.damage = 0; // 0 contact damage, laser damage is handled separately NPC.width = 30; //324 NPC.height = 30; //216 - NPC.defense = 10; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 70; + NPC.defense = 20; + NPC.lifeMax = 120; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0.95f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.noGravity = true; NPC.noTileCollide = true; NPC.DeathSound = SoundID.NPCDeath14; @@ -51,9 +50,9 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 30; - NPC.defense = 20; + NPC.defense = 30; NPC.knockBackResist = 0.85f; - NPC.lifeMax = 105; + NPC.lifeMax = 180; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 45496a7894..b192406b1f 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -26,10 +26,10 @@ namespace CalamityMod.NPCs.Astral NPC.width = 36; NPC.height = 31; NPC.aiStyle = NPCAIStyleID.Slime; - NPC.defense = 8; - NPC.lifeMax = 250; + NPC.defense = 18; + NPC.lifeMax = 240; NPC.knockBackResist = 0.6f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 60; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; @@ -39,8 +39,8 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 65; - NPC.defense = 18; - NPC.lifeMax = 375; + NPC.defense = 28; + NPC.lifeMax = 360; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 7b44604b57..514c83b194 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -33,12 +33,11 @@ namespace CalamityMod.NPCs.Astral NPC.height = 34; NPC.aiStyle = NPCAIStyleID.Fighter; NPC.damage = 55; - NPC.defense = 20; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 630; + NPC.defense = 30; + NPC.lifeMax = 500; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.38f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.timeLeft = NPC.activeTime * 2; AnimationType = NPCID.WallCreeper; Banner = ModContent.NPCType(); @@ -46,9 +45,9 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 30; + NPC.defense = 40; NPC.knockBackResist = 0.28f; - NPC.lifeMax = 945; + NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index d8fa0cbe21..a5beafb51f 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -40,13 +40,12 @@ namespace CalamityMod.NPCs.Astral NPC.height = 60; NPC.aiStyle = -1; NPC.damage = 55; - NPC.defense = 20; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 630; + NPC.defense = 30; + NPC.lifeMax = 500; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0f; NPC.noGravity = true; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.timeLeft = NPC.activeTime * 2; AnimationType = NPCID.BlackRecluseWall; Banner = NPC.type; @@ -54,8 +53,8 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 30; - NPC.lifeMax = 945; + NPC.defense = 40; + NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index cd7f5ef471..6e492d6f90 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -125,10 +125,9 @@ namespace CalamityMod.NPCs.Astral NPC.height = 88; NPC.damage = 70; NPC.defense = 40; - NPC.DR_NERD(0.15f); NPC.lifeMax = 1200; NPC.knockBackResist = 0.08f; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.aiStyle = -1; NPC.DeathSound = DeathSound; NPC.rarity = 1; diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index ac416a3a4c..b1b4c7c1a4 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -58,9 +58,8 @@ namespace CalamityMod.NPCs.Astral NPC.damage = 45; NPC.aiStyle = -1; NPC.lifeMax = 500; - NPC.defense = 12; - NPC.DR_NERD(0.15f); - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.defense = 28; + NPC.value = Item.buyPrice(silver: 8); NPC.knockBackResist = 0.8f; NPC.behindTiles = true; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; @@ -70,7 +69,7 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 65; - NPC.defense = 22; + NPC.defense = 38; NPC.knockBackResist = 0.7f; NPC.lifeMax = 750; } diff --git a/NPCs/Astral/Glomerling.cs b/NPCs/Astral/Glomerling.cs index e8c08adf32..c314049689 100644 --- a/NPCs/Astral/Glomerling.cs +++ b/NPCs/Astral/Glomerling.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Astral NPC.aiStyle = -1; NPC.damage = 30; NPC.defense = 0; - NPC.lifeMax = 190; + NPC.lifeMax = 160; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.5f; NPC.noGravity = true; @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Astral NPC.damage = 50; NPC.defense = 8; NPC.knockBackResist = 0.4f; - NPC.lifeMax = 285; + NPC.lifeMax = 240; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 441d30a317..c6c1c6c104 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -42,20 +42,19 @@ namespace CalamityMod.NPCs.Astral NPC.height = 40; NPC.aiStyle = -1; NPC.damage = 50; - NPC.defense = 8; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 420; + NPC.defense = 18; + NPC.lifeMax = 360; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.75f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 80; - NPC.defense = 18; + NPC.defense = 28; NPC.knockBackResist = 0.65f; - NPC.lifeMax = 630; + NPC.lifeMax = 540; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 97f91a0a05..3910718d16 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -38,25 +38,23 @@ namespace CalamityMod.NPCs.Astral public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 55; NPC.width = 60; NPC.height = 58; NPC.aiStyle = -1; - NPC.defense = 6; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 430; + NPC.defense = 22; + NPC.lifeMax = 400; NPC.knockBackResist = 0.2f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; - NPC.defense = 16; + NPC.defense = 32; NPC.knockBackResist = 0.1f; - NPC.lifeMax = 645; + NPC.lifeMax = 600; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 423e776b50..8737f78575 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -52,22 +52,21 @@ namespace CalamityMod.NPCs.Astral NPC.width = 78; NPC.height = 50; NPC.damage = 45; - NPC.defense = 15; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 290; + NPC.defense = 26; + NPC.lifeMax = 300; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 75; - NPC.defense = 25; + NPC.defense = 36; NPC.knockBackResist = 0.4f; - NPC.lifeMax = 435; + NPC.lifeMax = 450; } if (CalamityWorld.revenge) { diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index 937bae3dad..ae8b05b1fb 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -40,22 +40,21 @@ namespace CalamityMod.NPCs.Astral NPC.width = 48; NPC.height = 40; NPC.damage = 38; - NPC.defense = 16; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 390; + NPC.defense = 28; + NPC.lifeMax = 320; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.58f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 58; - NPC.defense = 26; + NPC.defense = 38; NPC.knockBackResist = 0.48f; - NPC.lifeMax = 585; + NPC.lifeMax = 480; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index bfb8aab2ea..17ac78ee83 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -42,22 +42,21 @@ namespace CalamityMod.NPCs.Astral NPC.width = 64; NPC.height = 56; NPC.damage = 50; - NPC.defense = 20; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 540; + NPC.defense = 35; + NPC.lifeMax = 500; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; - NPC.defense = 30; + NPC.defense = 45; NPC.knockBackResist = 0.7f; - NPC.lifeMax = 810; + NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 80c4766163..3f4c651ee5 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -42,11 +42,10 @@ namespace CalamityMod.NPCs.Astral NPC.aiStyle = NPCAIStyleID.Bat; //bats NPC.npcSlots = 0.5f; //needed? NPC.damage = 55; - NPC.defense = 18; - NPC.DR_NERD(0.15f); + NPC.defense = 26; NPC.knockBackResist = 0.65f; - NPC.lifeMax = 270; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.lifeMax = 280; + NPC.value = Item.buyPrice(silver: 5); NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; AnimationType = NPCID.GiantFlyingFox; Banner = NPC.type; @@ -54,9 +53,9 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 28; + NPC.defense = 36; NPC.knockBackResist = 0.55f; - NPC.lifeMax = 405; + NPC.lifeMax = 420; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 1c9e667883..5163a54dbc 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -88,12 +88,15 @@ namespace CalamityMod.NPCs.AstrumAureus } } + public static int LaserDamage = 24; // 96 + public static int CrystalDamage = 30; // 120 + public override void SetDefaults() { NPC.lavaImmune = true; NPC.noGravity = true; NPC.npcSlots = 15f; - NPC.GetNPCDamage(); + NPC.damage = 80; // 160 NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 374; NPC.height = 374; @@ -103,17 +106,17 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 15); NPC.boss = true; NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToHeat = true; 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) @@ -192,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.LegendaryMode && CalamityWorld.revenge) ? 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; @@ -273,7 +266,6 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int totalProjectiles = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 10f; @@ -281,7 +273,7 @@ namespace CalamityMod.NPCs.AstrumAureus for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, CrystalDamage, 0f, Main.myPlayer, 0f, 1f); } } slimePhase = 0; @@ -291,7 +283,6 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float aureusLaserSpeed = 7f; float aureusLaserTargetX = player.Center.X - NPC.Center.X; float aureusLaserTargetY = player.Center.Y - NPC.Center.Y; @@ -299,11 +290,11 @@ namespace CalamityMod.NPCs.AstrumAureus aureusLaserTargetDist = aureusLaserSpeed / aureusLaserTargetDist; aureusLaserTargetX *= aureusLaserTargetDist; aureusLaserTargetY *= aureusLaserTargetDist; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX, aureusLaserTargetY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX, aureusLaserTargetY, type, LaserDamage, 0f, Main.myPlayer); for (int i = 0; i < 4; i++) { Vector2 offset = new Vector2(Main.rand.Next(-6, 7), Main.rand.Next(-6, 7)); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX + offset.X, aureusLaserTargetY + offset.Y, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX + offset.X, aureusLaserTargetY + offset.Y, type, LaserDamage, 0f, Main.myPlayer); } } slimePhase = 1; @@ -342,12 +333,11 @@ namespace CalamityMod.NPCs.AstrumAureus { float velocity = death ? (8f + NPC.localAI[2] * 0.025f) : 7f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - 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); - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Normalize(destination - spawnVector) * velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Normalize(destination - spawnVector) * velocity, type, CrystalDamage, 0f, Main.myPlayer); } } } @@ -372,13 +362,12 @@ namespace CalamityMod.NPCs.AstrumAureus int spread = !phase2 ? 8 : 10; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * walkingProjectileVelocity; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < maxProjectiles; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, LaserDamage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); } if (phase3) @@ -388,13 +377,12 @@ namespace CalamityMod.NPCs.AstrumAureus spread = 45; type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * flameVelocity; rotation = MathHelper.ToRadians(spread); for (int i = 0; i < maxProjectiles; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, CrystalDamage, 0f, Main.myPlayer); } } } @@ -409,7 +397,6 @@ namespace CalamityMod.NPCs.AstrumAureus int spread = !phase3 ? (death ? 18 : 16) : (death ? 22 : 20); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int centralLaser = maxProjectiles / 2; int[] lasersToNotFire = new int[6] { centralLaser - 3, centralLaser - 2, centralLaser - 1, centralLaser + 1, centralLaser + 2, centralLaser + 3 }; Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * walkingProjectileVelocity; @@ -419,7 +406,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3] && i != lasersToNotFire[4] && i != lasersToNotFire[5]) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, LaserDamage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); } } } @@ -643,11 +630,10 @@ namespace CalamityMod.NPCs.AstrumAureus calamityGlobalNPC.newAI[1] = speedMultLimit; } - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 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; @@ -731,8 +717,9 @@ namespace CalamityMod.NPCs.AstrumAureus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + bool crystal = Main.rand.NextBool(); + int type = crystal ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = crystal ? CrystalDamage : LaserDamage; int totalProjectiles = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 10f; @@ -755,7 +742,6 @@ namespace CalamityMod.NPCs.AstrumAureus int spread = death ? 28 : 20; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 spawnVector = new Vector2(NPC.Center.X, NPC.Center.Y - 80f * NPC.scale); Vector2 destination = new Vector2(spawnVector.X, spawnVector.Y + 100f * NPC.scale); Vector2 projectileVelocity = Vector2.Normalize(destination - spawnVector) * flameVelocity; @@ -763,7 +749,7 @@ namespace CalamityMod.NPCs.AstrumAureus for (int i = 0; i < maxProjectiles; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector + Vector2.Normalize(perturbedSpeed) * 100f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector + Vector2.Normalize(perturbedSpeed) * 100f, perturbedSpeed, type, CrystalDamage, 0f, Main.myPlayer); } } } @@ -773,12 +759,11 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 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); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int[] lasersToNotFire = new int[4] { 1, 3, maxProjectiles - 2, maxProjectiles - 4 }; Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * laserVelocity; float rotation = MathHelper.ToRadians(spread); @@ -787,7 +772,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3]) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, laserVelocity * 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, LaserDamage, 0f, Main.myPlayer, 0f, laserVelocity * 2f); } } } @@ -823,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.LegendaryMode && CalamityWorld.revenge) + if (Main.getGoodWorld) fallSpeed += 0.5f; if (calamityGlobalNPC.newAI[1] > 0f) @@ -839,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; @@ -850,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.LegendaryMode && CalamityWorld.revenge) + if (Main.getGoodWorld) velocityXCap += 5f; if (calamityGlobalNPC.newAI[0] > 0f) @@ -1060,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; @@ -1434,7 +1416,6 @@ namespace CalamityMod.NPCs.AstrumAureus public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } // Can only hit the target if within certain distance diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 71749015aa..0f58c12d65 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -35,9 +35,9 @@ namespace CalamityMod.NPCs.AstrumAureus public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 55; // 110 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 90; NPC.height = 60; NPC.Opacity = 0f; @@ -308,11 +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(); - int damage2 = NPC.GetProjectileDamage(type); - 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)); @@ -320,7 +319,7 @@ namespace CalamityMod.NPCs.AstrumAureus for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, AstrumAureus.LaserDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 42389b2276..1a017ad86a 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -54,9 +54,13 @@ namespace CalamityMod.NPCs.AstrumDeus } } + public static int LaserDamage = 30; // 120 + public static int HelixLaserDamage = 40; // 160 + public static int MineDamage = 40; // 160 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 70; // 140 NPC.npcSlots = 5f; NPC.width = 38; NPC.height = 44; @@ -117,17 +121,12 @@ 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) NPC.damage = 0; + else + NPC.damage = NPC.defDamage; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -168,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) @@ -189,12 +188,10 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.LegendaryMode && revenge) + 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; @@ -256,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) { @@ -297,9 +295,8 @@ namespace CalamityMod.NPCs.AstrumDeus } int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float split = (splittingMines && NPC.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, MineDamage, 0f, Main.myPlayer, split, 0f); } } @@ -307,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; @@ -323,7 +322,7 @@ namespace CalamityMod.NPCs.AstrumDeus Vector2 laserVelocity = shootDirection * deusLaserSpeed; int type = shootGodRays ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = shootGodRays ? HelixLaserDamage : LaserDamage; if (shootGodRays) { SoundEngine.PlaySound(AstrumDeusHead.GodRaySound, NPC.Center); @@ -363,9 +362,8 @@ namespace CalamityMod.NPCs.AstrumDeus } int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float split = (splittingMines && NPC.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, MineDamage, 0f, Main.myPlayer, split, 0f); } } } @@ -419,21 +417,6 @@ namespace CalamityMod.NPCs.AstrumDeus // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) calamityGlobalNPC.newAI[1] += 1f; - - // Calculate contact damage based on velocity - if (!doNotDealDamage) - { - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - NPC.damage = 0; - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -451,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; @@ -580,7 +563,6 @@ namespace CalamityMod.NPCs.AstrumDeus public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index a1dcd445a8..728439106b 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 120; // 240 NPC.npcSlots = 5f; NPC.width = 56; NPC.height = 56; @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); - NPC.value = Item.buyPrice(0, 50, 0, 0); + NPC.value = Item.buyPrice(gold: 50); NPC.alpha = 255; NPC.behindTiles = true; NPC.noGravity = true; @@ -151,17 +151,12 @@ 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) NPC.damage = 0; + else + NPC.damage = NPC.defDamage; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -206,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) @@ -227,12 +222,10 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.LegendaryMode && revenge) + 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; @@ -337,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(); @@ -444,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) { @@ -555,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) { @@ -574,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; @@ -775,20 +772,6 @@ namespace CalamityMod.NPCs.AstrumDeus // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) calamityGlobalNPC.newAI[1] += 1f; - - // Calculate contact damage based on velocity - if (!doNotDealDamage) - { - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - } } public override bool CheckActive() @@ -811,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 b9362f3c8d..d231d34b8d 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 60; // 120 NPC.npcSlots = 5f; NPC.width = 52; NPC.height = 68; @@ -100,17 +100,12 @@ 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) NPC.damage = 0; + else + NPC.damage = NPC.defDamage; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -151,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) @@ -172,12 +167,10 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.LegendaryMode && revenge) + 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; @@ -239,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) { @@ -296,21 +290,6 @@ namespace CalamityMod.NPCs.AstrumDeus // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) calamityGlobalNPC.newAI[1] += 1f; - - // Calculate contact damage based on velocity - if (!doNotDealDamage) - { - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - NPC.damage = 0; - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -325,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; @@ -419,13 +398,12 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 180); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index dfabd78a96..b6b30908e0 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { NPC.aiStyle = -1; AIType = -1; - NPC.damage = 0; // 0 contact damage, projectile damage values are pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 60; NPC.height = 60; NPC.defense = 0; @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { float projectileVelocity = 5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = BrimstoneElemental.DartDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Center - NPC.Center) * projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocity * 3f); } } @@ -239,7 +239,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { float projectileVelocity = 5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = BrimstoneElemental.HellfireballDamage; SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, NPC.Center); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Center - NPC.Center) * projectileVelocity, type, damage, 0f, Main.myPlayer, Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].position.X, Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].position.Y); } diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 2e544b9c1d..bb9c4e933b 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -65,14 +65,21 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPCID.Sets.MPAllowedEnemies[Type] = true; } + // These values are all applied alongside their respective GFB attacks (too many to list) + public static int DartDamage = 19; // 76 + public static int HellblastDamage = 22; // 88 + public static int HellfireballDamage = 22; // 88 + public static int RayDamage = 35; // 140 + public override void SetDefaults() { NPC.npcSlots = 64f; - NPC.GetNPCDamage(); + NPC.damage = 52; // 104 + NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 100; NPC.height = 150; NPC.defense = 15; - NPC.value = Item.buyPrice(0, 16, 0, 0); + NPC.value = Item.buyPrice(gold: 12); NPC.LifeMaxNERB(41000, 49200, 500000); NPC.DR_NERD(0.2f); NPC.knockBackResist = 0f; @@ -296,9 +303,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental if (NPC.ai[0] == -1f) { - // Avoid cheap bullshit - NPC.damage = 0; - if (Main.netMode != NetmodeID.MultiplayerClient) { int phase; @@ -327,9 +331,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Pick a location to teleport to else if (NPC.ai[0] == 0f) { - // Set damage - NPC.damage = NPC.defDamage; - NPC.chaseable = true; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -378,7 +379,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Teleport to location else if (NPC.ai[0] == 1f) { - // Avoid cheap bullshit + // Disable contact damage for some time while fading away NPC.damage = 0; NPC.chaseable = true; @@ -415,16 +416,13 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Either teleport again or go to next AI state else if (NPC.ai[0] == 2f) { - // Avoid cheap bullshit - NPC.damage = 0; - if (NPC.alpha >= 255) { if (Main.zenithWorld) { SoundEngine.PlaySound(SoundID.Item68, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = RayDamage; Vector2 pos = NPC.Center; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -457,10 +455,12 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.alpha -= 50; if (NPC.alpha <= 0) { + // Restore contact damage once returned to proper opacity + NPC.damage = NPC.defDamage; 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; @@ -478,9 +478,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Float above target and fire projectiles else if (NPC.ai[0] == 3f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.chaseable = true; NPC.rotation = NPC.velocity.X * 0.04f; @@ -497,7 +494,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { float velocity = (death ? 7f : revenge ? 6f : 5f) + (2f * enrageScale) + (expertMode ? 3f * (1f - lifeRatio) : 0f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = HellfireballDamage; if (currentMode == 4) { type = ModContent.ProjectileType(); @@ -513,15 +510,13 @@ 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.LegendaryMode && CalamityWorld.revenge) - Main.projectile[proj].extraUpdates += 1; } if (NPC.ai[1] % divisor2 == divisor2 - 1f) { velocity = (death ? 5f : 4f) + 2f * enrageScale; type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); + damage = DartDamage; if (currentMode == 4) { type = ModContent.ProjectileType(); @@ -534,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; @@ -547,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.LegendaryMode && CalamityWorld.revenge) - 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); } } } @@ -569,14 +562,11 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Cocoon bullet hell else if (NPC.ai[0] == 4f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.defense = NPC.defDefense * 4; NPC.chaseable = false; NPC.localAI[0] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.localAI[0] += 2f; if (expertMode) NPC.localAI[0] += 1f - lifeRatio; @@ -603,7 +593,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental int totalProjectiles = 6; float offsetAngle = MathHelper.Pi * radialOffset; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = HellblastDamage; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -614,15 +604,13 @@ 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.LegendaryMode && CalamityWorld.revenge) - Main.projectile[proj].extraUpdates += 1; } } totalProjectiles = 12; float radians2 = MathHelper.TwoPi / totalProjectiles; type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); + damage = DartDamage; if (currentMode == 4) { type = ModContent.ProjectileType(); @@ -643,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.LegendaryMode && CalamityWorld.revenge) - 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) @@ -654,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.LegendaryMode && CalamityWorld.revenge) - 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); } } } @@ -686,9 +670,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Laser beam attack else if (NPC.ai[0] == 5f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.chaseable = true; NPC.defense = NPC.defDefense * 2; @@ -744,10 +725,10 @@ namespace CalamityMod.NPCs.BrimstoneElemental Vector2 laserVelocity2 = new Vector2(NPC.localAI[0], NPC.localAI[1]); laserVelocity2 = laserVelocity2.SafeNormalize(Vector2.UnitY); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + 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) @@ -788,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) @@ -810,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) @@ -833,7 +814,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 240); } public override void FindFrame(int frameHeight) // 9 total frames @@ -892,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(); @@ -919,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); } @@ -954,7 +935,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Bumblebirb/DraconicSwarmer.cs b/NPCs/Bumblebirb/DraconicSwarmer.cs index d7864abfea..7699b6a720 100644 --- a/NPCs/Bumblebirb/DraconicSwarmer.cs +++ b/NPCs/Bumblebirb/DraconicSwarmer.cs @@ -24,10 +24,10 @@ namespace CalamityMod.NPCs.Bumblebirb public override void SetDefaults() { + NPC.damage = 100; // 200 NPC.npcSlots = 1f; NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 120; NPC.height = 80; NPC.defense = 20; @@ -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 @@ -281,7 +272,7 @@ namespace CalamityMod.NPCs.Bumblebirb Vector2 ai0 = NPC.Center - fireFrom; float ai = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), 75, 0f, Main.myPlayer, ai0.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Dragonfolly.LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); } } } diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs index b75c1e95c7..6dbe843583 100644 --- a/NPCs/Bumblebirb/Dragonfolly.cs +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -60,13 +60,16 @@ namespace CalamityMod.NPCs.Bumblebirb public override string Texture => "CalamityMod/NPCs/Bumblebirb/Birb"; public override string BossHeadTexture => "CalamityMod/NPCs/Bumblebirb/Birb_Head_Boss"; + public static int FeatherDamage = 42; // 168 + public static int LightningDamage = 65; // 260 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.npcSlots = 32f; NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 130; NPC.height = 100; NPC.defense = 40; @@ -77,7 +80,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.noTileCollide = true; NPC.lavaImmune = true; NPC.noGravity = true; - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.HitSound = SoundID.NPCHit51; NPC.DeathSound = SoundID.NPCDeath46; NPC.Calamity().VulnerableToHeat = true; @@ -170,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) @@ -264,7 +267,7 @@ namespace CalamityMod.NPCs.Bumblebirb Vector2 ai0 = NPC.Center - fireFrom; float ai = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), NPC.defDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); } } } @@ -306,7 +309,7 @@ namespace CalamityMod.NPCs.Bumblebirb Vector2 ai0 = NPC.Center - fireFrom; float ai = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), NPC.defDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); } } } @@ -334,7 +337,7 @@ namespace CalamityMod.NPCs.Bumblebirb } // Max spawn amount - int maxBirbs = (CalamityWorld.LegendaryMode && revenge) ? 12 : revenge ? 3 : 2; + int maxBirbs = Main.zenithWorld ? 12 : revenge ? 3 : 2; // Variable for charging float chargeDistance = 600f; @@ -420,7 +423,6 @@ namespace CalamityMod.NPCs.Bumblebirb float featherVelocity = 2f + (enrageScale - 1f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (follyAttackPicker == 0 && NPC.localAI[3] == 0f) { @@ -464,19 +466,19 @@ 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)) { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); } if (i >= (int)(totalProjectiles * 0.625) && i <= (int)(totalProjectiles * 0.875)) { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); } } else @@ -487,7 +489,7 @@ namespace CalamityMod.NPCs.Bumblebirb { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); } } else @@ -496,7 +498,7 @@ namespace CalamityMod.NPCs.Bumblebirb { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); } } } @@ -531,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; @@ -550,7 +552,7 @@ namespace CalamityMod.NPCs.Bumblebirb Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); } else { @@ -558,7 +560,7 @@ namespace CalamityMod.NPCs.Bumblebirb { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); } } } @@ -646,7 +648,7 @@ namespace CalamityMod.NPCs.Bumblebirb float velocity = 8f + (enrageScale - 1f) * 2f; float follyQuickFlySpeed = velocity + NPC.ai[2] + follyQuickFlyTargetDirection.Length() / 120f; - if (CalamityWorld.LegendaryMode && revenge) + if (Main.getGoodWorld) follyQuickFlySpeed *= 2f; float follyQuickFlyVelMult = 20f; @@ -655,7 +657,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.velocity = (NPC.velocity * (follyQuickFlyVelMult - 1f) + follyQuickFlyTargetDirection) / follyQuickFlyVelMult; NPC.ai[1] += 1f; - if (NPC.ai[1] >= ((CalamityWorld.LegendaryMode && revenge) ? 90f : 180f)) + if (NPC.ai[1] >= (Main.getGoodWorld ? 90f : 180f)) { NPC.TargetClosest(); NPC.ai[0] = 0f; @@ -845,7 +847,7 @@ namespace CalamityMod.NPCs.Bumblebirb Vector2 ai0 = NPC.Center - fireFrom; float ai = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), 75, 0f, Main.myPlayer, ai0.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); } } } @@ -853,7 +855,7 @@ namespace CalamityMod.NPCs.Bumblebirb if (Main.netMode != NetmodeID.MultiplayerClient) { - bool gfbSpawnFlag = CalamityWorld.LegendaryMode && revenge && (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) { @@ -919,7 +921,7 @@ namespace CalamityMod.NPCs.Bumblebirb Vector2 ai0 = NPC.Center - fireFrom; float ai = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), 75, 0f, Main.myPlayer, ai0.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); } } } @@ -1245,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); @@ -1302,7 +1303,7 @@ namespace CalamityMod.NPCs.Bumblebirb Vector2 ai0 = NPC.Center - fireFrom; float ai = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), 75, 0f, Main.myPlayer, ai0.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); } } } @@ -1312,7 +1313,6 @@ namespace CalamityMod.NPCs.Bumblebirb public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void ModifyTypeName(ref string typeName) diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 83f55e1c3e..a4f951a389 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -61,10 +61,15 @@ namespace CalamityMod.NPCs.CalClone } } + public static int DartDamage = 22; // 88 + public static int HellblastDamage = 25; // 100 + public static int HellfireballDamage = 25; // 100 + public static int FireblastDamage = 35; // 140; Also applies to GFB Gigablasts + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 60; // 120 NPC.npcSlots = 14f; NPC.width = 120; NPC.height = 120; @@ -73,7 +78,7 @@ namespace CalamityMod.NPCs.CalClone NPC.scale *= 0.8f; NPC.defense = 25; - NPC.value = Item.buyPrice(0, 20, 0, 0); + NPC.value = Item.buyPrice(gold: 15); NPC.LifeMaxNERB(39000, 46875, 520000); NPC.aiStyle = -1; AIType = -1; @@ -199,7 +204,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 2f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (Main.zenithWorld) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -223,7 +228,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 1f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (Main.zenithWorld) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -287,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)); @@ -371,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); @@ -383,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; @@ -447,11 +443,11 @@ namespace CalamityMod.NPCs.CalClone if (calamityGlobalNPC.newAI[2] == 2f) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = FireblastDamage; 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) { @@ -472,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; @@ -480,7 +476,7 @@ namespace CalamityMod.NPCs.CalClone if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = HellblastDamage; float projSpeed = 4f; // Blasts aimed directly at the player's horizontal position, does not spawn during the second bullet hell if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f && calamityGlobalNPC.newAI[2] != 2f) @@ -589,7 +585,7 @@ namespace CalamityMod.NPCs.CalClone return; } - else if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + else if (Main.zenithWorld) { if (calamityGlobalNPC.newAI[3] < 900f) calamityGlobalNPC.newAI[3] += 1f; @@ -597,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; @@ -605,7 +601,7 @@ namespace CalamityMod.NPCs.CalClone if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = HellblastDamage; float projSpeed = 4f; if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) { @@ -645,10 +641,9 @@ namespace CalamityMod.NPCs.CalClone float phaseTimer = 400f - (death ? 120f * (1f - lifeRatio) : 0f); if (NPC.ai[2] >= phaseTimer || phase4) { - if (death && !phase4 && Main.rand.NextBool() && !brotherAlive) - NPC.ai[1] = 4f; - else - NPC.ai[1] = 1f; + // Prevent going to other positions during brothers phase + if (!brotherAlive) + NPC.ai[1] = death && !phase4 && Main.rand.NextBool() ? 4f : 1f; NPC.ai[2] = 0f; if (death) @@ -657,31 +652,25 @@ namespace CalamityMod.NPCs.CalClone NPC.netUpdate = true; } - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient && !brotherAlive) { NPC.localAI[1] += 1f; - if (!brotherAlive) - { - if (expertMode) - NPC.localAI[1] += death ? 2f * (1f - lifeRatio) : 1f - lifeRatio; - if (revenge) - NPC.localAI[1] += 0.5f; - } + if (expertMode) + NPC.localAI[1] += death ? 2f * (1f - lifeRatio) : 1f - lifeRatio; + if (revenge) + NPC.localAI[1] += 0.5f; - if (NPC.localAI[1] >= (brotherAlive ? 180f : 120f)) + if (NPC.localAI[1] >= 120f) { NPC.localAI[1] = 0f; SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.HellfireballSound, NPC.Center); float projectileVelocity = expertMode ? 14f : 12.5f; - projectileVelocity += 3f * enrageScale; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - bool shootPredictiveShot = CalamityWorld.LegendaryMode && CalamityWorld.revenge && 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, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, HellfireballDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); Main.projectile[proj].netUpdate = true; } } @@ -693,39 +682,32 @@ namespace CalamityMod.NPCs.CalClone // Avoid cheap bullshit NPC.damage = 0; - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient && !brotherAlive) { NPC.localAI[1] += 1f; - if (!brotherAlive) - { - if (revenge) - NPC.localAI[1] += 0.5f; - if (expertMode) - NPC.localAI[1] += 0.5f; - } + if (revenge) + NPC.localAI[1] += 0.5f; + if (expertMode) + NPC.localAI[1] += 0.5f; - if (NPC.localAI[1] >= (brotherAlive ? 75f : 50f) && Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) + if (NPC.localAI[1] >= 50f && Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { NPC.localAI[1] = 0f; float projectileVelocity = expertMode ? 12.5f : 11f; - projectileVelocity += 3f * enrageScale; - int type = brotherAlive ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int type = ModContent.ProjectileType(); + int damage = HellblastDamage; Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity; Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, HellfireballDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); } else { - float ai0 = type == ModContent.ProjectileType() ? 1f : player.position.X; - float ai1 = type == ModContent.ProjectileType() ? 0f : player.position.Y; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, ai0, ai1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, 1f); } } } @@ -734,10 +716,12 @@ namespace CalamityMod.NPCs.CalClone float phaseTimer = 240f - (death ? 60f * (1f - lifeRatio) : 0f); if (NPC.ai[2] >= phaseTimer || phase4) { - if (death && !phase4 && Main.rand.NextBool() && !brotherAlive) + if (brotherAlive) + NPC.ai[1] = 0f; + else if (death && !phase4 && Main.rand.NextBool()) NPC.ai[1] = 0f; else - NPC.ai[1] = !brotherAlive && phase2 && revenge ? 4f : 0f; + NPC.ai[1] = phase2 && revenge ? 4f : 0f; NPC.ai[2] = 0f; if (death) @@ -750,11 +734,10 @@ namespace CalamityMod.NPCs.CalClone { // Set damage NPC.damage = NPC.defDamage; - SoundEngine.PlaySound(CalamitasClone.ChargeSound, NPC.Center); + SoundEngine.PlaySound(ChargeSound, NPC.Center); 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; @@ -789,9 +772,8 @@ namespace CalamityMod.NPCs.CalClone if (Main.netMode != NetmodeID.MultiplayerClient && death && phase3 && NPC.ai[2] % (phase4 ? 6f : 10f) == 0f) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Vector2 fireballVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : NPC.velocity * 0.01f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); + 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); } } @@ -912,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); @@ -1002,7 +984,6 @@ namespace CalamityMod.NPCs.CalClone public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -1014,7 +995,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index a09eed75d6..54dd688d71 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -48,11 +48,13 @@ namespace CalamityMod.NPCs.CalClone } } + public static int FlamethrowerDamage = 30; // 120 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 45; // 90 NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -154,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; @@ -223,15 +218,10 @@ namespace CalamityMod.NPCs.CalClone if (NPC.ai[1] == 0f) { - // Avoid cheap bullshit - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - 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; @@ -323,9 +313,7 @@ namespace CalamityMod.NPCs.CalClone { NPC.localAI[1] = 0f; float calCloneBroProjSpeed = NPC.AnyNPCs(ModContent.NPCType()) ? 4f : 6f; - calCloneBroProjSpeed += enrageScale; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); 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; calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; @@ -337,7 +325,7 @@ namespace CalamityMod.NPCs.CalClone calCloneBroProjTargetX += NPC.velocity.X * 0.5f; calCloneBroProjLocation.X -= calCloneBroProjTargetX; calCloneBroProjLocation.Y -= calCloneBroProjTargetY; - Projectile.NewProjectile(NPC.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, FlamethrowerDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -346,19 +334,15 @@ namespace CalamityMod.NPCs.CalClone { if (NPC.ai[1] == 1f) { - // Set damage - NPC.damage = NPC.defDamage; - SoundEngine.PlaySound(SoundID.Roar, NPC.Center); 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; @@ -375,7 +359,6 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(ModContent.ProjectileType()); int totalProjectiles = death ? 10 : revenge ? 8 : expertMode ? 6 : 4; float radians = MathHelper.TwoPi / totalProjectiles; @@ -385,7 +368,7 @@ namespace CalamityMod.NPCs.CalClone for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, CalamitasClone.DartDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } for (int i = 0; i < 6; i++) @@ -396,9 +379,6 @@ namespace CalamityMod.NPCs.CalClone if (NPC.ai[1] == 2f) { - // Set damage - NPC.damage = NPC.defDamage; - NPC.ai[2] += 1f + (death ? 0.5f * (1f - lifeRatio) : 0f); if (expertMode) NPC.ai[2] += 0.25f; @@ -407,9 +387,6 @@ namespace CalamityMod.NPCs.CalClone if (NPC.ai[2] >= 75f) { - // Avoid cheap bullshit - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - NPC.velocity.X *= 0.93f; NPC.velocity.Y *= 0.93f; @@ -564,7 +541,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index 4cb790112d..a6b12b320c 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -43,11 +43,13 @@ namespace CalamityMod.NPCs.CalClone } } + public static int BallDamage = 22; // 88 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 45; // 90 NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -148,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; @@ -217,15 +212,10 @@ namespace CalamityMod.NPCs.CalClone if (NPC.ai[1] == 0f) { - // Avoid cheap bullshit - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - 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; @@ -314,9 +304,7 @@ namespace CalamityMod.NPCs.CalClone { NPC.localAI[1] = 0f; float calCloneBroProjSpeed = death ? 14f : 12f; - calCloneBroProjSpeed += 3f * enrageScale; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); 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; calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; @@ -328,7 +316,7 @@ namespace CalamityMod.NPCs.CalClone calCloneBroProjTargetX += NPC.velocity.X * 0.5f; calCloneBroProjLocation.X -= calCloneBroProjTargetX; calCloneBroProjLocation.Y -= calCloneBroProjTargetY; - Projectile.NewProjectile(NPC.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, BallDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -337,19 +325,15 @@ namespace CalamityMod.NPCs.CalClone { if (NPC.ai[1] == 1f) { - // Set damage - NPC.damage = NPC.defDamage; - SoundEngine.PlaySound(SoundID.Roar, NPC.Center); 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); @@ -366,7 +350,6 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(ModContent.ProjectileType()); int totalProjectiles = death ? 10 : revenge ? 8 : expertMode ? 6 : 4; float radians = MathHelper.TwoPi / totalProjectiles; @@ -376,7 +359,7 @@ namespace CalamityMod.NPCs.CalClone for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, CalamitasClone.DartDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } for (int i = 0; i < 6; i++) @@ -387,9 +370,6 @@ namespace CalamityMod.NPCs.CalClone if (NPC.ai[1] == 2f) { - // Set damage - NPC.damage = NPC.defDamage; - NPC.ai[2] += 1f + (death ? 0.5f * (1f - lifeRatio) : 0f); if (expertMode) NPC.ai[2] += 0.25f; @@ -398,9 +378,6 @@ namespace CalamityMod.NPCs.CalClone if (NPC.ai[2] >= 60f) //50 { - // Avoid cheap bullshit - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - NPC.velocity.X *= 0.93f; NPC.velocity.Y *= 0.93f; @@ -554,7 +531,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs index 0ad70b310e..8c72841b5b 100644 --- a/NPCs/CalClone/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -40,9 +40,8 @@ namespace CalamityMod.NPCs.CalClone NPC.height = 40; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.defense = 10; - NPC.DR_NERD(0.1f); NPC.lifeMax = CalamityWorld.death ? 1500 : 2500; if (BossRushEvent.BossRushActive) { @@ -115,8 +114,7 @@ namespace CalamityMod.NPCs.CalClone Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 1f, parent.target, 1f, 0f, projectileSpeed * 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, CalamitasClone.DartDamage, 1f, parent.target, 1f, 0f, projectileSpeed * 2f); } timer = 0; } 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 58619fd79b..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.75; - - 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) @@ -1371,115 +1085,28 @@ namespace CalamityMod.NPCs { #region Setup Vanilla DR Values DRValues = new SortedDictionary { - { NPCID.AngryBonesBig, 0.2f }, - { NPCID.AngryBonesBigHelmet, 0.2f }, - { NPCID.AngryBonesBigMuscle, 0.2f }, - { NPCID.AnomuraFungus, 0.1f }, - { NPCID.Antlion, 0.1f }, - { NPCID.Arapaima, 0.1f }, - { NPCID.ArmoredSkeleton, 0.15f }, - { NPCID.ArmoredViking, 0.1f }, - { NPCID.BigMimicCorruption, 0.3f }, - { NPCID.BigMimicCrimson, 0.3f }, - { NPCID.BigMimicHallow, 0.3f }, - { NPCID.BigMimicJungle, 0.3f }, - { NPCID.BlueArmoredBones, 0.2f }, - { NPCID.BlueArmoredBonesMace, 0.2f }, - { NPCID.BlueArmoredBonesNoPants, 0.2f }, - { NPCID.BlueArmoredBonesSword, 0.2f }, - { NPCID.BoneLee, 0.2f }, - { NPCID.Crab, 0.05f }, - { NPCID.Crawdad, 0.2f }, - { NPCID.Crawdad2, 0.2f }, { NPCID.CultistBoss, 0.15f }, - { NPCID.Deerclops, 0.05f }, - { NPCID.DD2Betsy, 0.1f }, - { NPCID.DD2OgreT2, 0.1f }, - { NPCID.DD2OgreT3, 0.15f }, - { NPCID.DeadlySphere, 0.4f }, - { NPCID.DiabolistRed, 0.2f }, - { NPCID.DiabolistWhite, 0.2f }, { NPCID.DukeFishron, 0.15f }, { NPCID.DungeonGuardian, 0.9f }, - { NPCID.DungeonSpirit, 0.2f }, - { NPCID.ElfCopter, 0.15f }, - { NPCID.Everscream, 0.1f }, - { NPCID.FlyingAntlion, 0.05f }, - { NPCID.GiantCursedSkull, 0.2f }, - { NPCID.GiantShelly, 0.2f }, - { NPCID.GiantShelly2, 0.2f }, - { NPCID.GiantTortoise, 0.35f }, { NPCID.Golem, 0.15f }, { NPCID.GolemFistLeft, 0.15f }, { NPCID.GolemFistRight, 0.15f }, { NPCID.GolemHead, 0.15f }, - { NPCID.GolemHeadFree, 0.15f }, - { NPCID.GraniteFlyer, 0.1f }, - { NPCID.GraniteGolem, 0.15f }, - { NPCID.GreekSkeleton, 0.1f }, - { NPCID.HellArmoredBones, 0.2f }, - { NPCID.HellArmoredBonesMace, 0.2f }, - { NPCID.HellArmoredBonesSpikeShield, 0.2f }, - { NPCID.HellArmoredBonesSword, 0.2f }, - { NPCID.IceGolem, 0.1f }, - { NPCID.IceQueen, 0.1f }, - { NPCID.IceTortoise, 0.35f }, - { NPCID.HeadlessHorseman, 0.05f }, - { NPCID.MartianDrone, 0.2f }, - { NPCID.MartianSaucer, 0.2f }, - { NPCID.MartianSaucerCannon, 0.2f }, - { NPCID.MartianSaucerCore, 0.2f }, - { NPCID.MartianSaucerTurret, 0.2f }, - { NPCID.MartianTurret, 0.2f }, - { NPCID.MartianWalker, 0.35f }, - { NPCID.Mimic, 0.3f }, { NPCID.MoonLordCore, 0.15f }, { NPCID.MoonLordHand, 0.15f }, { NPCID.MoonLordHead, 0.15f }, - { NPCID.Mothron, 0.2f }, - { NPCID.MothronEgg, 0.5f }, - { NPCID.MourningWood, 0.1f }, - { NPCID.Necromancer, 0.2f }, - { NPCID.NecromancerArmored, 0.2f }, - { NPCID.Paladin, 0.45f }, - { NPCID.PirateCaptain, 0.05f }, - { NPCID.PirateShipCannon, 0.15f }, { NPCID.Plantera, 0.15f }, - { NPCID.PlanterasTentacle, 0.1f }, { NPCID.HallowBoss, 0.15f }, - { NPCID.PossessedArmor, 0.25f }, - { NPCID.PresentMimic, 0.3f }, { NPCID.PrimeCannon, 0.2f }, { NPCID.PrimeLaser, 0.2f }, { NPCID.PrimeSaw, 0.2f }, { NPCID.PrimeVice, 0.2f }, - { NPCID.Probe, 0.2f }, - { NPCID.Pumpking, 0.1f }, - { NPCID.QueenBee, 0.05f }, - { NPCID.RaggedCaster, 0.2f }, - { NPCID.RaggedCasterOpenCoat, 0.2f }, { NPCID.Retinazer, 0.2f }, - { NPCID.RustyArmoredBonesAxe, 0.2f }, - { NPCID.RustyArmoredBonesFlail, 0.2f }, - { NPCID.RustyArmoredBonesSword, 0.2f }, - { NPCID.RustyArmoredBonesSwordNoArmor, 0.2f }, - { NPCID.SandElemental, 0.1f }, - { NPCID.SantaNK1, 0.35f }, - { NPCID.SeaSnail, 0.05f }, - { NPCID.SkeletonArcher, 0.1f }, - { NPCID.SkeletonCommando, 0.2f }, - { NPCID.SkeletonSniper, 0.2f }, - { NPCID.SkeletronHand, 0.05f }, - { NPCID.SkeletronHead, 0.05f }, { NPCID.SkeletronPrime, 0.2f }, { NPCID.Spazmatism, 0.2f }, - { NPCID.TacticalSkeleton, 0.2f }, { NPCID.TheDestroyer, 0.1f }, { NPCID.TheDestroyerBody, 0.2f }, { NPCID.TheDestroyerTail, 0.35f }, - { NPCID.TheHungry, 0.1f }, - { NPCID.UndeadViking, 0.1f }, - { NPCID.WalkingAntlion, 0.1f }, { NPCID.WallofFlesh, 0.15f }, }; #endregion @@ -1623,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; } @@ -1643,8 +1270,6 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) BossRushStatChanges(npc, Mod); - BossValueChanges(npc); - if (CalamityWorld.revenge) RevDeathStatChanges(npc, Mod); @@ -1668,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 @@ -1709,7 +1342,7 @@ namespace CalamityMod.NPCs break; case NPCID.Golem: - npc.lifeMax = 30000; + npc.lifeMax = 40000; break; case NPCID.GolemHead: @@ -1774,30 +1407,19 @@ 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; } } #endregion - #region Boss Value Changes - private void BossValueChanges(NPC npc) - { - if (BossValueDict.TryGet(npc.type, out var value)) - { - npc.value = value; - } - } - #endregion - #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) @@ -1829,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) { @@ -1850,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; @@ -1931,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); @@ -1953,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; } @@ -2027,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; @@ -2667,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 @@ -2676,14 +2495,7 @@ namespace CalamityMod.NPCs { EditGlobalCoinDrops(npc); - // Put this first so that any boss damage value modifications aren't reset - bool vanillaNPC = npc.type < NPCID.Count; - if (vanillaNPC && NPCStats.EnemyStats.ContactDamageValues.ContainsKey(npc.type)) - { - npc.GetNPCDamage(); - npc.defDamage = npc.damage; - } - 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); @@ -2695,43 +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.SkeletronHand: case NPCID.WallofFlesh: - case NPCID.TheHungry: - case NPCID.TheHungryII: case NPCID.Spazmatism: case NPCID.Retinazer: case NPCID.TheDestroyer: @@ -2746,19 +2529,13 @@ namespace CalamityMod.NPCs case NPCID.GolemFistLeft: case NPCID.GolemFistRight: case NPCID.CultistDragonHead: - case NPCID.AncientCultistSquidhead: - case NPCID.AncientLight: case NPCID.DD2OgreT2: case NPCID.DD2OgreT3: case NPCID.DD2Betsy: 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: @@ -2767,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; @@ -2789,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; @@ -2829,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: @@ -2890,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); @@ -2900,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); @@ -2927,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; @@ -2935,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; @@ -2960,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; @@ -3072,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 @@ -3170,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. @@ -3179,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) @@ -3241,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; @@ -3350,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. @@ -3387,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 @@ -3411,10 +3191,6 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.BloodNautilus) return DreadnautilusAI.BuffedDreadnautilusAI(npc, Mod); - // More telegraphs - if (npc.type == NPCID.SpikedIceSlime || npc.type == NPCID.SpikedJungleSlime || npc.type == NPCID.SlimeSpiked) - return SlimeAI.BuffedSlimeAI(npc, Mod); - // Decrease the projectile velocities of several fighter enemies and make them better to fight in general // Also limit the amount of times Vortex Larvae and Hornets can evolve if (npc.type == NPCID.IceGolem || npc.type == NPCID.Eyezor || npc.type == NPCID.VortexRifleman || @@ -3678,6 +3454,8 @@ namespace CalamityMod.NPCs case NPCID.ToxicSludge: case NPCID.IceSlime: case NPCID.Crimslime: + case NPCID.SpikedIceSlime: + case NPCID.SpikedJungleSlime: case NPCID.UmbrellaSlime: case NPCID.RainbowSlime: case NPCID.SlimeMasked: @@ -3687,6 +3465,7 @@ namespace CalamityMod.NPCs case NPCID.SlimeRibbonGreen: case NPCID.SlimeRibbonRed: case NPCID.SandSlime: + case NPCID.SlimeSpiked: case NPCID.GoldenSlime: case NPCID.ShimmerSlime: return SlimeAI.BuffedSlimeAI(npc, Mod); @@ -4652,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; @@ -4670,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: @@ -4692,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; @@ -4726,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: @@ -4769,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; @@ -4881,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--; @@ -5184,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) @@ -5231,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) @@ -5260,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) @@ -5276,7 +4886,7 @@ namespace CalamityMod.NPCs velocitySlownessFactor += baseSlownessFactor; } - if (tesla > 0) + if (galvanicCorrosion) { float baseSlownessFactor = 0.05f; if (VulnerableToElectricity.HasValue) @@ -5289,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. @@ -5413,21 +5023,6 @@ namespace CalamityMod.NPCs switch (npc.type) { - case NPCID.VileSpitEaterOfWorlds: - case NPCID.VileSpit: - - target.AddBuff(BuffType(), 180); - if (Main.rand.NextBool(10)) - target.AddBuff(BuffID.Weak, 3600); - else if (Main.rand.NextBool(5)) - target.AddBuff(BuffID.Weak, 720); - else if (Main.rand.NextBool(2)) - target.AddBuff(BuffID.Weak, 120); - else - target.AddBuff(BuffID.Weak, 60); - - break; - case NPCID.DevourerHead: case NPCID.FaceMonster: target.AddBuff(BuffID.Weak, 180); @@ -5443,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; @@ -5487,60 +5064,17 @@ namespace CalamityMod.NPCs target.AddBuff(BuffType(), 120); break; - case NPCID.EyeofCthulhu: - if (npc.ai[0] > 2f) - target.AddBuff(BuffID.Bleeding, 180); - break; - - case NPCID.WallofFlesh: - target.AddBuff(BuffID.Bleeding, 300); - break; - - case NPCID.Spazmatism: - if (npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) - target.AddBuff(BuffType(), 180); - break; - - case NPCID.SkeletronPrime: - if (npc.ai[1] == 1f || npc.ai[1] == 2f) - target.AddBuff(BuffType(), 180); - break; - - case NPCID.PrimeSaw: - target.AddBuff(BuffType(), 120); - break; - - case NPCID.Plantera: - if (npc.life < npc.lifeMax / 2) - target.AddBuff(BuffID.Poisoned, 360); - break; - - case NPCID.PlanterasTentacle: - target.AddBuff(BuffID.Poisoned, 180); - break; - case NPCID.Golem: - target.AddBuff(BuffType(), 480); + if (CalamityWorld.revenge) + target.AddBuff(BuffType(), 480); break; case NPCID.GolemHead: case NPCID.GolemHeadFree: case NPCID.GolemFistRight: case NPCID.GolemFistLeft: - target.AddBuff(BuffType(), 240); - break; - - case NPCID.DukeFishron: - target.AddBuff(BuffType(), 180); - break; - - case NPCID.AncientLight: - target.AddBuff(BuffType(), 120); - break; - - case NPCID.HallowBoss: - if (NPC.ShouldEmpressBeEnraged()) - target.AddBuff(BuffType(), 360); + if (CalamityWorld.revenge) + target.AddBuff(BuffType(), 240); break; case NPCID.BloodNautilus: @@ -5567,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) { @@ -5690,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; @@ -5842,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; @@ -5964,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); } @@ -6018,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); } @@ -6094,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); @@ -6102,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) @@ -6116,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; @@ -6127,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; @@ -6141,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) { @@ -6313,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); } @@ -6393,6 +5901,12 @@ namespace CalamityMod.NPCs maxSpawns = (int)(maxSpawns * 10f); } + if (CalamityWorld.death && player.ZoneGraveyard) + { + spawnRate = (int)(spawnRate * 0.6); + maxSpawns = (int)(maxSpawns * 1.5f); + } + if (NPC.LunarApocalypseIsUp) { if ((player.ZoneTowerNebula && NPC.ShieldStrengthTowerNebula == 0) || (player.ZoneTowerStardust && NPC.ShieldStrengthTowerStardust == 0) || @@ -6663,6 +6177,15 @@ namespace CalamityMod.NPCs } } + // Increased Maggot Zombie,the Groom, and the Bride spawn rates in a Graveyard + if (spawnInfo.Player.ZoneGraveyard) + { + pool[NPCID.MaggotZombie] = SpawnCondition.OverworldNightMonster.Chance * 0.2f; + pool[NPCID.TheGroom] = SpawnCondition.OverworldNightMonster.Chance * 0.035f; + pool[NPCID.TheBride] = SpawnCondition.OverworldNightMonster.Chance * 0.035f; + + } + // Disable vanilla spawns while in the Brimstone Crag if (calamityBiomeZone) { @@ -6816,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) { @@ -6831,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 @@ -6856,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); @@ -6946,7 +6478,7 @@ namespace CalamityMod.NPCs } } - if (laceration > 0) + if (laceration) Laceration.DrawEffects(npc, ref drawColor); if (laserBurnTimer > 0) @@ -6972,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) @@ -7014,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) { @@ -7059,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; } @@ -7097,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) @@ -7123,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) @@ -7204,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() { }; @@ -7215,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); @@ -7257,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); @@ -7324,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; @@ -7350,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 @@ -7387,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)) @@ -7402,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; @@ -7550,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) @@ -7559,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; @@ -7651,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]; @@ -7822,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); @@ -8353,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]; @@ -8396,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 a330471fdd..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 @@ -274,8 +268,16 @@ namespace CalamityMod.NPCs // Dreamer Ghoul // Trifold Map @ 1% Normal, 2% Expert+ + // Light Shard @ 10% case NPCID.DesertGhoulHallow: npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.TrifoldMap, 100, 50)); + npcLoot.ChangeDropRate(ItemID.LightShard, 1, 10); + break; + + // Crystal Thresher + // Light Shard @ 10% + case NPCID.SandsharkHallow: + npcLoot.ChangeDropRate(ItemID.LightShard, 1, 10); break; // Sand Elemental @@ -283,10 +285,19 @@ 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; + + // Tainted Ghoul, Vile Ghoul, Bone Biter, Flesh Reaver + // Dark Shard @ 10% + case NPCID.DesertGhoulCorruption: + case NPCID.DesertGhoulCrimson: + case NPCID.SandsharkCorrupt: + case NPCID.SandsharkCrimson: + npcLoot.ChangeDropRate(ItemID.DarkShard, 1, 10); + break; #endregion #region Ice @@ -448,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; @@ -466,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: @@ -545,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% @@ -678,19 +684,20 @@ namespace CalamityMod.NPCs #endregion #region Graveyard - // Alternate Blood Orb obtainment methods (10%) + // Alternate Blood Orb obtainment methods (20%) case NPCID.MaggotZombie: + postEoC.Add(ModContent.ItemType(), 5); + break; + + // 100%, 3-6 each case NPCID.TheBride: case NPCID.TheGroom: - postEoC.Add(ModContent.ItemType(), 10); + postEoC.Add(ModContent.ItemType(), 1, 3, 6); 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 @@ -708,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; @@ -792,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 @@ -976,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 @@ -1134,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 @@ -1156,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 @@ -1281,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); @@ -1486,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); @@ -1881,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 } @@ -1930,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 561abf5e14..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; @@ -188,6 +189,7 @@ namespace CalamityMod.NPCs "Captain J. Crackers", // <@!233232602994049024> (qyuuno) "Gol D. Roger", // <@!256228859110752257> (xtra3678) "Yarrim", // <@!290061123137306624> (borb9834) + "Hector Barbossa", // <@!615704209303797790> (thatrockisfullamagic) }; private static readonly string[] PrincessNames = { @@ -203,6 +205,7 @@ namespace CalamityMod.NPCs private static readonly string[] SantaClausNames = { "Jank", // <@!339950757472239616> (jankle_) + "Aoi Kurashiki", // <@!358411687885537291> (nothinpurrsonal) }; private static readonly string[] SkeletonMerchantNames = { @@ -229,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 = { @@ -245,8 +249,9 @@ namespace CalamityMod.NPCs private static readonly string[] TravelingMerchantNames = { "Stan Pines", - "Slap Battles", // <@!923504188615450654> (gravityglider.) + "Intergaze", // <@!923504188615450654> (intergaze) "Borgus", // <@!539127427482255376> (therealmeepman) + "Postman Hiss", // <@!454638106122125312> (karinthefairy) }; private static readonly string[] TruffleNames = { @@ -1079,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) @@ -1145,97 +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 roguePlayer = CalamityConditions.PlayerHasRogueArmor; - Condition wingedPlayer = CalamityConditions.PlayerHasWings; - Condition revengeance = CalamityConditions.InRevengeanceMode; - Condition drunk = CalamityConditions.PlayerAlcoholPoisoned; - Condition downedPolterghast = CalamityConditions.DownedPolterghast; - Condition downedDoG = CalamityConditions.DownedDevourerOfGods; + Condition bestiaryProgressLacewing = new(CalamityUtils.GetText("Condition.LacewingBestiary"), () => Main.GetBestiaryProgressReport().CompletionPercent >= 0.4f); 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: 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); + shop.AddWithCustomValue(ItemType(), Item.buyPrice(gold: 20), Condition.DownedSkeletron) + .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) @@ -1245,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) @@ -1291,33 +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) - .AddWithCustomValue(ItemID.EmpressButterfly, Item.buyPrice(gold: 15), Condition.InHallow) - .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: 10), Condition.DownedPlantera); + shop.Add(ItemID.EmpressButterfly, bestiaryProgressLacewing); } if (type == NPCID.Truffle) { - shop.Add(ItemType()); + shop.Add(); } } @@ -1336,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 5d3adf1ca8..a424a7349b 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -61,16 +61,19 @@ namespace CalamityMod.NPCs.CeaselessVoid } } + public static int BeamPortalDamage = 60; // 240 + public static int DarkEnergyProjectileDamage = 60; // 240 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 180; // 360 NPC.npcSlots = 36f; NPC.width = 100; NPC.height = 100; NPC.defense = 80; NPC.Calamity().DR = 0.5f; NPC.LifeMaxNERB(65000, 78000, 72000); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -153,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 @@ -186,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; @@ -211,24 +211,18 @@ namespace CalamityMod.NPCs.CeaselessVoid else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - float tileEnrageMult = (CalamityWorld.LegendaryMode && revenge) ? 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.LegendaryMode && revenge) ? 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) @@ -347,11 +341,10 @@ namespace CalamityMod.NPCs.CeaselessVoid float degrees = 360 / numBeamPortals; float beamPortalDistance = death ? 400f : revenge ? 420f : expertMode ? 440f : 480f; int type = ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < numBeamPortals; i++) { float ai1 = i * degrees; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, damage, 0f, Main.myPlayer, ai1, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, BeamPortalDamage, 0f, Main.myPlayer, ai1, 0f); } } } @@ -377,7 +370,6 @@ namespace CalamityMod.NPCs.CeaselessVoid if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileType(); - int damage = NPC.GetProjectileDamage(type); bool normalSpread = NPC.localAI[0] % 2f == 0f; float speed = 0.5f; int totalProjectiles = 4; @@ -387,7 +379,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { Vector2 spawnVector = NPC.Center + Vector2.Normalize(spinningPoint.RotatedBy(MathHelper.TwoPi / totalProjectiles * i + radialOffset)) * suckDistance; Vector2 velocity = Vector2.Normalize(NPC.Center - spawnVector) * speed; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, DarkEnergyProjectileDamage, 0f, Main.myPlayer); } } @@ -405,7 +397,6 @@ namespace CalamityMod.NPCs.CeaselessVoid if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileType(); - int damage = NPC.GetProjectileDamage(type); bool normalSpread = NPC.localAI[0] % 2f != 0f; float speed = 2f; int totalProjectiles = 2; @@ -419,7 +410,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { Vector2 spawnVector = NPC.Center + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; Vector2 velocity = Vector2.Normalize(NPC.Center - spawnVector) * speed; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, DarkEnergyProjectileDamage, 0f, Main.myPlayer); } } } @@ -436,7 +427,6 @@ namespace CalamityMod.NPCs.CeaselessVoid if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileType(); - int damage = NPC.GetProjectileDamage(type); bool normalSpread = NPC.localAI[0] % 2f == 0f; float speed = 4f; int totalProjectiles = 2; @@ -450,7 +440,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { Vector2 spawnVector = NPC.Center + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; Vector2 velocity = Vector2.Normalize(NPC.Center - spawnVector) * speed; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, DarkEnergyProjectileDamage, 0f, Main.myPlayer); } } } @@ -532,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) @@ -549,7 +539,7 @@ namespace CalamityMod.NPCs.CeaselessVoid acceleration *= 5f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -559,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; @@ -582,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) { @@ -816,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 d22ab0e890..f147f52a7f 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -45,9 +45,9 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.dontTakeDamage = true; NPC.width = NPC.height = HitboxSize; NPC.defense = 50; @@ -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); @@ -279,7 +276,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (Main.zenithWorld) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Obstructed, 30, true); + target.AddBuff(BuffID.Blackout, 30, true); } } diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 23b2b6aaad..665ccc03c2 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -28,17 +28,15 @@ namespace CalamityMod.NPCs.Crabulon public override void SetDefaults() { NPC.aiStyle = -1; - NPC.GetNPCDamage(); + 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 9f15b00127..531fdd9487 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -73,11 +73,13 @@ namespace CalamityMod.NPCs.Crabulon } } + public static int MushroomShotDamage = 9; // 36 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 40; // 64 (1.6x expert scaling) NPC.npcSlots = 14f; - NPC.GetNPCDamage(); NPC.width = 196; NPC.height = 196; NPC.defense = 8; @@ -88,14 +90,14 @@ namespace CalamityMod.NPCs.Crabulon NPC.noTileCollide = false; NPC.boss = true; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 5, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.HitSound = HitSound; NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.scale *= 1.5f; NPC.defense += 12; @@ -181,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; @@ -236,7 +212,7 @@ namespace CalamityMod.NPCs.Crabulon { float yVelocity = death ? 1f : expertMode ? 2.5f : 4f; Vector2 projectileVelocity = (Vector2.Normalize(player.Center - NPC.Center) * mushBombSpeed) - Vector2.UnitY * yVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -274,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; @@ -405,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; @@ -513,7 +489,6 @@ namespace CalamityMod.NPCs.Crabulon SoundEngine.PlaySound(SlamSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if ((NPC.ai[2] % 2f == 0f || death) && ((phase2 && revenge) || (phase3 && expertMode))) { @@ -532,7 +507,7 @@ namespace CalamityMod.NPCs.Crabulon { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Vector2 randomVelocityVector = new Vector2((Main.rand.NextFloat() - 0.5f) * 4f, (Main.rand.NextFloat() - 0.5f) * 4f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -557,7 +532,7 @@ namespace CalamityMod.NPCs.Crabulon { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Vector2 randomVelocityVector = new Vector2((Main.rand.NextFloat() - 0.5f) * 4f, (Main.rand.NextFloat() - 0.5f) * 4f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -639,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) @@ -709,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; @@ -719,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) @@ -728,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); @@ -736,7 +712,6 @@ namespace CalamityMod.NPCs.Crabulon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float yVelocity = death ? 3f : 2f; if (death) { @@ -746,11 +721,11 @@ namespace CalamityMod.NPCs.Crabulon for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = initialVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } else - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.UnitY * yVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.UnitY * yVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -770,7 +745,6 @@ namespace CalamityMod.NPCs.Crabulon NPC.netUpdate = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -780,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, damage, 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, damage, 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) @@ -872,7 +846,6 @@ namespace CalamityMod.NPCs.Crabulon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int maxColumns = 5; int mushroomsPerColumn = 8; Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(210f, 8f); @@ -885,7 +858,7 @@ namespace CalamityMod.NPCs.Crabulon for (int j = 0; j < mushroomsPerColumn; j++) { initialVelocity += Vector2.UnitX * Main.rand.NextFloat(-0.5f, 0.5f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(70f * (i + 1), 0f), -(initialVelocity - ((j / (float)mushroomsPerColumn) * initialVelocity)), type, damage, 0f, Main.myPlayer, 1f, NPC.Bottom.Y - 16f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(70f * (i + 1), 0f), -(initialVelocity - ((j / (float)mushroomsPerColumn) * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer, 1f, NPC.Bottom.Y - 16f); } initialVelocity = Vector2.UnitY * 16f; @@ -903,17 +876,16 @@ namespace CalamityMod.NPCs.Crabulon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float xVelocity = death ? 3f : 1.5f; int numProj = 3; Vector2 initialVelocity = Vector2.UnitX * xVelocity; 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, 41), 0f), initialVelocity - ((i / (float)numProj) * initialVelocity), type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 41), 0f), 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, 41), 0f), -(initialVelocity - ((i / (float)numProj) * initialVelocity)), type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation - new Vector2(Main.rand.Next(0, 41), 0f), -(initialVelocity - ((i / (float)numProj) * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer); } float playerLocation = NPC.Center.X - player.Center.X; @@ -978,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; @@ -990,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); } @@ -1258,7 +1230,7 @@ namespace CalamityMod.NPCs.Crabulon public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 1768c85347..bdd3bce54c 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -29,10 +29,10 @@ namespace CalamityMod.NPCs.Crags NPC.width = 30; NPC.height = 30; NPC.defense = 12; - NPC.lifeMax = 180; + NPC.lifeMax = 140; NPC.knockBackResist = 0.75f; AnimationType = NPCID.DemonEye; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; if (DownedBossSystem.downedProvidence) diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index 4f1da73435..62d3df7ee4 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -35,10 +35,9 @@ namespace CalamityMod.NPCs.Crags NPC.width = 66; NPC.height = 64; NPC.defense = 38; - NPC.DR_NERD(0.35f); NPC.lifeMax = 180; NPC.knockBackResist = 0.1f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.NPCDeath14; NPC.behindTiles = true; diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index 526a94c7f0..cfc7c0469f 100644 --- a/NPCs/Crags/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 8; NPC.lifeMax = 50; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.noGravity = true; diff --git a/NPCs/Crags/InfernalCongealment.cs b/NPCs/Crags/InfernalCongealment.cs index fa13faf64c..4cfd936e34 100644 --- a/NPCs/Crags/InfernalCongealment.cs +++ b/NPCs/Crags/InfernalCongealment.cs @@ -25,11 +25,11 @@ namespace CalamityMod.NPCs.Crags NPC.damage = 40; NPC.width = 40; NPC.height = 30; - NPC.defense = 10; - NPC.lifeMax = 380; + NPC.defense = 30; + NPC.lifeMax = 250; NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = true; NPC.noGravity = false; diff --git a/NPCs/Crags/RenegadeWarlock.cs b/NPCs/Crags/RenegadeWarlock.cs index 34346d250a..bcccb39aeb 100644 --- a/NPCs/Crags/RenegadeWarlock.cs +++ b/NPCs/Crags/RenegadeWarlock.cs @@ -26,11 +26,11 @@ namespace CalamityMod.NPCs.Crags NPC.width = 18; NPC.height = 40; NPC.defense = 16; - NPC.lifeMax = 100; + NPC.lifeMax = 300; NPC.knockBackResist = 0.5f; AnimationType = NPCID.ZombieXmas; AIType = NPCID.ChaosElemental; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath50; if (DownedBossSystem.downedProvidence) diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 3b102b0c63..8fc4cdedc4 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -32,10 +32,10 @@ namespace CalamityMod.NPCs.Crags NPC.width = 80; NPC.height = 80; NPC.defense = 18; - NPC.lifeMax = 120; + NPC.lifeMax = 160; NPC.alpha = 100; NPC.knockBackResist = 0.7f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit49; NPC.DeathSound = SoundID.NPCDeath51; NPC.noGravity = true; diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 9bb4bafb9f..e81d366f5d 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -23,10 +23,10 @@ namespace CalamityMod.NPCs.Crags NPC.width = 80; NPC.height = 80; NPC.defense = 10; - NPC.lifeMax = 75; + NPC.lifeMax = 100; NPC.alpha = 100; NPC.knockBackResist = 0.9f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit49; NPC.DeathSound = SoundID.NPCDeath51; NPC.noGravity = true; diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 3243ce624d..e90d2850ea 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -40,10 +40,9 @@ namespace CalamityMod.NPCs.Crags NPC.width = 40; NPC.height = 40; NPC.defense = 30; - NPC.DR_NERD(0.15f); NPC.lifeMax = 80; NPC.knockBackResist = 0.65f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.noGravity = true; NPC.lavaImmune = true; NPC.HitSound = SoundID.NPCHit4; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 06023f7ed4..cbcfad9450 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -89,11 +89,15 @@ namespace CalamityMod.NPCs.Cryogen } } + public static int IceBlastDamage = 23; // 92; Also applies to GFB darts + public static int IceRainDamage = 23; // 92; Also applies to GFB darts + public static int IceBombDamage = 30; // 120; Also applies to GFB fireblasts + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 69; // 138 NPC.npcSlots = 24f; - NPC.GetNPCDamage(); NPC.width = 86; NPC.height = 88; NPC.defense = 15; @@ -102,7 +106,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 16, 0, 0); + NPC.value = Item.buyPrice(gold: 6); NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); NPC.noGravity = true; @@ -111,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) @@ -184,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; @@ -287,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)) @@ -315,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; @@ -343,7 +326,6 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 3; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBomb; - int damage = NPC.GetProjectileDamage(type); float velocity = 2f + NPC.ai[0]; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -352,7 +334,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBombDamage, 0f, Main.myPlayer); } } } @@ -378,8 +360,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 16; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); - float velocity = 9f + enrageScale; + float velocity = death ? 9.5f : 9f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity * 2f; @@ -388,7 +369,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } @@ -399,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); @@ -454,8 +434,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); - float velocity2 = 9f + enrageScale; + float velocity2 = death ? 9.5f : 9f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity2 * 2f; @@ -464,16 +443,14 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } } - 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) { @@ -531,8 +508,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - int damage = NPC.GetProjectileDamage(type); - 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); @@ -552,7 +528,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectilesShot; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceRainDamage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); } } } @@ -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,8 +628,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); - float velocity = 9f + enrageScale; + float velocity = death ? 9.5f : 9f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity * 2f; @@ -662,7 +637,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } @@ -673,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); @@ -701,8 +675,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - int damage = NPC.GetProjectileDamage(type); - 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); @@ -722,7 +695,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectilesShot; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceRainDamage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); } } } @@ -741,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) { @@ -815,8 +788,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); - float velocity = 10f + enrageScale; + float velocity = death ? 10.5f : 10f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity * 2f; @@ -825,7 +797,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } @@ -836,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); @@ -920,8 +891,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - int damage = NPC.GetProjectileDamage(type); - float velocity = 9f + enrageScale; + float velocity = death ? 9.5f : 9f; for (int i = 0; i < 3; i++) { int totalProjectiles = 6; @@ -942,7 +912,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceRainDamage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); } } } @@ -1012,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)) { @@ -1021,8 +991,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); - 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++) { @@ -1045,7 +1014,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, ai, type == ModContent.ProjectileType() ? 0f : 1f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, ai, type == ModContent.ProjectileType() ? 0f : 1f, projectileVelocityToPass); } } } @@ -1089,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; @@ -1123,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); @@ -1156,7 +1125,6 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 2; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBomb; - int damage = NPC.GetProjectileDamage(type); float velocity2 = 6f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -1165,7 +1133,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBombDamage, 0f, Main.myPlayer); } } @@ -1180,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) { @@ -1334,7 +1300,6 @@ namespace CalamityMod.NPCs.Cryogen public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void ModifyTypeName(ref string typeName) @@ -1499,15 +1464,9 @@ namespace CalamityMod.NPCs.Cryogen if (hurtInfo.Damage > 0) { if (Main.zenithWorld) - { - target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); - } else - { - target.AddBuff(BuffID.Frostburn, 360); target.AddBuff(BuffID.Chilled, 120); - } } } } diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index 47ec58b979..a2befaa003 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -24,14 +24,14 @@ namespace CalamityMod.NPCs.Cryogen public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 60; // 120 NPC.aiStyle = -1; AIType = -1; NPC.noTileCollide = true; NPC.coldDamage = true; - NPC.GetNPCDamage(); 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; @@ -115,15 +115,9 @@ namespace CalamityMod.NPCs.Cryogen if (hurtInfo.Damage > 0) { if (Main.zenithWorld) - { - target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); - } else - { - target.AddBuff(BuffID.Frostburn, 360); target.AddBuff(BuffID.Chilled, 120); - } } } diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 7b7f3161dc..d696d93a50 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -39,17 +39,17 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 88; 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; @@ -166,28 +166,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2; NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * segmentOffset; NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt(); - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHead.SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? DesertNuisanceHead.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHead.SegmentVelocity_Death : - DesertNuisanceHead.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CheckActive() => false; diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index 4e439250e7..74ab964b4a 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -39,17 +39,17 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 78; 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; @@ -174,28 +174,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2; NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * segmentOffset; NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt(); - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHeadYoung.SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? DesertNuisanceHeadYoung.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHeadYoung.SegmentVelocity_Death : - DesertNuisanceHeadYoung.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CheckActive() => false; diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 3cf5fa073e..d3be799c43 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -53,18 +53,18 @@ namespace CalamityMod.NPCs.DesertScourge { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + 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; @@ -453,19 +447,6 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.Distance(destination) > (getMad ? 750f : 1000f)) NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -596,6 +577,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.7f * balance); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index ed6fa99406..0b8353912f 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -45,18 +45,18 @@ namespace CalamityMod.NPCs.DesertScourge { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + 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; @@ -171,7 +171,6 @@ namespace CalamityMod.NPCs.DesertScourge float rotation = MathHelper.ToRadians(spread); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); @@ -184,7 +183,7 @@ namespace CalamityMod.NPCs.DesertScourge if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, DesertScourgeHead.SpitDamage, 0f, Main.myPlayer); Main.projectile[proj].aiStyle = -1; Main.projectile[proj].netUpdate = true; } @@ -199,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; @@ -307,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); @@ -334,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; @@ -489,19 +482,6 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.Distance(destination) > (getMad ? 750f : 1000f)) NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -634,6 +614,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.7f * balance); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index f21ea1e2e2..56ce8db014 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -21,17 +21,17 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 88; 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; @@ -130,28 +130,6 @@ namespace CalamityMod.NPCs.DesertScourge else if (playerXPos > 0f) NPC.spriteDirection = -1; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHead.SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? DesertNuisanceHead.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHead.SegmentVelocity_Death : - DesertNuisanceHead.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index fbab588d70..5b6bc7ee94 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -21,17 +21,17 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 78; 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; @@ -138,28 +138,6 @@ namespace CalamityMod.NPCs.DesertScourge else if (playerXPos > 0f) NPC.spriteDirection = -1; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHeadYoung.SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? DesertNuisanceHeadYoung.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHeadYoung.SegmentVelocity_Death : - DesertNuisanceHeadYoung.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index a584771be0..916fa6ba25 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -43,15 +43,14 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 16; // 32 NPC.width = 104; NPC.height = 104; NPC.defense = 6; - NPC.DR_NERD(0.05f); 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; @@ -65,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; @@ -210,30 +209,6 @@ namespace CalamityMod.NPCs.DesertScourge bool burrow = head.Calamity().newAI[0] >= burrowTimeGateValue; bool lungeUpward = burrow && head.Calamity().newAI[1] == 1f; bool quickFall = head.Calamity().newAI[1] == 2f; - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertScourgeHead.SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? DesertScourgeHead.SegmentVelocity_GoodWorld : - death ? DesertScourgeHead.SegmentVelocity_Death : - expertMode ? DesertScourgeHead.SegmentVelocity_Expert : - DesertScourgeHead.SegmentVelocity_Normal; - if (burrow || lungeUpward) - maxChaseSpeed *= 1.5f; - if (expertMode) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity || NPC.dontTakeDamage) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index dc6f2e09ea..8ade55c3dc 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -84,23 +84,25 @@ namespace CalamityMod.NPCs.DesertScourge NPCID.Sets.MPAllowedEnemies[Type] = true; } + public static int SpitDamage = 10; // 40 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 64 (1.6x expert scaling) NPC.defense = 4; NPC.npcSlots = 12f; NPC.width = 104; 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; NPC.boss = true; - NPC.value = Item.buyPrice(0, 2, 0, 0); + NPC.value = Item.buyPrice(gold: 1); NPC.alpha = 255; NPC.behindTiles = true; NPC.noGravity = true; @@ -109,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; @@ -252,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; @@ -305,12 +306,11 @@ namespace CalamityMod.NPCs.DesertScourge if (death) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < 7; i++) { Vector2 sandSpitPos = new Vector2((i - 2) * 16f, -Math.Abs((i - 2) * 16f)); Vector2 sandSpitVelocity = ((sandSplashSpawnPos + Vector2.UnitY * 80f) - (sandSplashSpawnPos + sandSpitPos)).SafeNormalize(Vector2.UnitY) * -((Math.Abs(i - 3) + 1) * 3f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, SpitDamage, 0f, Main.myPlayer); } } } @@ -360,12 +360,11 @@ namespace CalamityMod.NPCs.DesertScourge if (death) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < 7; i++) { Vector2 sandSpitPos = new Vector2((i - 2) * 16f, -Math.Abs((i - 2) * 16f)); Vector2 sandSpitVelocity = ((sandSplashSpawnPos + Vector2.UnitY * 80f) - (sandSplashSpawnPos + sandSpitPos)).SafeNormalize(Vector2.UnitY) * -((Math.Abs(i - 3) + 1) * 3f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, SpitDamage, 0f, Main.myPlayer); } } } @@ -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,15 +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(); - int damage = NPC.GetProjectileDamage(type); 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++) { @@ -617,7 +615,7 @@ namespace CalamityMod.NPCs.DesertScourge } if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, SpitDamage, 0f, Main.myPlayer); } NPC.TargetClosest(); @@ -802,26 +800,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (hide) - { - NPC.damage = 0; - } - else - { - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -1067,7 +1045,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 38b829d3ae..c736d3dab9 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -23,15 +23,14 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 14; // 28 NPC.width = 104; NPC.height = 104; NPC.defense = 9; - NPC.DR_NERD(0.1f); 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; @@ -45,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; @@ -172,30 +171,6 @@ namespace CalamityMod.NPCs.DesertScourge bool burrow = head.Calamity().newAI[0] >= burrowTimeGateValue; bool lungeUpward = burrow && head.Calamity().newAI[1] == 1f; bool quickFall = head.Calamity().newAI[1] == 2f; - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertScourgeHead.SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? DesertScourgeHead.SegmentVelocity_GoodWorld : - death ? DesertScourgeHead.SegmentVelocity_Death : - expertMode ? DesertScourgeHead.SegmentVelocity_Expert : - DesertScourgeHead.SegmentVelocity_Normal; - if (burrow || lungeUpward) - maxChaseSpeed *= 1.5f; - if (expertMode) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity || NPC.dontTakeDamage) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index 4fc03348e6..6188c4cf81 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 120; // 240 NPC.width = 34; NPC.height = 34; NPC.defense = 60; @@ -138,21 +138,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.position.X = NPC.position.X + targetX; NPC.position.Y = NPC.position.Y + targetY; } - - // Calculate contact damage based on velocity - float segmentVelocity = CalamityWorld.revenge ? 25f : 23f; - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index ecd2c37d52..378971f286 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 180; // 360 NPC.width = 64; NPC.height = 76; NPC.defense = 40; @@ -333,19 +333,6 @@ namespace CalamityMod.NPCs.DevourerofGods } } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; } diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index 15c3167633..ac3627b1c3 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.width = 30; NPC.height = 50; NPC.defense = 70; @@ -135,21 +135,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.position.X = NPC.position.X + targetX; NPC.position.Y = NPC.position.Y + targetY; } - - // Calculate contact damage based on velocity - float segmentVelocity = CalamityWorld.revenge ? 25f : 23f; - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 62d072d994..43dd699c66 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 120; // 240 NPC.npcSlots = 5f; NPC.width = 56; NPC.height = 56; @@ -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,22 +271,8 @@ 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; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -434,7 +420,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 6f4278027f..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); @@ -192,10 +194,13 @@ namespace CalamityMod.NPCs.DevourerofGods }); } + public static int LaserWallDamage = 75; // 300 + public static int FireballDamage = 60; // 240; Also applies to Legendary Mode Ichor Blob + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 250; // 500 NPC.npcSlots = 5f; NPC.width = 104; NPC.height = 104; @@ -206,7 +211,7 @@ namespace CalamityMod.NPCs.DevourerofGods AIType = -1; NPC.knockBackResist = 0f; NPC.boss = true; - NPC.value = Item.buyPrice(2, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1, gold: 50); NPC.Opacity = 0f; NPC.behindTiles = true; NPC.noGravity = true; @@ -214,7 +219,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.5f; } @@ -422,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; @@ -748,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; @@ -761,12 +766,12 @@ namespace CalamityMod.NPCs.DevourerofGods Dust.NewDust(NPC.Center, 52, 52, (int)CalamityDusts.PurpleCosmilite, dustVelocity.X, dustVelocity.Y); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = FireballDamage; 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++) { @@ -783,7 +788,6 @@ namespace CalamityMod.NPCs.DevourerofGods int numBlobs = 4; type = ModContent.ProjectileType(); - damage = 60; for (int i = 0; i < numBlobs; i++) { @@ -818,7 +822,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Side walls float targetPosY = player.position.Y; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = LaserWallDamage; int halfTotalDiagonalShots = totalDiagonalShots / 2; Vector2 start = default; Vector2 velocity = default; @@ -1109,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; @@ -1267,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; @@ -1632,7 +1636,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Side walls int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = LaserWallDamage; Vector2 start = default; Vector2 velocity = default; Vector2 aim = expertMode ? player.Center + player.velocity * 20f : Vector2.Zero; @@ -1868,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; @@ -2012,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; @@ -2263,19 +2267,6 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.Distance(player.Center) > 2400f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - if (NPC.life > Main.npc[(int)NPC.ai[0]].life) NPC.life = Main.npc[(int)NPC.ai[0]].life; } @@ -2322,13 +2313,13 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = FireballDamage; float finalVelocity = 10f; int totalSpreads = revenge ? 6 : 3; 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); @@ -2615,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); @@ -2746,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) { @@ -2808,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 8b27992d4c..64e31b8cae 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 100; // 200 NPC.npcSlots = 5f; NPC.width = 66; NPC.height = 66; @@ -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,22 +304,8 @@ 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; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -399,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) { @@ -470,7 +456,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 34edc4cc71..4b87ce9e40 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -144,11 +144,15 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo } } + public static int FireballDamage = 85; // 340 + public static int BoltDamage = 75; // 300 + public static int RocketDamage = 100; // 400 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 250; // 500 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 204; NPC.height = 226; NPC.defense = 100; @@ -158,7 +162,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.noGravity = true; NPC.noTileCollide = true; NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; @@ -420,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; @@ -441,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; @@ -462,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 @@ -484,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; @@ -989,10 +993,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 plasmaVelocity = Vector2.Normalize(aimedVector) * projectileVelocity; Vector2 offset = Vector2.Normalize(plasmaVelocity) * 70f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, plasmaVelocity, type, FireballDamage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); } } } @@ -1053,10 +1056,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 rocketVelocity = Vector2.Normalize(aimedVector) * projectileVelocity * 1.2f; Vector2 offset = Vector2.Normalize(rocketVelocity) * 70f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, rocketVelocity, type, RocketDamage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); } } @@ -1176,12 +1178,11 @@ 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; int type = ModContent.ProjectileType(); - int damage = (int)(NPC.GetProjectileDamage(ModContent.ProjectileType()) * 0.8); float velocity = 0.5f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -1190,7 +1191,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, BoltDamage, 0f, Main.myPlayer); } } @@ -1815,7 +1816,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index ca4c38e87e..2e9aea4990 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -219,10 +219,15 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int BlenderDamage = 110; // 440 + + // Hekate (GFB) + public static int NeuronLaserDamage = 85; // 340 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 220; NPC.height = 252; NPC.defense = 100; @@ -232,7 +237,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.noGravity = true; NPC.noTileCollide = true; NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; @@ -381,8 +386,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 betweenL = NeuronLeft + velocity * 650; SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = CommonCalamitySounds.LaserCannonSound.Volume - 0.2f, Pitch = CommonCalamitySounds.LaserCannonSound.Pitch + 0.2f }, NeuronRight); - Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenL, betweenL + velocity, ModContent.ProjectileType(), 111, 0f, Main.myPlayer, 7, NPC.whoAmI); - Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenR, betweenR + velocity, ModContent.ProjectileType(), 111, 0f, Main.myPlayer, 7, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenL, betweenL + velocity, ModContent.ProjectileType(), NeuronLaserDamage, 0f, Main.myPlayer, 7, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenR, betweenR + velocity, ModContent.ProjectileType(), NeuronLaserDamage, 0f, Main.myPlayer, 7, NPC.whoAmI); } neurontimer = 0; @@ -884,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) @@ -904,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; @@ -987,12 +992,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 spawnPoint = NPC.Center + new Vector2(-1f, 23f); for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, BlenderDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -1101,8 +1105,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; @@ -1706,7 +1708,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 9411a0e7fb..ca65cea2bd 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -85,10 +85,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int NukeDamage = 135; // 540 + public static int SparkDamage = 75; // 300 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 170; NPC.height = 120; NPC.defense = 100; @@ -418,9 +421,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float nukeOffset = 40f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(gaussNukeVelocity) * nukeOffset, gaussNukeVelocity, type, damage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(gaussNukeVelocity) * nukeOffset, gaussNukeVelocity, type, NukeDamage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); } // Recoil @@ -483,8 +485,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using gauss nuke @@ -698,7 +698,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 42c0afd1d4..52ce8f335c 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -88,10 +88,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int LaserDamage = 85; // 340 + public static int BeamDamage = 110; // 440 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 154; NPC.height = 90; NPC.defense = 100; @@ -453,10 +456,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 laserVelocity = Vector2.Normalize(Main.player[targetIndex].Center - NPC.Center); Vector2 laserOffset = laserVelocity * 70f + Vector2.UnitY * 16f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserOffset, Main.player[targetIndex].Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserOffset, Main.player[targetIndex].Center, type, LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -484,7 +486,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float beamOffset = 84f; float beamOffset2 = 16f; Vector2 source = horizontalLaserSweep ? new Vector2(NPC.Center.X - beamOffset2 * NPC.direction, NPC.Center.Y + beamOffset) : new Vector2(NPC.Center.X + beamOffset * NPC.direction, NPC.Center.Y + beamOffset2); @@ -492,7 +493,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (laserVelocity.HasNaNs()) laserVelocity = -Vector2.UnitY; - Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity, type, BeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -545,8 +546,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using deathrays @@ -760,7 +759,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 4bab1a0edf..93d07c3f3a 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -82,10 +82,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int FireballDamage = 85; // 340 + public static int BoltDamage = 75; // 300 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 152; NPC.height = 90; NPC.defense = 100; @@ -440,13 +443,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 plasmaOffset = Vector2.Normalize(plasmaBoltVelocity) * 40f + Vector2.UnitY * 16f; if (boltsSplitLess) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, FireballDamage, 0f, Main.myPlayer, -1f); else - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, FireballDamage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); } // Recoil @@ -483,8 +485,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using plasma bolts @@ -696,7 +696,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index fd307284be..3a73886432 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -83,10 +83,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int OrbDamage = 85; // 340 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 172; NPC.height = 108; NPC.defense = 100; @@ -439,10 +441,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 orbOffset = Vector2.Normalize(teslaOrbVelocity) * 40f + Vector2.UnitY * 8f; float identity = fireMoreOrbs ? -2f : calamityGlobalNPC.newAI[3] + (calamityGlobalNPC.newAI[2] - teslaOrbTelegraphDuration) / divisor; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + orbOffset, teslaOrbVelocity, type, damage, 0f, Main.myPlayer, identity); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + orbOffset, teslaOrbVelocity, type, OrbDamage, 0f, Main.myPlayer, identity); } // Recoil @@ -480,8 +481,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using tesla orbs @@ -692,7 +691,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 3cfe451c13..06f8bef2ec 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -174,11 +174,14 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } } + public static int LaserDamage = 85; // 340 + public static int BeamDamage = 110; // 440 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 200; // 400 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 204; NPC.height = 226; NPC.defense = 100; @@ -453,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 @@ -492,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; @@ -517,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 @@ -531,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; @@ -773,10 +776,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 offset = laserVelocity * 70f; float setVelocityInAI = 7.5f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileDestination, type, LaserDamage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -828,7 +830,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 laserVelocity = chargeVelocityNormalized * 10f; int numLasersPerSpread = death ? 8 : expertMode ? 6 : 4; int spread = death ? 26 : expertMode ? 21 : 15; @@ -844,7 +845,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, LaserDamage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -925,7 +926,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 laserVelocity = Vector2.Normalize(aimedVector) * 10f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); /* Spread: * lastMechAlive = 20, 25, 30 @@ -950,7 +950,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 newCenter = NPC.Center + offset; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, LaserDamage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } @@ -1083,8 +1083,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int laser = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); + int laser = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, BeamDamage, 0f, Main.myPlayer, NPC.whoAmI); if (Main.projectile.IndexInRange(laser)) { Main.projectile[laser].ai[0] = NPC.whoAmI; @@ -1615,7 +1614,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 4851120345..63d10f0991 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -65,8 +65,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 150; // 300 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 88; NPC.height = 88; NPC.defense = 100; @@ -302,10 +302,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -365,7 +364,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos predictionAmt *= 0.5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(CommonCalamitySounds.ExoLaserShootSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -374,7 +372,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { @@ -382,18 +380,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -527,22 +525,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -686,7 +670,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 6ef4e718dc..fb5343f815 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -64,8 +64,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 150; // 300 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 90; NPC.height = 90; NPC.defense = 100; @@ -301,10 +301,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -364,7 +363,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos predictionAmt *= 0.5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(CommonCalamitySounds.ExoLaserShootSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -373,7 +371,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { @@ -381,18 +379,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -530,22 +528,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -691,7 +675,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 542aacd828..f77496ed32 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -166,11 +166,14 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + public static int LaserDamage = 85; // 340 + public static int BeamDamage = 135; // 540 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 250; // 500 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 164; NPC.height = 164; NPC.defense = 100; @@ -181,7 +184,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -250,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.6f : 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) { @@ -523,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); @@ -937,8 +940,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, BeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -1042,19 +1044,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } } - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -1363,7 +1352,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index f9ed2b2893..5e888f834e 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -64,8 +64,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 76; NPC.height = 110; NPC.defense = 100; @@ -301,10 +301,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -364,7 +363,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos predictionAmt *= 0.5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(CommonCalamitySounds.ExoLaserShootSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -373,7 +371,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { @@ -381,18 +379,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -528,22 +526,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -690,7 +674,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 008c2637d5..42af41cb27 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -52,12 +52,11 @@ namespace CalamityMod.NPCs.GreatSandShark NPC.width = 300; NPC.height = 120; NPC.defense = 40; - NPC.DR_NERD(0.25f); NPC.LifeMaxNERB(9200, 11000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 5, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPCID.Sets.TrailCacheLength[Type] = 8; NPCID.Sets.TrailingMode[Type] = 1; NPC.behindTiles = true; diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 2b52e7f81e..baef197d63 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.HiveMind public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 24; // 48 NPC.width = 70; NPC.height = 70; NPC.defense = 6; @@ -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; @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.HiveMind if (hurtInfo.Damage < 0) return; - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(NPC.HitInfo hit) @@ -151,8 +151,7 @@ namespace CalamityMod.NPCs.HiveMind if ((Main.expertMode || BossRushEvent.BossRushActive) && Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, HiveMind.ShaderainDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index c50f439d6d..3970830b8e 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.HiveMind public override void SetDefaults() { - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 32; NPC.height = 32; NPC.defense = 2; @@ -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,17 +125,16 @@ 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(); - int damage = NPC.GetProjectileDamage(type); - 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, damage, 0f, Main.myPlayer); + 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 c763368275..f9467741d4 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -14,27 +14,30 @@ 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 + + // Legendary Mode exclusive + public static int CursedFlameDamage = 15; // 60 public override void SetDefaults() { NPC.npcSlots = 0.1f; NPC.aiStyle = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 25; NPC.height = 25; NPC.lifeMax = 50; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1300; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.lifeMax *= 2; NPC.knockBackResist = 0.9f; @@ -107,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; @@ -161,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; @@ -183,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; @@ -193,8 +197,8 @@ namespace CalamityMod.NPCs.HiveMind playerDist = projSpeed / playerDist; playerX *= playerDist; playerY *= playerDist; - int type = (CalamityWorld.LegendaryMode && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = type == ProjectileID.CursedFlameHostile ? 30 : NPC.GetProjectileDamage(type); + 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) { @@ -224,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); @@ -251,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 76ae6a25d1..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; // 0 contact damage, projectile damage is pulled from NPCStats - 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 ? 30 : NPC.GetProjectileDamage(type); - 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 9149044c05..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; @@ -135,11 +134,13 @@ namespace CalamityMod.NPCs.HiveMind } } + public static int ShaderainDamage = 12; // 48 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 40; // 64 (1.6x expert scaling) NPC.npcSlots = 5f; - NPC.GetNPCDamage(); // this is the only allowed case for using constant directly // as it doesn't have proper frame info yet @@ -151,7 +152,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 8, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.boss = true; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; @@ -188,7 +189,7 @@ namespace CalamityMod.NPCs.HiveMind driftBoost = 1.5f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { reelbackFade *= 10; arcTime *= 0.5f; @@ -218,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); @@ -242,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(); @@ -431,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) { @@ -509,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; @@ -553,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)); } } @@ -604,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(); @@ -622,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; @@ -673,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; @@ -792,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; @@ -836,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(); } @@ -844,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; @@ -856,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) @@ -897,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) @@ -954,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; @@ -1095,10 +1071,9 @@ namespace CalamityMod.NPCs.HiveMind if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); 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; - Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, damage, 0, Main.myPlayer, 11f); + Vector2 randomVelocity = Main.getGoodWorld ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; + Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, ShaderainDamage, 0, Main.myPlayer, 11f); } if (NPC.ai[0] == 10f) @@ -1242,7 +1217,7 @@ namespace CalamityMod.NPCs.HiveMind if (hurtInfo.Damage < 0) return; - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 240); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => NPC.scale == 1f; // Only draw HP bar while at full size @@ -1260,7 +1235,7 @@ namespace CalamityMod.NPCs.HiveMind public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void HitEffect(NPC.HitInfo hit) @@ -1371,7 +1346,6 @@ namespace CalamityMod.NPCs.HiveMind normalOnly.Add(ItemID.DemoniteBar, 1, 10, 15); normalOnly.Add(ItemID.RottenChunk, 1, 10, 15); normalOnly.Add(ItemID.CorruptSeeds, 1, 10, 15); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); normalOnly.Add(ItemDropRule.ByCondition(DropHelper.Hardmode(), ItemID.CursedFlame, 1, 10, 20)); // Equipment 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 454cfa8f41..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 { @@ -59,10 +59,15 @@ namespace CalamityMod.NPCs.Leviathan } } + public static float DashDamageMult = 1.5f; // 165 + public static int SpearDamage = 24; // 96 + public static int MistDamage = 24; // 96 + public static int SongDamage = 30; // 120 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 55; // 110 NPC.npcSlots = 16f; NPC.width = 100; NPC.height = 100; @@ -73,7 +78,7 @@ namespace CalamityMod.NPCs.Leviathan AIType = -1; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); - NPC.value = Item.buyPrice(0, 12, 50, 0); + NPC.value = Item.buyPrice(gold: 7, silver: 50); NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = HitSound; @@ -83,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) @@ -185,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 @@ -612,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) @@ -648,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; } @@ -703,13 +706,13 @@ namespace CalamityMod.NPCs.Leviathan int totalProjectiles = 8; int projectileDistance = 600; int type = ModContent.ProjectileType(); - if (CalamityWorld.LegendaryMode) + int damage = SpearDamage; + if (Main.getGoodWorld) { float radians = MathHelper.TwoPi / totalProjectiles; - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { - switch (LegendaryModeAttackChosen) + switch (GetGoodAttackChosen) { case 0: SoundEngine.PlaySound(SoundID.Item21, player.Center); @@ -717,11 +720,13 @@ namespace CalamityMod.NPCs.Leviathan case 1: type = ModContent.ProjectileType(); + damage = MistDamage; SoundEngine.PlaySound(SoundID.Item30, player.Center); break; case 2: type = ModContent.ProjectileType(); + damage = SongDamage; float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; Main.musicPitch = soundPitch; SoundEngine.PlaySound(SoundID.Item26, player.Center); @@ -745,12 +750,14 @@ namespace CalamityMod.NPCs.Leviathan case 1: totalProjectiles = 3; type = ModContent.ProjectileType(); + damage = MistDamage; SoundEngine.PlaySound(SoundID.Item30, player.Center); break; case 2: totalProjectiles = 6; type = ModContent.ProjectileType(); + damage = SongDamage; float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; Main.musicPitch = soundPitch; SoundEngine.PlaySound(SoundID.Item26, player.Center); @@ -764,7 +771,6 @@ namespace CalamityMod.NPCs.Leviathan totalProjectiles += totalProjectiles / 2; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance; @@ -821,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) @@ -847,9 +853,9 @@ namespace CalamityMod.NPCs.Leviathan // Charge else if (NPC.ai[0] == 4f) { - NPC.damage = (int)Math.Round(NPC.defDamage * 1.5); + 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); @@ -919,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); @@ -976,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); @@ -1044,7 +1050,6 @@ namespace CalamityMod.NPCs.Leviathan public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/Leviathan/AnahitasIceShield.cs b/NPCs/Leviathan/AnahitasIceShield.cs index c8f89863d4..d15a59dbe7 100644 --- a/NPCs/Leviathan/AnahitasIceShield.cs +++ b/NPCs/Leviathan/AnahitasIceShield.cs @@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.Leviathan public override void SetDefaults() { + NPC.damage = 45; // 90 NPC.aiStyle = -1; AIType = -1; NPC.noTileCollide = true; NPC.coldDamage = true; - NPC.GetNPCDamage(); NPC.width = 100; NPC.height = 100; NPC.defense = 10; @@ -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 c2db47e9c2..e809b6b408 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -37,9 +37,8 @@ namespace CalamityMod.NPCs.Leviathan public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 50; // 100 NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 50; NPC.height = 50; NPC.defense = 14; @@ -55,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 a031c11e5f..fc7a3933a7 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -57,11 +57,13 @@ namespace CalamityMod.NPCs.Leviathan AttackTexture = ModContent.Request("CalamityMod/NPCs/Leviathan/LeviathanAttack", AssetRequestMode.AsyncLoad); } + public static int BoulderDamage = 40; // 160 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; NPC.npcSlots = 20f; - NPC.GetNPCDamage(); + NPC.damage = 100; // 200 NPC.width = 900; NPC.height = 450; NPC.defense = 40; @@ -71,7 +73,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.aiStyle = -1; AIType = -1; NPC.Opacity = 0f; - NPC.value = Item.buyPrice(0, 12, 50, 0); + NPC.value = Item.buyPrice(gold: 7, silver: 50); NPC.HitSound = SoundID.NPCHit56; NPC.DeathSound = SoundID.NPCDeath60; NPC.noTileCollide = true; @@ -84,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) @@ -308,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; @@ -389,7 +391,6 @@ namespace CalamityMod.NPCs.Leviathan { float speed = (sirenAlive && !phase4 && !death) ? 13.5f : 16f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (expertMode) speed = (sirenAlive && !phase4 && !death) ? 14f : 17f; @@ -408,12 +409,11 @@ 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 - damage *= 2; } - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), leviCenter.X, leviCenter.Y, xDestination, yDestination, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), leviCenter.X, leviCenter.Y, xDestination, yDestination, type, BoulderDamage, 0f, Main.myPlayer); if (Main.zenithWorld) Main.projectile[proj].scale *= 5f; @@ -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; @@ -971,7 +971,6 @@ namespace CalamityMod.NPCs.Leviathan public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } 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/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index a66642db72..9ab7fe5394 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 75; NPC.knockBackResist = 0.8f; AnimationType = NPCID.Slimer; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index 1a4ca0a8fe..a4a5b58ce7 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -25,7 +25,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 38; NPC.height = 38; NPC.defense = 20; - NPC.DR_NERD(0.2f); NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; @@ -153,21 +152,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.position.X = NPC.position.X + targetXDist; NPC.position.Y = NPC.position.Y + targetYDist; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = CalamityWorld.death ? 13.5f : 10f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 1778ab0596..5b812c76be 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -40,12 +40,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 54; NPC.height = 54; NPC.defense = 10; - NPC.DR_NERD(0.1f); NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 5, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -390,19 +389,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + 1.57f; if (flying) @@ -435,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/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index d062730e34..39359d581f 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -24,7 +24,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 34; NPC.height = 34; NPC.defense = 30; - NPC.DR_NERD(0.3f); NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; @@ -103,21 +102,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.position.X = NPC.position.X + targetXDist; NPC.position.Y = NPC.position.Y + targetYDist; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = CalamityWorld.death ? 13.5f : 10f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CheckActive() diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index 399a8f8e39..95e4beec0b 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 24; NPC.defense = 8; NPC.alpha = 100; - NPC.lifeMax = 65; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.lifeMax = 200; + NPC.value = Item.buyPrice(silver: 1); NPC.knockBackResist = 0f; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath15; diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index e504466216..283baad070 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -23,11 +23,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 80; NPC.width = 40; NPC.height = 30; - NPC.defense = 25; - NPC.lifeMax = 1500; + NPC.defense = 40; + NPC.lifeMax = 2000; NPC.knockBackResist = 0.3f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 25, 0); + NPC.value = Item.buyPrice(silver: 25); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index 6d6227486c..a7c0f35756 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -15,16 +15,15 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; AIType = -1; NPC.damage = 80; NPC.width = 40; NPC.height = 40; - NPC.defense = 18; - NPC.lifeMax = 375; + NPC.defense = 32; + NPC.lifeMax = 600; NPC.knockBackResist = 0.95f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit7; NPC.DeathSound = SoundID.NPCDeath35; NPC.behindTiles = true; diff --git a/NPCs/NormalNPCs/BucketZombie.cs b/NPCs/NormalNPCs/BucketZombie.cs index d33f66686e..34e87385bb 100644 --- a/NPCs/NormalNPCs/BucketZombie.cs +++ b/NPCs/NormalNPCs/BucketZombie.cs @@ -25,11 +25,11 @@ namespace CalamityMod.NPCs.NormalNPCs AnimationType = NPCID.Zombie; NPC.aiStyle = NPCAIStyleID.Fighter; NPC.CloneDefaults(NPCID.Zombie); - NPC.lifeMax = 50; + NPC.lifeMax = 60; NPC.defense = 15; NPC.damage = 16; NPC.knockBackResist = 0.45f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); Banner = NPCID.Zombie; BannerItem = ItemID.ZombieBanner; NPC.Calamity().VulnerableToHeat = true; diff --git a/NPCs/NormalNPCs/CladCrab.cs b/NPCs/NormalNPCs/CladCrab.cs index 80c9d3a734..13144ab802 100644 --- a/NPCs/NormalNPCs/CladCrab.cs +++ b/NPCs/NormalNPCs/CladCrab.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 100; NPC.aiStyle = -1; NPC.knockBackResist = 0.4f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit41 with { Pitch = 0.6f }; NPC.DeathSound = SoundID.NPCDeath36 with { Pitch = -0.4f }; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CloudElemental.cs b/NPCs/NormalNPCs/CloudElemental.cs index 4201964249..59e654931e 100644 --- a/NPCs/NormalNPCs/CloudElemental.cs +++ b/NPCs/NormalNPCs/CloudElemental.cs @@ -75,10 +75,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 80; NPC.height = 140; NPC.defense = 18; - NPC.DR_NERD(0.05f); NPC.lifeMax = 6000; NPC.knockBackResist = 0.05f; - NPC.value = Item.buyPrice(0, 1, 50, 0); + NPC.value = Item.buyPrice(gold: 1, silver: 50); NPC.HitSound = SoundID.NPCHit23; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 26e72906cc..836d928cba 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -35,11 +35,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 6; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DR_NERD(0.05f); NPC.lifeMax = 280; NPC.knockBackResist = 0.05f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 25, 0); + NPC.value = Item.buyPrice(silver: 25); NPC.HitSound = SoundID.NPCHit12; NPC.DeathSound = SoundID.NPCDeath18; NPC.rarity = 2; diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index 511f526db0..227d0ecc74 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -27,9 +27,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 10; - NPC.lifeMax = 115; + NPC.lifeMax = 150; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index 10ce33672c..6b16f0d70a 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 75; NPC.knockBackResist = 0.75f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 60); + NPC.value = Item.buyPrice(copper: 60); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index 536048530f..ff2d4b4d03 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -26,11 +26,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 35; NPC.width = 44; NPC.height = 34; - NPC.defense = 12; - NPC.lifeMax = 375; + NPC.defense = 22; + NPC.lifeMax = 400; NPC.knockBackResist = 0.15f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index 9e5401e063..0ebb7f1a93 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -25,11 +25,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 24; NPC.width = 44; NPC.height = 34; - NPC.defense = 8; - NPC.lifeMax = 190; + NPC.defense = 10; + NPC.lifeMax = 180; NPC.knockBackResist = 0.35f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 9a41c328e0..9b30b0aacc 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 135; NPC.knockBackResist = 0.55f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 20); + NPC.value = Item.buyPrice(silver: 1, copper: 20); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 0595799b42..1d25a513f7 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -26,10 +26,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 8; - NPC.lifeMax = 170; + NPC.lifeMax = 150; NPC.knockBackResist = 0.45f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 60); + NPC.value = Item.buyPrice(silver: 1, copper: 60); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index 8a755a0812..e307c06005 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -26,10 +26,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 6; - NPC.lifeMax = 115; + NPC.lifeMax = 120; NPC.knockBackResist = 0.65f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index efcedde77f..029c66b7bd 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -26,10 +26,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 4; - NPC.lifeMax = 60; + NPC.lifeMax = 90; NPC.knockBackResist = 0.85f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 60); + NPC.value = Item.buyPrice(copper: 60); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 0848097ddb..71a4064edc 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -24,10 +24,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 42; NPC.defense = 8; - NPC.lifeMax = 165; + NPC.lifeMax = 130; NPC.knockBackResist = 0.3f; AnimationType = NPCID.RainbowSlime; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.alpha = 105; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index 7caa719098..30e71d6f11 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -22,11 +22,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 30; NPC.width = 40; NPC.height = 30; - NPC.defense = 8; - NPC.lifeMax = 180; + NPC.defense = 24; + NPC.lifeMax = 280; NPC.knockBackResist = 0.6f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index b5e53192c3..7dad72a7b4 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -22,11 +22,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 42; NPC.width = 50; NPC.height = 64; - NPC.defense = 10; - NPC.DR_NERD(0.1f); - NPC.lifeMax = 375; + NPC.defense = 25; + NPC.lifeMax = 300; NPC.knockBackResist = 0.4f; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 930827d5f3..52d7ad737c 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -24,10 +24,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 42; NPC.defense = 8; - NPC.lifeMax = 165; + NPC.lifeMax = 130; NPC.knockBackResist = 0.3f; AnimationType = NPCID.RainbowSlime; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.alpha = 105; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index b83c364977..eed93943a1 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 80; NPC.lifeMax = 5000; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.Opacity = 0f; NPC.noGravity = true; NPC.noTileCollide = false; diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index ac0226bedc..5d6caef76d 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -27,9 +27,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 36; NPC.height = 32; NPC.defense = Main.hardMode ? 10 : 2; - NPC.lifeMax = Main.hardMode ? 190 : 65; + NPC.lifeMax = Main.hardMode ? 150 : 50; NPC.knockBackResist = Main.hardMode ? 0.2f : 0.5f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 1ac3284146..0e64c5dc05 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 100; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.5f; diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 6689e1f720..6c6806ec9b 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -40,12 +40,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 230; NPC.height = 230; NPC.defense = 20; - NPC.DR_NERD(0.1f); NPC.lifeMax = 3800; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0.05f; - NPC.value = Item.buyPrice(0, 1, 50, 0); + NPC.value = Item.buyPrice(gold: 1, silver: 50); NPC.dontTakeDamage = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index 0e7dc27d42..737450557d 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -81,12 +81,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 50; NPC.height = 50; NPC.defense = 12; - NPC.lifeMax = 750; + NPC.lifeMax = 500; NPC.knockBackResist = 0.25f; NPC.noTileCollide = true; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.rarity = 2; diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index 2b209fa667..0cf4327328 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 3000; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.knockBackResist = 0.2f; diff --git a/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs b/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs index 18b6c3c052..0379b92424 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); + NPC.damage = 24; // 72 (Death exlusive) NPC.width = 32; NPC.height = 32; NPC.defense = 15; diff --git a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs index dbb346fda8..78e7fd1c13 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs @@ -27,6 +27,8 @@ namespace CalamityMod.NPCs.NormalNPCs private const int BoltShootGateValue_Death = 75; private const float LightTelegraphDuration = 45f; + public static int JewelBoltDamage = 10; // 40 + public override void SetStaticDefaults() { NPCID.Sets.NeedsExpertScaling[Type] = true; @@ -38,7 +40,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.aiStyle = -1; AIType = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; NPC.width = 32; NPC.height = 32; NPC.defense = 10; @@ -151,7 +153,6 @@ namespace CalamityMod.NPCs.NormalNPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = NPC.GetProjectileDamage(type); if (death) { int numProj = 4; @@ -159,11 +160,11 @@ namespace CalamityMod.NPCs.NormalNPCs for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, JewelBoltDamage, 0f, Main.myPlayer); } } else - Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, projVector, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, projVector, type, JewelBoltDamage, 0f, Main.myPlayer); } NPC.netUpdate = true; diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index fbae880677..6d8f03f37b 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -29,11 +29,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 24; NPC.defense = 10; - NPC.DR_NERD(0.1f); - NPC.lifeMax = 50; + NPC.lifeMax = 60; NPC.aiStyle = NPCAIStyleID.Fighter; AIType = NPCID.Crab; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 09015debcf..7c121bb4a4 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -29,10 +29,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 18; NPC.height = 40; NPC.defense = 18; - NPC.DR_NERD(0.15f); - NPC.lifeMax = NPC.downedMoonlord ? 1700 : 170; + NPC.lifeMax = NPC.downedMoonlord ? 3000 : 300; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit2; NPC.DeathSound = SoundID.NPCDeath2; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index b861e26430..623c3f6f76 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -22,11 +22,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 35; NPC.width = 40; NPC.height = 30; - NPC.defense = 12; - NPC.lifeMax = 225; + NPC.defense = 20; + NPC.lifeMax = 360; NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 5b49f48c57..1d05b99e30 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -22,12 +22,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 70; NPC.width = 16; NPC.height = 16; - NPC.defense = 10; - NPC.lifeMax = 1250; + NPC.defense = 40; + NPC.lifeMax = 1500; NPC.knockBackResist = 0.2f; AnimationType = NPCID.DungeonSpirit; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index c5a7f83174..f533643661 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -22,18 +22,20 @@ namespace CalamityMod.NPCs.NormalNPCs Main.npcFrameCount[Type] = 5; } + public static int ShotDamage = 60; // 240 + public override void SetDefaults() { + NPC.damage = 100; // 200 NPC.aiStyle = -1; - NPC.damage = 100; NPC.width = 32; NPC.height = 80; NPC.scale *= 1.2f; - NPC.defense = 30; - NPC.lifeMax = 3750; + NPC.defense = 60; + NPC.lifeMax = 3500; NPC.knockBackResist = 0.1f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 60, 0); + NPC.value = Item.buyPrice(silver: 60); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; @@ -83,11 +85,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[2] = 0f; float projSpeed = 10f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); targetDistance = projSpeed / targetDistance; targetXDist *= targetDistance; targetYDist *= targetDistance; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spiritPosition.X, spiritPosition.Y, targetXDist, targetYDist, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spiritPosition.X, spiritPosition.Y, targetXDist, targetYDist, type, ShotDamage, 0f, Main.myPlayer, 0f, 0f); } } diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index 1806c9fd88..e36da27bba 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -25,11 +25,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 32; NPC.height = 80; NPC.scale *= 1.1f; - NPC.defense = 25; + NPC.defense = 50; NPC.lifeMax = 2500; NPC.knockBackResist = 0.15f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 40, 0); + NPC.value = Item.buyPrice(silver: 40); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 7f8ee317de..75b6ca3667 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 80; NPC.width = 32; NPC.height = 80; - NPC.defense = 20; - NPC.lifeMax = 1875; + NPC.defense = 45; + NPC.lifeMax = 2000; NPC.knockBackResist = 0.2f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 4b2106e519..9782a5d91d 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.aiStyle = NPCAIStyleID.Passive; AIType = NPCID.Squirrel; NPC.knockBackResist = 0.99f; - NPC.value = Item.buyPrice(0, 2, 0, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index f516f4dfe1..0908378d3d 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -28,11 +28,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 60; NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); - NPC.DR_NERD(0.1f); NPC.width = 24; NPC.height = 24; NPC.defense = 20; @@ -77,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; @@ -131,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; @@ -186,13 +184,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * balance); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Poisoned, 180); + NPC.damage = (int)(NPC.damage * 1.15f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 811e7c8e23..2942860f46 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -31,11 +31,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 72; NPC.height = 36; NPC.defense = 50; - NPC.DR_NERD(0.1f); NPC.lifeMax = 2500; NPC.knockBackResist = 0f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.lavaImmune = true; NPC.noGravity = true; NPC.HitSound = SoundID.NPCHit52; diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index 43c3bdcf60..b3e68cefb3 100644 --- a/NPCs/NormalNPCs/Rimehound.cs +++ b/NPCs/NormalNPCs/Rimehound.cs @@ -37,17 +37,17 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 56; NPC.height = 56; NPC.defense = 4; - NPC.lifeMax = 65; + NPC.lifeMax = 80; if (DownedBossSystem.downedCryogen) { NPC.damage = 60; NPC.defense = 10; - NPC.lifeMax = 1250; + NPC.lifeMax = 600; } NPC.knockBackResist = 0.3f; AnimationType = NPCID.Hellhound; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = HitSound; NPC.DeathSound = SoundID.NPCDeath5; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/Rotdog.cs b/NPCs/NormalNPCs/Rotdog.cs index 2d177cfb3c..fb733e8c7c 100644 --- a/NPCs/NormalNPCs/Rotdog.cs +++ b/NPCs/NormalNPCs/Rotdog.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 75; NPC.knockBackResist = 0.3f; AIType = NPCID.Wolf; - NPC.value = Item.buyPrice(0, 0, 1, 50); + NPC.value = Item.buyPrice(silver: 1, copper: 50); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath5; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 6e9ef9f9b9..2891aa5e74 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -40,12 +40,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 160; NPC.height = 160; NPC.defense = 38; - NPC.DR_NERD(0.05f); NPC.lifeMax = 9000; NPC.knockBackResist = 0f; AIType = -1; NPC.lavaImmune = true; - NPC.value = Item.buyPrice(0, 0, 75, 0); + NPC.value = Item.buyPrice(silver: 75); NPC.DeathSound = DeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 392a4bdd6e..4d0f33e355 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -29,12 +29,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 64; NPC.height = 38; NPC.defense = 15; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 190; + NPC.lifeMax = 250; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; NPC.noGravity = true; @@ -86,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(); @@ -405,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/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index 94ad7894d4..9616633e81 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 100; NPC.knockBackResist = 0.2f; AnimationType = NPCID.WalkingAntlion; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = HitSound; NPC.DeathSound = DeathSound; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 6082e29b01..8b5242520f 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -34,10 +34,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 58; NPC.height = 22; NPC.defense = 4; - NPC.lifeMax = 125; + NPC.lifeMax = 160; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = Main.zenithWorld ? AresGaussNuke.NukeExplosionSound : DeathSound; NPC.knockBackResist = 0.7f; diff --git a/NPCs/NormalNPCs/SuperDummyNPC.cs b/NPCs/NormalNPCs/SuperDummyNPC.cs index f5a06984a4..d910753482 100644 --- a/NPCs/NormalNPCs/SuperDummyNPC.cs +++ b/NPCs/NormalNPCs/SuperDummyNPC.cs @@ -28,7 +28,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 9999999; NPC.HitSound = null; NPC.DeathSound = SoundID.NPCDeath2; - NPC.value = 0f; NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = NPCAIStyleID.FaceClosestPlayer; @@ -62,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 518d001806..525ddc4bdb 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -51,9 +51,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 44; NPC.defense = 4; - NPC.lifeMax = Main.zenithWorld ? 90 : 58; + NPC.lifeMax = Main.zenithWorld ? 200 : 100; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.noGravity = false; NPC.noTileCollide = false; NPC.HitSound = Hit; @@ -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 f9de4356d3..7a041ec944 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -70,9 +70,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 32; NPC.height = 32; NPC.defense = 4; - NPC.lifeMax = 27; + NPC.lifeMax = 25; NPC.knockBackResist = 0.35f; - NPC.value = Item.buyPrice(0, 0, 0, 80); + NPC.value = Item.buyPrice(copper: 80); NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = WulfrumAmplifier.Hit; @@ -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 5c11d9effa..a93af36bb5 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -55,9 +55,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 40; NPC.defense = 5; - NPC.lifeMax = 23; + NPC.lifeMax = 25; NPC.knockBackResist = 0.15f; - NPC.value = Item.buyPrice(0, 0, 0, 75); + NPC.value = Item.buyPrice(copper: 75); NPC.HitSound = WulfrumAmplifier.Hit; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; Banner = NPC.type; @@ -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 bc742aff66..fe522f1f96 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 38; NPC.defense = 4; NPC.lifeMax = 25; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = WulfrumAmplifier.Hit; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; NPC.noGravity = true; @@ -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 32c91a7c1d..abb690b689 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 4; NPC.lifeMax = 40; NPC.knockBackResist = Main.zenithWorld ? 0f : 0.15f; - NPC.value = Item.buyPrice(0, 0, 0, 75); + NPC.value = Item.buyPrice(copper: 75); NPC.HitSound = WulfrumAmplifier.Hit; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; Banner = NPC.type; @@ -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 0158de4c3e..5162e69562 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -84,14 +84,23 @@ namespace CalamityMod.NPCs.OldDuke } } + public static float Phase2ContactDamageMult = 1.1f; // 308 + public static float Phase3ContactDamageMult = 1.2f; // 336 + public static int GoreDamage = 60; // 240 + public static int VortexDamage = 105; // 420 + + // GFB exclusive + public static int FartDamage = 80; // 320 + public override void SetDefaults() { + NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 140; // 280 NPC.alpha = 255; NPC.width = 150; NPC.height = 100; NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.defense = 90; NPC.DR_NERD(0.5f, null, null, null, true); NPC.LifeMaxNERB(500000, 600000, 400000); @@ -101,7 +110,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.npcSlots = 15f; NPC.HitSound = SoundID.NPCHit14; NPC.DeathSound = SoundID.NPCDeath20; - NPC.value = Item.buyPrice(2, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1, gold: 50); NPC.boss = true; NPC.netAlways = true; NPC.timeLeft = NPC.activeTime * 30; @@ -195,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; @@ -209,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; @@ -226,17 +233,17 @@ namespace CalamityMod.NPCs.OldDuke CalamityWorld.StartRain(); // Adjust stats - int setDamage = NPC.defDamage; + NPC.damage = NPC.defDamage; calamityGlobalNPC.DR = exhausted ? 0f : 0.5f; NPC.defense = exhausted ? 0 : NPC.defDefense; if (phase3AI) { - setDamage = (int)Math.Round(setDamage * 1.2); + NPC.damage = (int)Math.Round(NPC.defDamage * Phase3ContactDamageMult); NPC.defense = exhausted ? 0 : NPC.defDefense - 40; } else if (phase2AI) { - setDamage = (int)Math.Round(setDamage * 1.1); + NPC.damage = (int)Math.Round(NPC.defDamage * Phase2ContactDamageMult); NPC.defense = exhausted ? 0 : NPC.defDefense - 20; } @@ -285,7 +292,7 @@ namespace CalamityMod.NPCs.OldDuke } // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge) + if (Main.zenithWorld) chargeVelocity *= 1.25f; if (exhausted) @@ -353,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) { @@ -376,8 +398,7 @@ namespace CalamityMod.NPCs.OldDuke dist.X += Main.rand.NextFloat(-0.5f, 0.5f); dist.Y += Main.rand.NextFloat(-0.5f, 0.5f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -dist, type, damage, 0, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -dist, type, FartDamage, 0, Main.myPlayer); } } @@ -438,12 +459,12 @@ namespace CalamityMod.NPCs.OldDuke chargeVelocity += 8f; toothBallSpinPhaseDivisor = 24; toothBallSpinToothBallVelocity = 15f; - setDamage *= 2; + NPC.damage *= 2; NPC.defense = NPC.defDefense * 3; } // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge) + if (Main.zenithWorld) chargeTime *= 2; // Set variables for spawn effects @@ -560,7 +581,7 @@ namespace CalamityMod.NPCs.OldDuke { NPC.alpha = (int)MathHelper.Lerp(NPC.alpha, 0, 0.2f); - // Avoid cheap bullshit + // Disable contact damage while spawning NPC.damage = 0; // Velocity @@ -630,9 +651,6 @@ namespace CalamityMod.NPCs.OldDuke // Phase 1 else if (NPC.ai[0] == 0f && !player.dead) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity if (NPC.ai[1] == 0f) NPC.ai[1] = 500 * Math.Sign((NPC.Center - player.Center).X); @@ -743,11 +761,8 @@ namespace CalamityMod.NPCs.OldDuke // Charge else if (NPC.ai[0] == 1f) { - // Set damage - NPC.damage = setDamage; - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge && 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); @@ -811,9 +826,6 @@ namespace CalamityMod.NPCs.OldDuke // Tooth Ball belch else if (NPC.ai[0] == 2f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity if (NPC.ai[1] == 0f) NPC.ai[1] = 500 * Math.Sign((NPC.Center - player.Center).X); @@ -897,9 +909,6 @@ namespace CalamityMod.NPCs.OldDuke // Call sharks from the sides of the screen else if (NPC.ai[0] == 3f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity NPC.velocity *= 0.98f; NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); @@ -919,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); @@ -944,9 +953,6 @@ namespace CalamityMod.NPCs.OldDuke // Transition to phase 2 and call sharks from below else if (NPC.ai[0] == 4f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity NPC.velocity *= 0.98f; NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); @@ -966,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); @@ -993,9 +999,6 @@ namespace CalamityMod.NPCs.OldDuke // Phase 2 else if (NPC.ai[0] == 5f && !player.dead) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity if (NPC.ai[1] == 0f) NPC.ai[1] = 500 * Math.Sign((NPC.Center - player.Center).X); @@ -1118,11 +1121,8 @@ namespace CalamityMod.NPCs.OldDuke // Charge else if (NPC.ai[0] == 6f) { - // Set damage - NPC.damage = setDamage; - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge && 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); @@ -1178,9 +1178,6 @@ namespace CalamityMod.NPCs.OldDuke // Tooth Ball and Vortex spin else if (NPC.ai[0] == 7f) { - // Set damage - NPC.damage = 0; - // Play sounds and spawn Tooth Balls and a Vortex if (NPC.ai[2] == 0f) { @@ -1188,10 +1185,9 @@ namespace CalamityMod.NPCs.OldDuke SoundEngine.PlaySound(VortexSpawnSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 vortexSpawn = NPC.Center + NPC.velocity.RotatedBy(MathHelper.PiOver2 * -NPC.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, VortexDamage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } if (NPC.ai[2] % toothBallSpinPhaseDivisor == 0f) @@ -1262,9 +1258,6 @@ namespace CalamityMod.NPCs.OldDuke // Vomit a huge amount of gore into the sky and call sharks from the sides of the screen else if (NPC.ai[0] == 8f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity NPC.velocity *= 0.98f; NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); @@ -1278,20 +1271,19 @@ namespace CalamityMod.NPCs.OldDuke { Vector2 phase2GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - 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; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), phase2GoreDirection.X, phase2GoreDirection.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), phase2GoreDirection.X, phase2GoreDirection.Y, velocityX, -velocityY, type, GoreDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1327,9 +1319,6 @@ namespace CalamityMod.NPCs.OldDuke // Transition to phase 3 and summon sharks from above else if (NPC.ai[0] == 9f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity NPC.velocity *= 0.98f; NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); @@ -1349,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); @@ -1376,9 +1365,6 @@ namespace CalamityMod.NPCs.OldDuke // Phase 3 else if (NPC.ai[0] == 10f && !player.dead) { - // Avoid cheap bullshit - NPC.damage = 0; - // Alpha NPC.alpha -= 25; if (NPC.alpha < 0) @@ -1513,11 +1499,8 @@ namespace CalamityMod.NPCs.OldDuke // Charge else if (NPC.ai[0] == 11f) { - // Set damage - NPC.damage = setDamage; - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge && 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); @@ -1573,7 +1556,7 @@ namespace CalamityMod.NPCs.OldDuke // Pause before teleport else if (NPC.ai[0] == 12f) { - // Avoid cheap bullshit + // Disable contact damage during the teleporting phase NPC.damage = 0; // Alpha @@ -1638,9 +1621,6 @@ namespace CalamityMod.NPCs.OldDuke // Vomit a huge amount of gore into the sky and call sharks from the sides of the screen else if (NPC.ai[0] == 13f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Velocity NPC.velocity *= 0.98f; NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); @@ -1654,20 +1634,19 @@ namespace CalamityMod.NPCs.OldDuke { Vector2 phase3GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - 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; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), phase3GoreDirection.X, phase3GoreDirection.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), phase3GoreDirection.X, phase3GoreDirection.Y, velocityX, -velocityY, type, GoreDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1684,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); @@ -1709,9 +1688,6 @@ namespace CalamityMod.NPCs.OldDuke // Tooth Ball and Vortex spin else if (NPC.ai[0] == 14f) { - // Set damage - NPC.damage = 0; - // Play sounds and spawn Tooth Balls and a Vortex if (NPC.ai[2] == 0f) { @@ -1719,10 +1695,9 @@ namespace CalamityMod.NPCs.OldDuke SoundEngine.PlaySound(VortexSpawnSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 vortexSpawn = NPC.Center + NPC.velocity.RotatedBy(MathHelper.PiOver2 * -NPC.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, VortexDamage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } if (NPC.ai[2] % toothBallSpinPhaseDivisor == 0f) @@ -1797,7 +1772,6 @@ namespace CalamityMod.NPCs.OldDuke public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void ModifyTypeName(ref string typeName) @@ -2154,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 9203aec38b..03bc136dcb 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -21,12 +21,15 @@ namespace CalamityMod.NPCs.OldDuke this.HideFromBestiary(); } + public static int ToothDamage = 60; // 240 + public static int CloudDamage = 70; // 280 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 40; NPC.height = 40; NPC.defense = 0; @@ -183,7 +186,6 @@ namespace CalamityMod.NPCs.OldDuke int totalProjectiles = CalamityWorld.death ? 5 : CalamityWorld.revenge ? 4 : 3; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float velocity = 10f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -192,14 +194,13 @@ namespace CalamityMod.NPCs.OldDuke for (int k = 0; k < totalProjectiles; k++) { Vector2 toothSpikeRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, toothSpikeRotation * 0.1f, type, damage, 0f, Main.myPlayer, toothSpikeRotation.X, toothSpikeRotation.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, toothSpikeRotation * 0.1f, type, ToothDamage, 0f, Main.myPlayer, toothSpikeRotation.X, toothSpikeRotation.Y); } if (Main.expertMode) { type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, CloudDamage, 0f, Main.myPlayer); } } @@ -211,16 +212,11 @@ namespace CalamityMod.NPCs.OldDuke int type = ModContent.ProjectileType(); for (int i = 0; i < 2; i++) Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center.X + Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, - Main.rand.Next(-1, 2), Main.rand.Next(-6, -3), type, NPC.damage / 2, 0f, Main.myPlayer); + Main.rand.Next(-1, 2), Main.rand.Next(-6, -3), type, OldDuke.GoreDamage, 0f, Main.myPlayer); } } } - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment)/* tModPorter Note: bossLifeScale -> balance (bossAdjustment is different, see the docs for details) */ - { - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = ImmunityCooldownID.Bosses; @@ -254,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 f2692d5014..d399c527f3 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -28,11 +28,11 @@ namespace CalamityMod.NPCs.OldDuke public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; NPC.width = 44; NPC.height = 44; - NPC.GetNPCDamage(); NPC.defense = 100; NPC.lifeMax = 6000; if (BossRushEvent.BossRushActive) @@ -207,24 +207,18 @@ 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(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < 10; i++) { Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X + Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, - Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), type, damage, 0f, Main.myPlayer); + Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), type, OldDuke.GoreDamage, 0f, Main.myPlayer); } } } - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment)/* tModPorter Note: bossLifeScale -> balance (bossAdjustment is different, see the docs for details) */ - { - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) @@ -268,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/CalamitasEnchantDemon.cs b/NPCs/Other/CalamitasEnchantDemon.cs index 831470fdd5..bcd5e9b907 100644 --- a/NPCs/Other/CalamitasEnchantDemon.cs +++ b/NPCs/Other/CalamitasEnchantDemon.cs @@ -30,7 +30,6 @@ namespace CalamityMod.NPCs.Other NPC.DeathSound = SoundID.NPCDeath18; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = 0; diff --git a/NPCs/Other/DemonPortal.cs b/NPCs/Other/DemonPortal.cs index 4c870617d8..bef1ccef69 100644 --- a/NPCs/Other/DemonPortal.cs +++ b/NPCs/Other/DemonPortal.cs @@ -25,7 +25,6 @@ namespace CalamityMod.NPCs.Other NPC.lifeMax = 25000; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = -1; diff --git a/NPCs/Other/ExhumedHeart.cs b/NPCs/Other/ExhumedHeart.cs index dd0a285bbe..d123d5aebe 100644 --- a/NPCs/Other/ExhumedHeart.cs +++ b/NPCs/Other/ExhumedHeart.cs @@ -32,7 +32,6 @@ namespace CalamityMod.NPCs.Other NPC.lifeMax = 50000; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0f; diff --git a/NPCs/Other/LecherousOrb.cs b/NPCs/Other/LecherousOrb.cs index 5d6d4e7e7d..2ed0ff9386 100644 --- a/NPCs/Other/LecherousOrb.cs +++ b/NPCs/Other/LecherousOrb.cs @@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.Other NPC.lifeMax = 180000; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath7; NPC.knockBackResist = 0f; diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index a01ab4802f..516be41821 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.Other NPC.defense = 100; NPC.lifeMax = 2500000; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(100, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 100); NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = null; NPC.boss = true; @@ -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/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 7050cc53a2..18063cf7e3 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 20; // 40 NPC.width = 60; NPC.height = 60; NPC.defense = 8; @@ -141,21 +141,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index ebe58856f4..94bbae9e1f 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 14; // 28 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 40; @@ -107,8 +107,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -123,8 +122,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.type = ModContent.NPCType(); @@ -144,8 +142,7 @@ namespace CalamityMod.NPCs.Perforator if (death && !spawnedBlob) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } int whoAmI2 = NPC.whoAmI; @@ -200,22 +197,6 @@ namespace CalamityMod.NPCs.Perforator NPC.position.Y += targetY; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -279,15 +260,14 @@ namespace CalamityMod.NPCs.Perforator if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer); for (int i = -1; i < 2; i++) //releases 3 Ichor Shots { int type2 = ModContent.ProjectileType(); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); int spread = Main.rand.Next(16, 36); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer); } } } @@ -316,8 +296,7 @@ namespace CalamityMod.NPCs.Perforator { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.Ichor, 120); + target.AddBuff(BuffID.Ichor, 240); } } } diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 2cfea10d43..160109d293 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 42; NPC.height = 42; NPC.defense = 4; @@ -136,22 +136,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 95cfa32ad3..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() @@ -49,11 +47,14 @@ namespace CalamityMod.NPCs.Perforator } } + // GFB exclusive + public static int LaserWallDamage = 10; // 40 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 80 NPC.npcSlots = 5f; NPC.width = 70; NPC.height = 84; @@ -101,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(); } @@ -129,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; @@ -154,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); } @@ -217,7 +199,7 @@ namespace CalamityMod.NPCs.Perforator for (int i = 0; i < spitProjectileAmount; i++) { int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = type == ModContent.ProjectileType() ? PerforatorHive.IchorShotDamage : PerforatorHive.BloodGeyserDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), spitLocation + Main.rand.NextVector2CircularEdge(8f, 8f), NPC.velocity.SafeNormalize(Vector2.UnitY) * spitProjectileBaseVelocity + Main.rand.NextVector2CircularEdge(spitProjectileRandomVelocityLimit, spitProjectileRandomVelocityLimit), @@ -233,11 +215,10 @@ namespace CalamityMod.NPCs.Perforator for (int i = 0; i < spitBlobAmount; i++) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Projectile.NewProjectile(NPC.GetSource_FromAI(), spitLocation + Main.rand.NextVector2CircularEdge(8f, 8f), NPC.velocity.SafeNormalize(Vector2.UnitY) * spitBlobBaseVelocity + Main.rand.NextVector2CircularEdge(spitBlobRandomVelocityLimit, spitBlobRandomVelocityLimit), - type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + type, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -359,7 +340,7 @@ namespace CalamityMod.NPCs.Perforator float laserOffset = 1500f; float laserVelocity = 4f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = LaserWallDamage; NPC.Calamity().newAI[3]++; if (NPC.Calamity().newAI[3] > 180f) // Effectively 10 seconds but give a little headstart in case players kill it too fast @@ -531,19 +512,6 @@ namespace CalamityMod.NPCs.Perforator if (NPC.Distance(player.Center) > 1280f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChargeSpeed * 0.25f; - float minimalDamageVelocity = maxChargeSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 878b4b2717..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); @@ -49,7 +48,7 @@ namespace CalamityMod.NPCs.Perforator { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 24; // 48 NPC.npcSlots = 5f; NPC.width = 58; NPC.height = 68; @@ -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); } @@ -169,8 +153,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -184,8 +167,7 @@ namespace CalamityMod.NPCs.Perforator if (death && !spawnedBlob) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -444,19 +426,6 @@ namespace CalamityMod.NPCs.Perforator if (NPC.Distance(player.Center) > 1280f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChargeSpeed * 0.25f; - float minimalDamageVelocity = maxChargeSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -497,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) @@ -562,15 +531,14 @@ namespace CalamityMod.NPCs.Perforator if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer); for (int i = -1; i < 2; i++) //releases 3 Ichor Shots { int type2 = ModContent.ProjectileType(); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); int spread = Main.rand.Next(16, 36); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer); } } } @@ -592,8 +560,7 @@ namespace CalamityMod.NPCs.Perforator { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(BuffID.Ichor, 240); + target.AddBuff(BuffID.Ichor, 360); } } } diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index a1a9b28921..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() @@ -54,7 +51,7 @@ namespace CalamityMod.NPCs.Perforator { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 22; // 44 NPC.npcSlots = 5f; NPC.width = 42; NPC.height = 62; @@ -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; } @@ -448,19 +418,6 @@ namespace CalamityMod.NPCs.Perforator if (NPC.Distance(player.Center) > 1280f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChargeSpeed * 0.25f; - float minimalDamageVelocity = maxChargeSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index a6ee61ee34..3889abcdb1 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -18,6 +18,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -43,13 +44,21 @@ namespace CalamityMod.NPCs.Perforator public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfHiveDeath"); public static Asset GlowTexture; + // Squash n' stretch won't affect actual hitbox size + private const int Width = 110; + private const int Height = 100; - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - private bool small = false; - private bool medium = false; - private bool large = false; + private bool smallSpawned = false; + private bool mediumSpawned = false; + private bool largeSpawned = false; private int wormsAlive = 0; + private float addedStretch; + private int squashTimer = 0; // Tracks current progress in scaling animation + private const int squashInterval = 24; + private const float maxSquash = 0.3f; // Upper intensity + private float wormSpawnStateTimer = 0f; // For managing worm spawn animation + public override void SetStaticDefaults() { Main.npcFrameCount[Type] = 10; @@ -63,19 +72,23 @@ namespace CalamityMod.NPCs.Perforator } } + public static int BloodGeyserDamage = 12; // 48 + public static int IchorShotDamage = 12; // 48 + public static int IchorBlobDamage = 12; // 48 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; NPC.npcSlots = 18f; - NPC.GetNPCDamage(); - NPC.width = 110; - NPC.height = 100; + NPC.damage = 30; // 48 (1.6x expert scaling) + NPC.width = Width; + NPC.height = Height; NPC.defense = 4; NPC.LifeMaxNERB(4800, 5750, 270000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 8, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.boss = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -106,22 +119,22 @@ namespace CalamityMod.NPCs.Perforator public override void SendExtraAI(BinaryWriter writer) { - writer.Write(biomeEnrageTimer); writer.Write(wormsAlive); - writer.Write(small); - writer.Write(medium); - writer.Write(large); + writer.Write(smallSpawned); + writer.Write(mediumSpawned); + writer.Write(largeSpawned); writer.Write(NPC.localAI[2]); + writer.Write(wormSpawnStateTimer); } public override void ReceiveExtraAI(BinaryReader reader) { - biomeEnrageTimer = reader.ReadInt32(); wormsAlive = reader.ReadInt32(); - small = reader.ReadBoolean(); - medium = reader.ReadBoolean(); - large = reader.ReadBoolean(); + smallSpawned = reader.ReadBoolean(); + mediumSpawned = reader.ReadBoolean(); + largeSpawned = reader.ReadBoolean(); NPC.localAI[2] = reader.ReadSingle(); + wormSpawnStateTimer = reader.ReadSingle(); } public override void AI() @@ -152,34 +165,15 @@ namespace CalamityMod.NPCs.Perforator // Phases based on life percentage bool phase2 = lifeRatio < 0.7f; - // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; + 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; - 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; @@ -195,6 +189,8 @@ namespace CalamityMod.NPCs.Perforator return; } } + + // Natural despawn prevention else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; @@ -203,7 +199,7 @@ namespace CalamityMod.NPCs.Perforator { // Leak projectiles everywhere and start healing int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = type == ModContent.ProjectileType() ? IchorShotDamage : BloodGeyserDamage; int spread = Main.rand.Next(-45, 46); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread)), type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); @@ -239,72 +235,139 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().DR = wormsAlive * 0.3f; - if (NPC.ai[3] == 0f && NPC.life > 0) - NPC.ai[3] = NPC.lifeMax; - - bool canSpawnWorms = !small || !medium || !large || CalamityWorld.LegendaryMode; - if (NPC.life > 0 && canSpawnWorms) + if (Main.netMode != NetmodeID.MultiplayerClient && wormSpawnStateTimer == 0f) { - if (Main.netMode != NetmodeID.MultiplayerClient) + if ((!smallSpawned && spawnSmall) || + (!mediumSpawned && spawnMedium) || + (!largeSpawned && spawnLarge)) { - int wormSpawnGateValue = (int)(NPC.lifeMax * (CalamityWorld.LegendaryMode ? 0.15 : 0.25)); - if ((NPC.life + wormSpawnGateValue) < NPC.ai[3]) + wormSpawnStateTimer = 1f; // Start slowing down to spawn a worm + NPC.netUpdate = true; + } + } + + if (wormSpawnStateTimer > 0f) + { + + NPC.velocity *= 0.94f; // Slow down + NPC.rotation = NPC.velocity.X * 0.04f; // Update rotation to match velocity + + NPC.damage = 0; + + wormSpawnStateTimer++; + + int slowDownDuration = 20; + int waitBeforeSpawnDuration = 40; + int totalStateDuration = slowDownDuration + waitBeforeSpawnDuration; + + if (wormSpawnStateTimer >= slowDownDuration && wormSpawnStateTimer < totalStateDuration) + { + if (Main.rand.NextBool(7)) { - NPC.ai[3] = NPC.life; - int wormType = ModContent.NPCType(); - if (!small) - { - small = true; - } - else if (!medium) - { - medium = true; - wormType = ModContent.NPCType(); - } - else if (!large) - { - large = true; - wormType = ModContent.NPCType(); - } + int bloodLifetime = Main.rand.Next(20, 45); + float bloodScale = Main.rand.NextFloat(0.5f, 1f); + Color bloodColor = Color.Lerp(Color.Yellow, Color.DarkRed, Main.rand.NextFloat(0.7f)); + float randomSpeedMultiplier = Main.rand.NextFloat(0.8f, 1.6f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit(5) * 1.5f * randomSpeedMultiplier; + bloodVelocity.Y -= 8f; - if (CalamityWorld.LegendaryMode && 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); - else if (lifeRatio > 0.2f) - 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); - else if (lifeRatio > 0.05f) - 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); - } - else - { - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); + Vector2 randomOffset = Main.rand.NextVector2Unit() * Main.rand.NextFloat(25f, 50f); + Vector2 spawnPosition = NPC.Center + randomOffset; - // Spawn two small worms in Death - if (death) - { - if (wormType == ModContent.NPCType()) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); - } - } - - NPC.TargetClosest(); - - SoundEngine.PlaySound(WormSpawn, NPC.Center); - - for (int i = 0; i < 16; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Ichor); - - for (int j = 0; j < 32; j++) - { - int bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood); - Main.dust[bloodDust].noGravity = true; - Main.dust[bloodDust].scale = 3f; - bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood); - Main.dust[bloodDust].scale = 2f; - } + BloodParticle blood = new BloodParticle(spawnPosition, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); } } + + else if (wormSpawnStateTimer >= totalStateDuration) + { + // Blood vars change based on worm spawned + Color bloodColor = Color.Lerp(Color.Crimson, Color.DarkRed, Main.rand.NextFloat(0.9f)); + int bloodAmt = 0; + float minScale = 1f; + float maxScale = 1.8f; + int wormType = -1; + + if (!smallSpawned) + { + + smallSpawned = true; + wormType = ModContent.NPCType(); + + bloodAmt = 12; + } + else if (!mediumSpawned && spawnMedium) + { + mediumSpawned = true; + wormType = ModContent.NPCType(); + + bloodColor = Color.Lerp(Color.Yellow, Color.Orange, Main.rand.NextFloat(0.9f)); + bloodAmt = 12; + minScale = 1.5f; + maxScale = 2.4f; + } + else if (!largeSpawned && spawnLarge) + { + largeSpawned = true; + wormType = ModContent.NPCType(); + + bloodAmt = 18; + minScale = 1.4f; + maxScale = 2.2f; + } + + for (int i = 0; i < bloodAmt; ++i) + { + int bloodLifetime = Main.rand.Next(80, 140); + float bloodScale = Main.rand.NextFloat(minScale, maxScale); + + float randomSpeedMultiplier = Main.rand.NextFloat(1.4f, 2.2f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 4 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(NPC.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + + + 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); + else if (lifeRatio > 0.2f) + 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); + else if (lifeRatio > 0.05f) + 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); + } + if (wormType != -1) + { + squashTimer = squashInterval; // Start scaling animation + + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); + + // Spawn two small worms in Death + if (death) + { + if (wormType == ModContent.NPCType()) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); + } + } + + NPC.TargetClosest(); + SoundEngine.PlaySound(WormSpawn, NPC.Center); + wormSpawnStateTimer = 0f; // Resets for next time its called + NPC.netUpdate = true; + } + return; // Don't progress in the AI loop until a worm has finished spawning + } + + if (squashTimer > 0) + { + squashTimer--; + addedStretch = MathHelper.Lerp(0f, maxSquash, (float) squashTimer / squashInterval); + } + else + { + addedStretch = 0f; } if (Math.Abs(NPC.Center.X - player.Center.X) > 10f) @@ -319,7 +382,7 @@ namespace CalamityMod.NPCs.Perforator // Emit ichor blobs if (phase2) { - if (wormsAlive == 0 || large || floatAboveToFireBlobs || CalamityWorld.LegendaryMode) + if (wormsAlive == 0 || largeSpawned || floatAboveToFireBlobs || Main.getGoodWorld) { NPC.ai[2] += 1f; if (NPC.ai[2] >= blobPhaseGateValue) @@ -330,7 +393,27 @@ namespace CalamityMod.NPCs.Perforator NPC.velocity *= 0.96f; else NPC.ai[2] = blobPhaseGateValue + 300f; + } + + if (NPC.ai[2] < blobPhaseGateValue + 180f) + { + if (Main.rand.NextBool(4)) + { + int bloodLifetime = Main.rand.Next(25, 35); + float bloodScale = Main.rand.NextFloat(0.6f, 0.95f); + Color bloodColor = Color.Lerp(Color.Yellow, Color.Orange, Main.rand.NextFloat(0.8f)); + float randomSpeedMultiplier = Main.rand.NextFloat(1.5f, 2.5f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * randomSpeedMultiplier; + + Vector2 spawnPosition = NPC.Center; + spawnPosition.Y += 42; + + BloodParticle blood = new BloodParticle(spawnPosition, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + } + else { NPC.ai[2] = 0f; @@ -348,13 +431,12 @@ namespace CalamityMod.NPCs.Perforator Main.dust[ichorDust].scale = 0.5f; } - bool ichorBlobBigWormPhase = wormsAlive > 0 && large; + 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(); - int damage = NPC.GetProjectileDamage(type); int blobSpread = expertMode ? (ichorBlobBigWormPhase ? 66 : 100) : (ichorBlobBigWormPhase ? 33 : 66); for (int i = 0; i < numBlobs; i++) @@ -363,14 +445,14 @@ 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; if (blobVelocity.Y < 2f) blobVelocity.Y = 2f + blobVelocityYAdd; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 50f, blobVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 50f, blobVelocity, type, IchorBlobDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -379,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) { @@ -389,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; } @@ -405,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; @@ -419,7 +498,7 @@ namespace CalamityMod.NPCs.Perforator { bool ichor = Main.rand.NextBool(); int type = ichor ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = ichor ? IchorShotDamage : BloodGeyserDamage; Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Vector2 randomVelocity = new Vector2(Main.rand.NextFloat() - 0.5f, Main.rand.NextFloat() - 0.5f); @@ -464,14 +543,14 @@ namespace CalamityMod.NPCs.Perforator // Set damage NPC.damage = NPC.defDamage; - if (large || death) - Movement(player, 13f + velocityEnrageIncrease, death ? 0.115f : 0.1f, 20f); - else if (medium) - Movement(player, 12f + velocityEnrageIncrease, death ? 0.11f : 0.095f, 30f); - else if (small) - Movement(player, 11f + velocityEnrageIncrease, death ? 0.105f : 0.09f, 40f); + if (largeSpawned || death) + Movement(player, 13f, death ? 0.115f : 0.1f, 20f); + else if (mediumSpawned) + Movement(player, 12f, death ? 0.11f : 0.095f, 30f); + else if (smallSpawned) + 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; @@ -480,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; @@ -489,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; @@ -498,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; } @@ -508,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); } } @@ -529,22 +608,19 @@ namespace CalamityMod.NPCs.Perforator public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; + SpriteEffects spriteEffects = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Texture2D texture = TextureAssets.Npc[Type].Value; + Color drawColorAlpha = NPC.GetAlpha(drawColor); - Texture2D texture2D15 = TextureAssets.Npc[Type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); + Vector2 scaleStretch = new Vector2(1f - addedStretch, 1f + addedStretch) * NPC.scale; + float yOffset = addedStretch * 0.5f * NPC.height; // offset from stretching - Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; - drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - - texture2D15 = GlowTexture.Value; + spriteBatch.Draw(texture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY - yOffset), NPC.frame, drawColorAlpha, NPC.rotation, NPC.frame.Size() * 0.5f, scaleStretch, spriteEffects, 0f); + texture = GlowTexture.Value; Color glowmaskColor = Color.Lerp(Color.White, Color.Yellow, 0.5f); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + // done again to fix glowmask not matching sprite + spriteBatch.Draw(texture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY - yOffset), NPC.frame, glowmaskColor, NPC.rotation, NPC.frame.Size() * 0.5f, scaleStretch, spriteEffects, 0f); return false; } @@ -552,7 +628,7 @@ namespace CalamityMod.NPCs.Perforator public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void BossLoot(ref int potionType) @@ -606,7 +682,6 @@ namespace CalamityMod.NPCs.Perforator normalOnly.Add(ItemID.CrimtaneBar, 1, 10, 15); normalOnly.Add(ItemID.Vertebrae, 1, 10, 15); normalOnly.Add(ItemID.CrimsonSeeds, 1, 10, 15); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); normalOnly.Add(ItemDropRule.ByCondition(DropHelper.Hardmode(), ItemID.Ichor, 1, 10, 20)); // Equipment @@ -631,15 +706,6 @@ namespace CalamityMod.NPCs.Perforator npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPerforator, ModContent.ItemType(), desc: DropHelper.FirstKillText); } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Ichor, 300); - } - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < hit.Damage / NPC.lifeMax * 100.0; k++) @@ -661,7 +727,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 100; NPC.position.X = NPC.position.X - (float)(NPC.width / 2); NPC.position.Y = NPC.position.Y - (float)(NPC.height / 2); - for (int i = 0; i < 40; i++) + for (int i = 0; i < 12; i++) { int ichorDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[ichorDust].velocity *= 3f; @@ -671,7 +737,7 @@ namespace CalamityMod.NPCs.Perforator Main.dust[ichorDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int j = 0; j < 70; j++) + for (int j = 0; j < 20; j++) { int bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 3f); Main.dust[bloodDust].noGravity = true; @@ -679,6 +745,19 @@ namespace CalamityMod.NPCs.Perforator bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[bloodDust].velocity *= 2f; } + // Blood burst + for (int i = 0; i < 24; ++i) + { + int bloodLifetime = Main.rand.Next(120, 200); + float bloodScale = Main.rand.NextFloat(1.3f, 2.6f); + Color bloodColor = Color.Lerp(Color.Crimson, Color.DarkRed, Main.rand.NextFloat(0.9f)); + float randomSpeedMultiplier = Main.rand.NextFloat(4.5f, 9f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit(6) * 2.5f * randomSpeedMultiplier; + bloodVelocity.Y -= 14f; + + BloodParticle blood = new BloodParticle(NPC.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } } } } diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 6cd8a641a4..8259cead41 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 16; // 32 NPC.width = 60; NPC.height = 78; NPC.defense = 12; @@ -137,21 +137,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -229,7 +214,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 166adf31ff..88fb7306fd 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 50; @@ -95,8 +95,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -110,8 +109,7 @@ namespace CalamityMod.NPCs.Perforator if (death && !spawnedBlob) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -161,22 +159,6 @@ namespace CalamityMod.NPCs.Perforator NPC.position.Y += targetY; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -260,15 +242,14 @@ namespace CalamityMod.NPCs.Perforator if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer); for (int i = -1; i < 2; i++) //releases 3 Ichor Shots { int type2 = ModContent.ProjectileType(); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); int spread = Main.rand.Next(16, 36); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer); } } } @@ -277,8 +258,7 @@ namespace CalamityMod.NPCs.Perforator { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(BuffID.Ichor, 60); + target.AddBuff(BuffID.Ichor, 240); } } } diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index b3acc752b3..5078662f3f 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 40; NPC.height = 34; NPC.defense = 8; @@ -137,22 +137,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -229,7 +213,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120, true); } } } diff --git a/NPCs/PlagueEnemies/Melter.cs b/NPCs/PlagueEnemies/Melter.cs index dea1fd8d09..8b293fff79 100644 --- a/NPCs/PlagueEnemies/Melter.cs +++ b/NPCs/PlagueEnemies/Melter.cs @@ -31,10 +31,10 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 55; NPC.width = 38; NPC.height = 34; - NPC.defense = 15; - NPC.lifeMax = 630; + NPC.defense = 20; + NPC.lifeMax = 800; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; Banner = NPC.type; BannerItem = ModContent.ItemType(); diff --git a/NPCs/PlagueEnemies/PestilentSlime.cs b/NPCs/PlagueEnemies/PestilentSlime.cs index 2ef07a61a0..404305cecf 100644 --- a/NPCs/PlagueEnemies/PestilentSlime.cs +++ b/NPCs/PlagueEnemies/PestilentSlime.cs @@ -31,11 +31,11 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 55; NPC.width = 40; NPC.height = 30; - NPC.defense = 12; - NPC.lifeMax = 440; + NPC.defense = 35; + NPC.lifeMax = 600; NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.alpha = 60; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs index 9ee6463812..03c4d3b92a 100644 --- a/NPCs/PlagueEnemies/PlagueCharger.cs +++ b/NPCs/PlagueEnemies/PlagueCharger.cs @@ -36,14 +36,14 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 37; NPC.width = 36; NPC.height = 30; - NPC.defense = 20; + NPC.defense = 32; NPC.scale *= 0.5f; - NPC.lifeMax = 250; + NPC.lifeMax = 720; NPC.aiStyle = NPCAIStyleID.Flying; AIType = NPCID.Bee; NPC.knockBackResist = 0.4f; AnimationType = NPCID.Bee; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.noGravity = true; NPC.noTileCollide = false; diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs index 14d694065b..752dc4a30f 100644 --- a/NPCs/PlagueEnemies/PlagueChargerLarge.cs +++ b/NPCs/PlagueEnemies/PlagueChargerLarge.cs @@ -31,14 +31,14 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 45; NPC.width = 36; NPC.height = 30; - NPC.defense = 25; + NPC.defense = 36; NPC.scale *= 0.75f; - NPC.lifeMax = 380; + NPC.lifeMax = 840; NPC.aiStyle = NPCAIStyleID.Flying; AIType = NPCID.Bee; NPC.knockBackResist = 0.3f; AnimationType = NPCID.Bee; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit4; NPC.noGravity = true; NPC.noTileCollide = false; diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 83903bb0d6..4a8bfcc316 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -42,9 +42,8 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.width = 66; NPC.height = 66; NPC.defense = 24; - NPC.DR_NERD(0.2f); NPC.lifeMax = 8750; - NPC.value = Item.buyPrice(0, 1, 50, 0); + NPC.value = Item.buyPrice(gold: 1, silver: 50); NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; diff --git a/NPCs/PlagueEnemies/Plagueshell.cs b/NPCs/PlagueEnemies/Plagueshell.cs index a5ff148bcf..4c728c12c0 100644 --- a/NPCs/PlagueEnemies/Plagueshell.cs +++ b/NPCs/PlagueEnemies/Plagueshell.cs @@ -27,11 +27,11 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.aiStyle = NPCAIStyleID.GiantTortoise; NPC.width = 46; NPC.height = 32; - NPC.defense = 32; - NPC.lifeMax = 1000; + NPC.defense = 50; + NPC.lifeMax = 1200; NPC.knockBackResist = 0.2f; AnimationType = NPCID.GiantTortoise; - NPC.value = Item.buyPrice(0, 0, 15, 0); + NPC.value = Item.buyPrice(silver: 15); NPC.HitSound = SoundID.NPCHit24; NPC.noGravity = false; Banner = NPC.type; diff --git a/NPCs/PlagueEnemies/Viruling.cs b/NPCs/PlagueEnemies/Viruling.cs index 426f0116ee..df650e78ee 100644 --- a/NPCs/PlagueEnemies/Viruling.cs +++ b/NPCs/PlagueEnemies/Viruling.cs @@ -30,10 +30,10 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 60; NPC.width = 58; NPC.height = 44; - NPC.defense = 18; - NPC.lifeMax = 500; + NPC.defense = 32; + NPC.lifeMax = 900; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit22; Banner = NPC.type; BannerItem = ModContent.ItemType(); diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 3645aa3d7a..54e52eea8d 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -31,8 +31,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 70; // 140 NPC.width = 22; NPC.height = 22; NPC.defense = 20; @@ -261,7 +260,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath target.AddBuff(BuffID.Poisoned, 240); target.AddBuff(BuffID.Venom, 240); } - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 120); } } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 93acd2daea..eb7fb95f8f 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 80; // 160 NPC.width = 42; NPC.height = 42; NPC.defense = 20; @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath target.AddBuff(BuffID.Poisoned, 300); target.AddBuff(BuffID.Venom, 300); } - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 652243aaa9..0bd369b793 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -84,10 +84,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } + public static int StingerDamage = 28; // 112 + public static int NukeDamage = 35; // 140; Also applies to GFB Peanuts and Gauss Nukes + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.npcSlots = 64f; NPC.width = 198; NPC.height = 198; @@ -98,7 +101,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.aiStyle = -1; AIType = -1; NPC.boss = true; - NPC.value = Item.buyPrice(0, 30, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; @@ -172,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; @@ -204,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--; @@ -245,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); @@ -536,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) { @@ -795,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; @@ -860,7 +863,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = type == ModContent.ProjectileType() ? NukeDamage : StingerDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), stingerSpawnPos.X, stingerSpawnPos.Y, projXDist, projYDist, type, damage, 0f, Main.myPlayer, challengeAmt, player.position.Y); NPC.netUpdate = true; } @@ -906,7 +909,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath missileVelocity += 2f * enrageScale; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = NukeDamage; int chargeDistanceX = 600; float chargeSpeed = revenge ? 28f : 26f; @@ -1336,7 +1339,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1374,7 +1377,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 7a829ce8d6..c1b66f1394 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -23,18 +23,19 @@ namespace CalamityMod.NPCs.Polterghast NPCID.Sets.TrailingMode[Type] = 1; } + public static int MineDamage = 75; // 300 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.aiStyle = -1; AIType = -1; NPC.width = 30; NPC.height = 30; NPC.defense = 45; - NPC.DR_NERD(0.1f); NPC.noGravity = true; NPC.noTileCollide = true; NPC.chaseable = false; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats NPC.lifeMax = 20000; NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; @@ -80,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; @@ -98,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) @@ -110,10 +111,9 @@ namespace CalamityMod.NPCs.Polterghast if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float maxVelocity = 8f * tileEnrageMult; float acceleration = 1.15f + (tileEnrageMult - 1f) * 0.15f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction, type, damage, 1f, NPC.target, maxVelocity, acceleration); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction, type, MineDamage, 1f, NPC.target, maxVelocity, acceleration); } NPC.ai[2] = 0f; } @@ -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 3920518521..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.GetNPCDamage(); + 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; @@ -185,12 +185,8 @@ namespace CalamityMod.NPCs.Polterghast else NPC.rotation = NPC.velocity.ToRotation() + MathHelper.PiOver2; - int reducedSetDamage = (int)Math.Round(NPC.defDamage * 0.5); - if (!chargePhase) { - NPC.damage = reducedSetDamage; - // Set this here to avoid despawn issues reachedChargingPoint = false; @@ -306,23 +302,17 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.Calamity().newAI[1] == 0f) { - NPC.damage = NPC.defDamage; - NPC.velocity = Vector2.Normalize(rotationVector) * chargeVelocity; NPC.Calamity().newAI[1] = 1f; } else { - NPC.damage = NPC.defDamage; - NPC.Calamity().newAI[2] += 1f; // Slow down for a few frames float totalChargeTime = chargeDistance * 4f / chargeVelocity; float slowDownTime = chargeVelocity; { - NPC.damage = reducedSetDamage; - if (NPC.Calamity().newAI[2] >= totalChargeTime - slowDownTime) NPC.velocity *= 0.9f; } @@ -347,9 +337,6 @@ namespace CalamityMod.NPCs.Polterghast } else { - // Do not deal damage during movement to avoid cheap bullshit hits - NPC.damage = 0; - // Random location choice if (NPC.ai[0] == 0f) { @@ -435,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; @@ -539,7 +526,6 @@ namespace CalamityMod.NPCs.Polterghast public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 67663ed07a..2585460db1 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -103,11 +103,18 @@ namespace CalamityMod.NPCs.Polterghast } } + 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() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.npcSlots = 50f; - NPC.GetNPCDamage(); NPC.width = 90; NPC.height = 120; NPC.defense = 90; @@ -116,7 +123,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(1, 50, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.boss = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -218,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; @@ -425,12 +432,6 @@ namespace CalamityMod.NPCs.Polterghast else NPC.rotation = NPC.velocity.ToRotation() + MathHelper.PiOver2; - int phase1ReducedSetDamage = (int)Math.Round(NPC.defDamage * 0.5); - int phase2Damage = (int)Math.Round(NPC.defDamage * 1.2); - int phase2ReducedSetDamage = (int)Math.Round(phase2Damage * 0.5); - int phase3Damage = (int)Math.Round(NPC.defDamage * 1.4); - int phase3ReducedSetDamage = (int)Math.Round(phase3Damage * 0.5); - if (!chargePhase) { NPC.ai[2] += 1f; @@ -537,15 +538,11 @@ namespace CalamityMod.NPCs.Polterghast if (calamityGlobalNPC.newAI[1] == 0f) { - NPC.damage = phase3 ? phase3Damage : phase2 ? phase2Damage : NPC.defDamage; - NPC.velocity = Vector2.Normalize(rotationVector) * chargeVelocity; calamityGlobalNPC.newAI[1] = 1f; } else { - NPC.damage = phase3 ? phase3Damage : phase2 ? phase2Damage : NPC.defDamage; - calamityGlobalNPC.newAI[2] += 1f; // Slow down for a few frames @@ -553,8 +550,6 @@ namespace CalamityMod.NPCs.Polterghast float slowDownTime = chargeVelocity; if (calamityGlobalNPC.newAI[2] >= totalChargeTime - slowDownTime) { - NPC.damage = phase3 ? phase3ReducedSetDamage : phase2 ? phase2ReducedSetDamage : phase1ReducedSetDamage; - NPC.velocity *= 0.9f; } @@ -582,8 +577,6 @@ namespace CalamityMod.NPCs.Polterghast } else { - NPC.damage = phase3 ? phase3ReducedSetDamage : phase2 ? phase2ReducedSetDamage : phase1ReducedSetDamage; - // Pick a charging location // Set charge locations X if (vector.X >= player.Center.X) @@ -663,9 +656,7 @@ namespace CalamityMod.NPCs.Polterghast // Phase 1: "Polterghast" if (!phase2 && !phase3) { - if (!isInChargePhase) - NPC.damage = phase1ReducedSetDamage; - + NPC.damage = NPC.defDamage; NPC.defense = NPC.defDefense; if (Main.netMode != NetmodeID.MultiplayerClient && !isInChargePhase) @@ -688,13 +679,14 @@ namespace CalamityMod.NPCs.Polterghast if (notLiningUpCharge) { int type = ModContent.ProjectileType(); + int damage = BlueShotDamage; if (Main.rand.NextBool(3)) { NPC.localAI[1] = -30f; type = ModContent.ProjectileType(); + damage = BlueBlastDamage; } - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * baseProjectileVelocity; Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 6; i++) @@ -707,14 +699,13 @@ namespace CalamityMod.NPCs.Polterghast else { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (baseProjectileVelocity + 5f); Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 6; i++) { float offset = MathHelper.ToRadians(MathHelper.Lerp(-40f, 40f, i / 5f)); - Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, damage, 0f, Main.myPlayer); + Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, BlueBlastDamage, 0f, Main.myPlayer); shot.timeLeft = 450; } } @@ -768,9 +759,7 @@ namespace CalamityMod.NPCs.Polterghast } } - if (!isInChargePhase) - NPC.damage = phase2ReducedSetDamage; - + NPC.damage = (int)Math.Round(NPC.defDamage * Phase2ContactDamageMult); NPC.defense = (int)Math.Round(NPC.defDefense * 0.8); if (Main.netMode != NetmodeID.MultiplayerClient && !isInChargePhase) @@ -793,13 +782,14 @@ namespace CalamityMod.NPCs.Polterghast if (notLiningUpCharge) { int type = ModContent.ProjectileType(); + int damage = RedShotDamage; if (Main.rand.NextBool(3)) { NPC.localAI[1] = -30f; type = ModContent.ProjectileType(); + damage = RedBlastDamage; } - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (baseProjectileVelocity + 1f); Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 7; i++) @@ -812,13 +802,12 @@ namespace CalamityMod.NPCs.Polterghast else { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (baseProjectileVelocity + 5f); Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 7; i++) { float offset = MathHelper.ToRadians(MathHelper.Lerp(-50f, 50f, i / 6f)); - Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, damage, 0f, Main.myPlayer); + Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, RedBlastDamage, 0f, Main.myPlayer); shot.timeLeft = 450; } } @@ -889,9 +878,7 @@ namespace CalamityMod.NPCs.Polterghast } } - if (!isInChargePhase) - NPC.damage = phase3ReducedSetDamage; - + NPC.damage = (int)Math.Round(NPC.defDamage * Phase3ContactDamageMult); NPC.defense = (int)Math.Round(NPC.defDefense * 0.5); NPC.localAI[1] += 1f; @@ -902,8 +889,9 @@ namespace CalamityMod.NPCs.Polterghast { int numProj = (getPissed ? 10 : 8); float maxSpread = getPissed ? 125 : 110; - int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + bool red = Main.rand.NextBool(); + int type = red ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = red ? RedShotDamage : BlueShotDamage; Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * baseProjectileVelocity; Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < numProj; i++) @@ -1115,7 +1103,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; @@ -1221,7 +1209,6 @@ namespace CalamityMod.NPCs.Polterghast public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 2afb116640..ad8a02d2e5 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -32,11 +32,13 @@ namespace CalamityMod.NPCs.Polterghast } } + public static int ShotDamage = 60; // 240 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.aiStyle = -1; AIType = -1; - NPC.damage = 0; NPC.width = 40; NPC.height = 40; NPC.lifeMax = 50000; @@ -94,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; @@ -150,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; @@ -166,11 +168,10 @@ namespace CalamityMod.NPCs.Polterghast { float shotSpeed = 10f * tileEnrageMult; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); targetDistance = shotSpeed / targetDistance; targetX *= targetDistance; targetY *= targetDistance; - Projectile.NewProjectile(NPC.GetSource_FromAI(), hookPosition.X, hookPosition.Y, targetX, targetY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), hookPosition.X, hookPosition.Y, targetX, targetY, type, ShotDamage, 0f, Main.myPlayer, 0f, 0f); } } return; @@ -183,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; @@ -325,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/PrimordialWyrmBody.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs index abbf84aaa3..3da6b9ad65 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void SetDefaults() { - NPC.damage = 100; + NPC.damage = 0; // No contact damage NPC.width = 100; NPC.height = 88; NPC.defense = 0; @@ -65,8 +65,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void AI() { - NPC.damage = 0; - // Difficulty modes bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs index c89ee5b210..5a8d2566a7 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs @@ -27,9 +27,11 @@ namespace CalamityMod.NPCs.PrimordialWyrm } } + public static int FireballDamage = 110; // 440 + public override void SetDefaults() { - NPC.damage = 100; + NPC.damage = 0; NPC.width = 110; NPC.height = 88; NPC.defense = 0; @@ -63,8 +65,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void AI() { - NPC.damage = 0; - // Difficulty modes bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; @@ -134,8 +134,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm Vector2 destination = Main.player[Main.npc[(int)NPC.ai[2]].target].Center - NPC.Center; Vector2 velocity = Vector2.Normalize(destination) * fireballVelocity; int type = ProjectileID.CultistBossFireBallClone; - int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, FireballDamage, 0f, Main.myPlayer); Main.projectile[proj].tileCollide = false; } } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 0ce1497e82..8786ae0910 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -108,11 +108,18 @@ namespace CalamityMod.NPCs.PrimordialWyrm } } + public static int IceMistDamage = 110; // 440 + public static int LightningDamage = 140; // 560 + + // Reused Cultist projectiles + public static float LightDamageMult = 2.445f; // 440 + public static float DoomDamageMult = 2.445f; // 440 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 300; // 600 NPC.npcSlots = 50f; - NPC.GetNPCDamage(); NPC.width = 230; NPC.height = 138; NPC.LifeMaxNERB(2500000, 3000000); @@ -120,7 +127,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(5, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 5); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -329,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; @@ -447,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; @@ -646,22 +653,21 @@ namespace CalamityMod.NPCs.PrimordialWyrm float ai = Main.rand.Next(100); Vector2 projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; int type = ProjectileID.CultistBossLightningOrbArc; - int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; // Opposite bolt projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; ai = Main.rand.Next(100); projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; - proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; // Normal bolt projectileDestination = targetCenterArray[i] - NPC.Center; ai = Main.rand.Next(100); projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; - proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; } } @@ -940,18 +946,17 @@ namespace CalamityMod.NPCs.PrimordialWyrm Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; int type = ProjectileID.CultistBossIceMist; - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, IceMistDamage, 0f, Main.myPlayer, 0f, 1f); // Opposite mist projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, IceMistDamage, 0f, Main.myPlayer, 0f, 1f); // Normal bolt projectileDestination = targetCenterArray[i] - NPC.Center; projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, IceMistDamage, 0f, Main.myPlayer, 0f, 1f); } } @@ -1147,13 +1152,12 @@ namespace CalamityMod.NPCs.PrimordialWyrm if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.CultistBossLightningOrbArc; - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < numLightningBolts; i++) { Vector2 projectileDestination = player.Center - lightningSpawnLocation; Vector2 projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * baseVelocity * 0.5f; float ai = Main.rand.Next(100); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), lightningSpawnLocation, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), lightningSpawnLocation, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; lightningSpawnLocation.Y += distanceBetweenBolts; if (i == numLightningBolts / 2) @@ -1524,7 +1528,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void ModifyTypeName(ref string typeName) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs index cb7c3ff52e..1796a73b70 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void SetDefaults() { - NPC.damage = 100; + NPC.damage = 0; NPC.width = 100; NPC.height = 120; NPC.defense = 0; @@ -52,8 +52,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void AI() { - NPC.damage = 0; - // Difficulty modes bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 811c32bb2b..781b769989 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -65,12 +65,17 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } + public static int FireDamage = 42; // 168; HolyFire, HolyFire2 + public static int SpearDamage = 55; // 220; HolySpear, ProfanedSpear + public static int HolyBlastDamage = 64; // 256 + public static int RayDamage = 80; // 320 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 110; // 220 NPC.npcSlots = 20f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 228; NPC.height = 186; NPC.defense = 40; @@ -82,7 +87,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians AIType = -1; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; @@ -364,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; @@ -374,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; @@ -453,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; @@ -520,7 +523,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float projectileVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; Vector2 finalProjectileVelocity = Vector2.Normalize(player.Center - shootFrom) * projectileVelocity; int type = shootSpear ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = shootSpear ? SpearDamage : FireDamage; if (type == ModContent.ProjectileType()) finalProjectileVelocity *= 0.5f; @@ -555,13 +558,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 finalHolyBlastVelocity = Vector2.Normalize(player.Center - shootFrom) * holyBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, finalHolyBlastVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); - Main.projectile[proj].timeLeft = projTimeLeft; - } + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, finalHolyBlastVelocity, ModContent.ProjectileType(), HolyBlastDamage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); + Main.projectile[proj].timeLeft = projTimeLeft; } // Dust for blasting out the holy blasts @@ -728,10 +726,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int k = 0; k < totalDustPerProjectile; k++) Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, projectileVelocity.X, projectileVelocity.Y, 0, default, 1f); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, ModContent.ProjectileType(), FireDamage, 0f, Main.myPlayer); } } } @@ -788,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; @@ -845,15 +841,13 @@ 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; Vector2 velocity2 = Vector2.Normalize(player.Center - shootFrom) * spearVelocity; Vector2 knockbackVelocity = velocity2 * 0.1f; - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, shootFrom); for (int k = 0; k < totalDustPerProjectile; k++) @@ -873,12 +867,12 @@ namespace CalamityMod.NPCs.ProfanedGuardians Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, perturbedSpeed.X, perturbedSpeed.Y, 0, default, 1f); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, perturbedSpeed, type, damage, 0f, Main.myPlayer, targetRanAwayAndWillNowBeFucked ? -2f : -1f, -30f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, perturbedSpeed, ModContent.ProjectileType(), SpearDamage, 0f, Main.myPlayer, targetRanAwayAndWillNowBeFucked ? -2f : -1f, -30f); } } if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2 * 0.85f, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2 * 0.85f, ModContent.ProjectileType(), SpearDamage, 0f, Main.myPlayer, 1f, 0f); if (!targetRanAwayAndWillNowBeFucked) NPC.velocity = -knockbackVelocity; @@ -902,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; @@ -920,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) @@ -969,23 +963,20 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (laserVelocity.X < 0f) beamDirection = 1f; - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - // 60 degrees offset laserVelocity = laserVelocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, type, damage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); // -60 degrees offset if (revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, type, damage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + 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); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); } NPC.netUpdate = true; @@ -1208,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)); @@ -1269,13 +1260,12 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 180); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 0411425f6d..f5a2ad3aaf 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -54,13 +54,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } + public static int FireDamage = 42; // 168; HolyFlare + public static int BlobDamage = 42; // 168 + public static int FireSentryDamage = 55; // 220; HolyBomb + public static int MoltenBlastDamage = 55; // 220 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 110; // 220 NPC.npcSlots = 3f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 228; NPC.height = 164; NPC.defense = 50; @@ -257,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 @@ -377,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; @@ -439,9 +444,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians projectileVelocityY += expertMode ? 4f : 3f; Vector2 projectileVelocity = new Vector2(NPC.velocity.X * 0.25f, projectileVelocityY); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, ModContent.ProjectileType(), FireSentryDamage, 0f, Main.myPlayer); } } } @@ -452,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; @@ -484,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; } @@ -501,13 +504,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 velocity = Vector2.Normalize(player.Center - shootFrom) * moltenBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); - Main.projectile[proj].timeLeft = projTimeLeft; - } + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity, ModContent.ProjectileType(), MoltenBlastDamage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); + Main.projectile[proj].timeLeft = projTimeLeft; } // Dust for blasting out the molten blasts @@ -550,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; @@ -667,9 +665,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians projectileVelocityY += expertMode ? 4f : 3f; Vector2 projectileVelocity = new Vector2(NPC.velocity.X * 0.25f, projectileVelocityY); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, ModContent.ProjectileType(), FireSentryDamage, 0f, Main.myPlayer); } } } @@ -942,7 +938,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index c20b287e69..3072c2dd99 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -67,13 +67,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } + public static int CrystalDamage = 55; // 220 + public static int StarDamage = 55; // 220; HolyBurnOrb + + public static int StarHeal = Main.expertMode ? 50 : 35; // HolyLight + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 100; // 200 NPC.npcSlots = 3f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 228; NPC.height = 164; NPC.defense = 30; @@ -188,7 +193,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[2] >= 45f) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int totalProjectiles = 10; float radians = MathHelper.TwoPi / totalProjectiles; float projectileVelocity = 8f; @@ -196,7 +200,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2, type, 0, 0f, Main.myPlayer, 0f, damage); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2, type, 0, 0f, Main.myPlayer, 0f, StarHeal); } NPC.ai[2] = 0f; } @@ -212,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; @@ -246,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; @@ -298,7 +302,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int totalProjectiles = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; float speedX = -12f; float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); @@ -315,7 +318,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians randomizedVelocity = revenge ? (new Vector2(randomFloatX, randomFloatY) * randomVelocityMult) : Vector2.Zero; } Vector2 projectileVelocity = new Vector2(speedX + speedAdjustment * i + distanceFromDestination.SafeNormalize(Vector2.Zero).X * Math.Abs(player.velocity.X), speedY) + randomizedVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer, x4); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, CrystalDamage, 0f, Main.myPlayer, x4); } } } @@ -355,16 +358,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 vector2 = spinningPoint.RotatedBy(radians * j); int type = ModContent.ProjectileType(); - int dmgAmt = NPC.GetProjectileDamage(type); if (Main.rand.NextBool(healingStarChance) && !death) { type = ModContent.ProjectileType(); - dmgAmt = NPC.GetProjectileDamageNoScaling(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, 0, 0f, Main.myPlayer, 0f, StarHeal); } else if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, StarDamage, 0f, Main.myPlayer); Color dustColor = Main.hslToRgb(Main.rgbToHsl(type == ModContent.ProjectileType() ? Color.Orange : Color.Green).X, 1f, 0.5f); dustColor.A = 255; @@ -402,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 46241f8f75..d9988fbf75 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -43,9 +43,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 100; // 200 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.dontTakeDamage = true; NPC.width = 50; NPC.height = 50; @@ -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 6c241b743e..ba9045341d 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -237,10 +237,22 @@ namespace CalamityMod.NPCs.Providence base.ModifyHoverBoundingBox(ref boundingBox); } + public static int FireDamage = 42; // 168; HolyFire, HolyFire2, HolyFlare + public static int BlobDamage = 42; // 168 + public static int FireSentryDamage = 55; // 220; HolyBomb + public static int MoltenBlastDamage = 55; // 220 + public static int StarDamage = 55; // 220; HolyBurnOrb + public static int SpearDamage = 55; // 220 + public static int CrystalDamage = 55; // 220 + public static int HolyBlastDamage = 64; // 256 + public static int RayDamage = 100; // 400 + + public static int StarHeal = Main.expertMode ? 50 : 35; // HolyLight + public override void SetDefaults() { NPC.npcSlots = 36f; - NPC.damage = 100; + NPC.damage = 0; // No contact damage NPC.width = 600; NPC.height = 450; NPC.defense = 50; @@ -249,7 +261,7 @@ namespace CalamityMod.NPCs.Providence NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(1, 50, 0, 0); + NPC.value = Item.buyPrice(platinum: 1, gold: 50); NPC.boss = true; NPC.Opacity = 0f; NPC.noGravity = true; @@ -261,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; } @@ -409,25 +421,8 @@ namespace CalamityMod.NPCs.Providence NPC.ForceNetUpdate(false); } - // Increase all projectile damage while enraged, but reduce to 0 for Zenith - int projectileDamageMult = 1; - if (getFuckedAI) - projectileDamageMult = 0; - else if (fullPowerAI) - projectileDamageMult = 2; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && fullPowerAI; - // Projectile damage values - int holyLaserDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int crystalDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holySpearDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyBombDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int moltenBlastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyFireDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyBlastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyStarDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - // Change dust type while enraged int dustType = ProvUtils.GetDustID(); @@ -645,20 +640,6 @@ namespace CalamityMod.NPCs.Providence return; } - // Damage - if (attackerAlive) - { - double damageMult = 1.25; - holyLaserDamage = (int)(holyLaserDamage * damageMult); - crystalDamage = (int)(crystalDamage * damageMult); - holySpearDamage = (int)(holySpearDamage * damageMult); - holyBombDamage = (int)(holyBombDamage * damageMult); - moltenBlastDamage = (int)(moltenBlastDamage * damageMult); - holyFireDamage = (int)(holyFireDamage * damageMult); - holyBlastDamage = (int)(holyBlastDamage * damageMult); - holyStarDamage = (int)(holyStarDamage * damageMult); - } - // Defense if (defenderAlive) NPC.defense = NPC.defDefense * 2; @@ -873,7 +854,7 @@ namespace CalamityMod.NPCs.Providence velocity = 30f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.2f; acceleration *= 1.2f; @@ -889,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) @@ -1165,7 +1146,7 @@ namespace CalamityMod.NPCs.Providence Vector2 predictionAmount = player.velocity * 100f; Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), HolyBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); } } else if (NPC.ai[3] < 0f) @@ -1213,7 +1194,7 @@ namespace CalamityMod.NPCs.Providence if (fullPowerAI) projectileVelocityY *= 2f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), FireDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1263,17 +1244,13 @@ namespace CalamityMod.NPCs.Providence { Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(NPC.ai[2])); - int projectileType = ModContent.ProjectileType(); - int dmgAmt = holyStarDamage; if (Main.rand.NextBool(healingStarChance) && !death) { - projectileType = ModContent.ProjectileType(); - dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, StarHeal); } else if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), StarDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } // Radial offset @@ -1300,17 +1277,13 @@ namespace CalamityMod.NPCs.Providence { Vector2 vector2 = spinningPoint.RotatedBy(radians * i); - int projectileType = ModContent.ProjectileType(); - int dmgAmt = holyStarDamage; if (Main.rand.NextBool(healingStarChance) && !death) { - projectileType = ModContent.ProjectileType(); - dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, StarHeal); } else if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), StarDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } } @@ -1330,9 +1303,8 @@ namespace CalamityMod.NPCs.Providence foreach (int t in targets) { Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - fireSparklesFrom) * cocoonProjVelocity * 1.5f; - int type = ModContent.ProjectileType(); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, velocity2, type, holyStarDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, velocity2, ModContent.ProjectileType(), StarDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); Color dustColor = Main.hslToRgb(Main.rgbToHsl(fullPowerAI ? new Color(100, 200, 250) : Color.Orange).X, 1f, 0.5f); dustColor.A = 255; @@ -1446,7 +1418,7 @@ namespace CalamityMod.NPCs.Providence Vector2 predictionAmount = player.velocity * 100f; Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), MoltenBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); } } else if (NPC.ai[3] < 0f) @@ -1491,7 +1463,7 @@ namespace CalamityMod.NPCs.Providence projectileVelocityY += expertMode ? 4f : 3f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), holyBombDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), FireSentryDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1550,10 +1522,10 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); - if (CalamityWorld.LegendaryMode) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, holySpearDamage, 0f, Main.myPlayer); + if (Main.getGoodWorld) + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1577,10 +1549,10 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); - if (CalamityWorld.LegendaryMode) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); + if (Main.getGoodWorld) + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } @@ -1669,7 +1641,7 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), crystalDamage, 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); + Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), CrystalDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); } } @@ -1731,20 +1703,20 @@ namespace CalamityMod.NPCs.Providence // 60 degrees offset velocity = velocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); // -60 degrees offset if (revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); if (fullPowerAI && lifeRatio < 0.5f) { rotation *= 0.33f; velocity = velocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); if (revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); } NPC.ForceNetUpdate(false); @@ -1940,8 +1912,6 @@ namespace CalamityMod.NPCs.Providence } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool CheckDead() { NPC.life = 1; @@ -2528,7 +2498,6 @@ namespace CalamityMod.NPCs.Providence public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitByProjectile(Projectile projectile, NPC.HitInfo hit, int damageDone) @@ -2752,6 +2721,28 @@ namespace CalamityMod.NPCs.Providence { public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld; + public static int CalculateProvidenceDamage(this int damage) + { + // GFB replaces conventional damage with negative healing + if (Main.zenithWorld) + return 0; + + // Enrage + if (CalamityGlobalNPC.holyBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) + damage *= 2; + } + + // Offense Guardian + if (CalamityGlobalNPC.holyBossAttacker != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) + damage = (int)(damage * 1.25f); + } + return damage; + } + // Simplified to day/night only. For PSC public static Color GetColorBasedOnEnrage(int Alpha, bool Outline = false) => GetColorBasedOnEnrage(!Main.IsItDay() && !Main.remixWorld, Alpha, Outline); public static Color GetColorBasedOnEnrage(bool Night, int Alpha, bool Outline = false) diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index bf7a2fda1d..69962e5cf5 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -27,9 +27,12 @@ namespace CalamityMod.NPCs.Ravager } } + public static int FlameDamage = 30; // 120 + public static int PostProviFlameBuff = 20; // +80 = 200 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 75; // 150 NPC.width = 40; NPC.height = 150; NPC.defense = 35; @@ -118,8 +121,7 @@ namespace CalamityMod.NPCs.Ravager } Vector2 velocity = new Vector2(speedX, speedY); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, FlameDamage + (provy ? PostProviFlameBuff : 0), 0f, Main.myPlayer, 0f, 0f); } NPC.ai[2] += 1f; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 200da5f0c8..1807ed445f 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -69,18 +69,24 @@ namespace CalamityMod.NPCs.Ravager } } + // GFB exclusive + public static int BlasterDamage = 92; // 368 + + // Legendary exclusive + public static int RockDamage = 60; // 240 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 90; // 180 NPC.lavaImmune = true; NPC.noGravity = true; NPC.npcSlots = 20f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 332; NPC.height = 214; NPC.defense = 55; - NPC.value = Item.buyPrice(0, 30, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.DR_NERD(0.35f); NPC.LifeMaxNERB(45000, 54000, 460000); if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) @@ -88,7 +94,7 @@ namespace CalamityMod.NPCs.Ravager NPC.damage = (int)(NPC.damage * 1.5); NPC.defense *= 2; NPC.lifeMax *= 4; - NPC.value *= 3f; + NPC.value *= 4f; } NPC.knockBackResist = 0f; AIType = -1; @@ -241,7 +247,7 @@ namespace CalamityMod.NPCs.Ravager Vector2 Pos = player.Center; //Spawn projectiles based on player's center. Having it be based on the boss turned out weird. (Except for final) int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = BlasterDamage; if (finalStand) //Circle { Vector2 circleOffset = Pos + (Vector2.UnitY * 640f).RotatedBy(MathHelper.ToRadians(NPC.localAI[1] * 3f)); @@ -485,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; @@ -582,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, 60, 0f, Main.myPlayer); - } - } - } - if (expertMode) { foreach (NPC n in Main.ActiveNPCs) @@ -624,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()); @@ -892,7 +874,6 @@ namespace CalamityMod.NPCs.Ravager public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 745eb70286..3b6dcc5f2d 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -25,9 +25,9 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 75; // 150 NPC.lavaImmune = true; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 80; NPC.height = 40; NPC.defense = 40; diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 97304365b3..21ec899f26 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -25,9 +25,9 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 75; // 150 NPC.lavaImmune = true; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 80; NPC.height = 40; NPC.defense = 40; diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index c5dbdbb6cc..b4cac0f67b 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -21,10 +21,13 @@ namespace CalamityMod.NPCs.Ravager NPCID.Sets.NeedsExpertScaling[Type] = true; } + public static int NukeDamage = 35; // 140 + public static int PostProviNukeBuff = 25; // +100 = 240 + public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 80; NPC.height = 80; NPC.defense = 40; @@ -91,12 +94,11 @@ namespace CalamityMod.NPCs.Ravager NPC.ai[1] = 0f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 shootFromVector = new Vector2(NPC.Center.X, NPC.Center.Y - 20f); Vector2 velocity = new Vector2(0f, -15f); - int nuke = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFromVector, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, NPC.target, 0f); + int nuke = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFromVector, velocity, type, NukeDamage + (provy ? PostProviNukeBuff : 0), 0f, Main.myPlayer, NPC.target, 0f); Main.projectile[nuke].velocity.Y = -15f; } } diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 773a444c11..b7c57c63bf 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -20,10 +20,13 @@ namespace CalamityMod.NPCs.Ravager NPCID.Sets.NeedsExpertScaling[Type] = true; } + public static int HomingDartDamage = 30; // 120 + public static int PostProviDartBuff = 20; // +80 == 200 + public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 80; NPC.height = 80; NPC.defense = 40; @@ -106,7 +109,6 @@ namespace CalamityMod.NPCs.Ravager if (fireProjectiles && Vector2.Distance(NPC.Center, player.Center) > 80f) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float projectileVelocity = death ? 8f : 6f; if (NPC.ai[1] >= 600f) @@ -118,8 +120,7 @@ namespace CalamityMod.NPCs.Ravager { SoundEngine.PlaySound(RavagerHead.MissileSound, NPC.Center); type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity * 0.25f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.scavenger].target, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity * 0.25f, type, RavagerHead.NukeDamage + (provy ? RavagerHead.PostProviNukeBuff : 0), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.scavenger].target, 0f); } } else @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.netMode != NetmodeID.MultiplayerClient) { SoundEngine.PlaySound(SoundID.Item33, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, HomingDartDamage + (provy ? PostProviDartBuff : 0), 0f, Main.myPlayer, 0f, -1f); } } } diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 604f17c88c..95d7ec3d32 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; + NPC.damage = 0; // No contact damage NPC.width = 60; NPC.height = 60; NPC.defense = 40; diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index bb22821249..bcb5cf0a7f 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; + NPC.damage = 0; // No contact damage NPC.width = 60; NPC.height = 60; NPC.defense = 40; diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 3795816de8..bf01bf7c0d 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.width = 60; NPC.height = 300; NPC.defense = 50; diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index a3869b462e..6f96dd535a 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -30,9 +30,9 @@ namespace CalamityMod.NPCs.Signus public override void SetDefaults() { + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 25; NPC.height = 25; NPC.defense = 50; diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index b09675a920..8a2a83f901 100644 --- a/NPCs/Signus/CosmicMine.cs +++ b/NPCs/Signus/CosmicMine.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Signus public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 140; // 280 NPC.width = 30; NPC.height = 30; NPC.lifeMax = 4800; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 84b2a7dcd4..fc7f8d7c36 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -69,16 +69,22 @@ namespace CalamityMod.NPCs.Signus } } + public static int ScytheDamage = 60; // 240 + public static int DustDamage = 60; // 240; Also applies to Legendary Mode Peanuts + + // GFB exclusive + public static int StealthStrikeMult = 2; // 480 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 160; // 320 NPC.npcSlots = 32f; - NPC.GetNPCDamage(); NPC.width = 130; NPC.height = 130; NPC.defense = 60; NPC.LifeMaxNERB(320000, 375000, 380000); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; @@ -134,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; @@ -193,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++) { @@ -233,9 +239,6 @@ namespace CalamityMod.NPCs.Signus if (NPC.ai[0] <= 2f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.rotation = NPC.velocity.X * 0.04f; float playerLocation = vectorCenter.X - player.Center.X; NPC.direction = playerLocation < 0f ? 1 : -1; @@ -259,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); @@ -284,9 +287,6 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 0f) { - // Set damage - NPC.damage = NPC.defDamage; - if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[1] += 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; @@ -341,7 +341,7 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 1f) { - // Avoid cheap bullshit + // Disable contact damage for some time while fading away NPC.damage = 0; Vector2 position = new Vector2(NPC.ai[1] * 16f - (NPC.width / 2), NPC.ai[2] * 16f - (NPC.height / 2)); @@ -377,12 +377,11 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 2f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.alpha -= 50; if (NPC.alpha <= lifeToAlpha) { + // Restore contact damage once returned to proper opacity + NPC.damage = NPC.defDamage; if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { SoundEngine.PlaySound(SoundID.Item122, NPC.Center); @@ -461,9 +460,6 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 3f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.rotation = NPC.velocity.X * 0.04f; float playerLocation = vectorCenter.X - player.Center.X; NPC.direction = playerLocation < 0f ? 1 : -1; @@ -492,16 +488,14 @@ namespace CalamityMod.NPCs.Signus scytheXDist *= scytheDistance; scytheYDist *= scytheDistance; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist, scytheYDist, type, damage, 0f, Main.myPlayer, 0f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist, scytheYDist, type, ScytheDamage, 0f, Main.myPlayer, 0f, NPC.target + 1); if (stealthTimer >= maxStealth) { - damage *= 2; SoundEngine.PlaySound(RaidersTalisman.StealthHitSound, NPC.Center); for (int i = 0; i < 4; i++) { Vector2 offset = new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)); - Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist + offset.X, scytheYDist + offset.Y, type, damage, 0f, Main.myPlayer, 0f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist + offset.X, scytheYDist + offset.Y, type, ScytheDamage * StealthStrikeMult, 0f, Main.myPlayer, 0f, NPC.target + 1); } stealthTimer = 0; } @@ -569,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; @@ -628,9 +622,6 @@ namespace CalamityMod.NPCs.Signus if (calamityGlobalNPC.newAI[0] == 0f) // Line up the charge { - // Avoid cheap bullshit - NPC.damage = 0; - float velocity = revenge ? 16f : expertMode ? 15f : 14f; if (expertMode) velocity += death ? 6f * (float)(1D - lifeRatio) : 4f * (float)(1D - lifeRatio); @@ -666,17 +657,11 @@ namespace CalamityMod.NPCs.Signus } else if (calamityGlobalNPC.newAI[0] == 1f) // Pause before charge { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.velocity *= 0.8f; NPC.ai[1] += 1f; if (NPC.ai[1] >= 5f) { - // Set damage - NPC.damage = NPC.defDamage; - calamityGlobalNPC.newAI[0] = 2f; NPC.netUpdate = true; @@ -693,9 +678,6 @@ namespace CalamityMod.NPCs.Signus } else if (calamityGlobalNPC.newAI[0] == 2f) // Charging { - // Set damage - NPC.damage = NPC.defDamage; - if (Main.netMode != NetmodeID.MultiplayerClient) { bool buffed = false; @@ -708,15 +690,10 @@ 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(); - int damage = (CalamityWorld.LegendaryMode) ? 60 : NPC.GetProjectileDamage(type); - 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, damage, 0f, Main.myPlayer, ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, velocity, type, DustDamage, 0f, Main.myPlayer, ai); } } @@ -746,9 +723,6 @@ namespace CalamityMod.NPCs.Signus } else if (calamityGlobalNPC.newAI[0] == 3f) // Slow down after charging and reset { - // Avoid cheap bullshit - NPC.damage = 0; - if (stealthTimer >= maxStealth) { stealthTimer = 0; @@ -980,7 +954,6 @@ namespace CalamityMod.NPCs.Signus public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index 1b3065c5fe..fd9842e659 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -20,17 +20,18 @@ namespace CalamityMod.NPCs.SlimeGod NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; } + // GFB exclusive + public static int ShaderainDamage = 12; // 48 + public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Bat; - NPC.GetNPCDamage(); + 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; @@ -80,8 +81,7 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.zenithWorld && Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, ShaderainDamage, 0f, Main.myPlayer); } } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index 2dfa89ad9c..2a4539f271 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -23,14 +23,12 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Slime; - NPC.GetNPCDamage(); + 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; @@ -81,14 +79,13 @@ namespace CalamityMod.NPCs.SlimeGod double deltaAngleBoom = spreadBoom / 8f; double offsetAngleBoom; int iBoom; - int damageBoom = 30; for (iBoom = 0; iBoom < 5; iBoom++) { int projectileType = ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; float velocityfactor = 0.3f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * velocityfactor), (float)(Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * velocityfactor), (float)(-Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * velocityfactor), (float)(Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * velocityfactor), (float)(-Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index 652074b50e..acbf43a7cf 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -22,14 +22,12 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Slime; - NPC.GetNPCDamage(); + 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 3223c1ea4a..49d8410197 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -26,17 +26,17 @@ namespace CalamityMod.NPCs.SlimeGod NPCID.Sets.BossBestiaryPriority.Add(Type); } + public static int SmallSpikeDamage = 11; // 44 + public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Slime; - NPC.GetNPCDamage(); + 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; @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.SlimeGod spikeTimer -= 1f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = SmallSpikeDamage; if (Main.zenithWorld) type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index edeb7532dd..852cfe7269 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -28,17 +28,18 @@ namespace CalamityMod.NPCs.SlimeGod this.HideFromBestiary(); } + public static int BigSpikeDamage = 15; // 60 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 42; // 84 NPC.width = Width; NPC.height = Height; NPC.defense = 12; NPC.LifeMaxNERB(7500, 9000, 160000); NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.knockBackResist = 0f; - NPC.value = 0f; NPC.Opacity = 1f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -93,7 +94,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 24; - setDamage += 25; + setDamage += SlimeGodCore.PossessionDamageBoost; } // Used for landing squash and stretch @@ -108,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; @@ -151,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++) @@ -184,7 +185,6 @@ namespace CalamityMod.NPCs.SlimeGod // Spread of spikes float projectileVelocity = 2f; int type2 = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type2); Vector2 spawnLocation = new Vector2(NPC.Center.X, NPC.Center.Y + 50f * NPC.scale); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; @@ -219,7 +219,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, damage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, BigSpikeDamage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); } // Die @@ -562,7 +562,6 @@ namespace CalamityMod.NPCs.SlimeGod // Spread of spikes float projectileVelocity = 2f; int type2 = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type2); Vector2 spawnLocation = new Vector2(NPC.Center.X, NPC.Center.Y + 50f * NPC.scale); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; @@ -597,7 +596,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, damage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, BigSpikeDamage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); } } diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index 334b34c5be..b28982e265 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 80 NPC.width = Width; NPC.height = Height; NPC.defense = 10; @@ -49,7 +49,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = 0f; NPC.Opacity = 1f; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; @@ -94,10 +93,10 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 20; - setDamage += 22; + setDamage += SlimeGodCore.PossessionDamageBoost; } - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; NPC.aiAction = 0; // Get a target @@ -127,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++) @@ -309,10 +308,9 @@ 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(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y + 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; float rotation = MathHelper.ToRadians(80); @@ -323,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))); @@ -343,7 +341,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } // Fire slime balls directly at players with a max of 2 @@ -377,7 +375,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } @@ -433,7 +431,6 @@ namespace CalamityMod.NPCs.SlimeGod { float projectileVelocity = 3f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y + 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int dustType = DustID.TintableDust; @@ -457,7 +454,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, destination, type, damage, 0f, Main.myPlayer, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, destination, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 1f); } SoundEngine.PlaySound(SlimeGodCore.ShotSound, NPC.Center); @@ -489,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 2d29bf7301..e305a07cb0 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -81,14 +81,17 @@ namespace CalamityMod.NPCs.SlimeGod } } + public static int GlobDamage = 15; // 60 + public static int PossessionDamageBoost = 10; // +20 flat contact damage + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 80 NPC.npcSlots = 10f; NPC.width = 96; NPC.height = 98; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale = 2f; NPC.defense = 6; @@ -98,7 +101,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 12, 0, 0); + NPC.value = Item.buyPrice(gold: 8); NPC.Opacity = 0.8f; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); @@ -500,17 +503,15 @@ namespace CalamityMod.NPCs.SlimeGod { float projectileVelocity = 4f + (aggressionLevel - 1) * 2f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 velocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, GlobDamage, 0f, Main.myPlayer); } else { float projectileVelocity = 8f + (aggressionLevel - 1) * 2f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 velocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, GlobDamage, 0f, Main.myPlayer); } } } @@ -528,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; @@ -570,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 42c34c95c1..54c404647b 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -40,14 +40,13 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 36; // 72 NPC.LifeMaxNERB(1875, 2250, 80000); NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.GetNPCDamage(); NPC.width = Width; NPC.height = Height; NPC.defense = 10; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 1, 0, 0); NPC.Opacity = 1f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -108,7 +107,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 20; - setDamage += 22; + setDamage += SlimeGodCore.PossessionDamageBoost; } // Used for landing squash and stretch @@ -123,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; @@ -474,7 +473,6 @@ namespace CalamityMod.NPCs.SlimeGod // Eruption of slime balls that fall down float projectileVelocity = 8f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int numProj = 3; @@ -503,7 +501,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed * 1.5f, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed * 1.5f, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 1f, 0f); } // Fire slime balls directly at players with a max of 2 @@ -537,7 +535,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 5ec2ecb787..94812533c6 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -40,16 +40,15 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 36; // 72 NPC.LifeMaxNERB(2000, 2400, 110000); NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.GetNPCDamage(); NPC.width = Width; NPC.height = Height; NPC.defense = 8; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 1, 0, 0); NPC.Opacity = 1f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -105,7 +104,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 16; - setDamage += 20; + setDamage += SlimeGodCore.PossessionDamageBoost; } // Used for landing squash and stretch @@ -119,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; @@ -405,7 +404,6 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int numProj = death ? 5 : 3; int spread = death ? 12 : 8; float rotation = MathHelper.ToRadians(spread); @@ -413,7 +411,7 @@ namespace CalamityMod.NPCs.SlimeGod { Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(3f, 3f); Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))) + randomVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 45f * NPC.scale, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 45f * NPC.scale, perturbedSpeed, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } @@ -499,7 +497,6 @@ namespace CalamityMod.NPCs.SlimeGod // Eruption of slime balls float projectileVelocity = 4f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int numProj = 9; @@ -531,7 +528,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } @@ -566,7 +563,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index f206fc6aa3..098572787f 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -32,9 +32,11 @@ namespace CalamityMod.NPCs.StormWeaver } } + public static int LaserDamage = 55; // 220 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 40; @@ -67,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; @@ -110,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) @@ -150,8 +152,7 @@ namespace CalamityMod.NPCs.StormWeaver float projectileVelocity = death ? 6.25f : revenge ? 5.75f : expertMode ? 5.5f : 5f; Vector2 velocityVector = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocityVector, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocityVector, type, LaserDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 900; } } @@ -230,21 +231,6 @@ namespace CalamityMod.NPCs.StormWeaver else if (targetX > 0f) NPC.spriteDirection = 1; } - - // Calculate contact damage based on velocity - float velocity = (phase2 ? 12f : 10f) + (revenge ? 1.5f : expertMode ? 1f : 0f); - float minimalContactDamageVelocity = velocity * 0.25f; - float minimalDamageVelocity = velocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -262,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 @@ -361,7 +347,6 @@ namespace CalamityMod.NPCs.StormWeaver public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 048364eb1a..67b623d8ae 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -83,16 +83,20 @@ namespace CalamityMod.NPCs.StormWeaver } } + public static int LightningDamage = 64; // 256 + public static int FrostWaveDamage = 64; // 256 + public static int TornadoDamage = 66; // 264 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 180; // 360 NPC.npcSlots = 5f; NPC.width = 74; NPC.height = 74; NPC.lifeMax = 825000; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 500000); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); // Phase one settings CalamityGlobalNPC global = NPC.Calamity(); @@ -119,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; @@ -187,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) @@ -274,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; } @@ -462,7 +466,6 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.FrostWave; - int waveDamage = NPC.GetProjectileDamage(type); int totalWaves = death ? (phase4 ? 27 : 25) : (phase4 ? 25 : 23); int shotSpacing = death ? (phase4 ? 185 : 200) : (phase4 ? 200 : 215); float projectileSpawnX = Main.player[NPC.target].Center.X - totalWaves * shotSpacing * 0.5f; @@ -514,7 +517,7 @@ namespace CalamityMod.NPCs.StormWeaver // Frost Waves start moving after 30 frames // Frost Waves take 30 frames to reach full velocity Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.5f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, velocityY); - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.1f, type, waveDamage, 0f, Main.myPlayer, delayBeforeFiring, velocityY); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.1f, type, FrostWaveDamage, 0f, Main.myPlayer, delayBeforeFiring, velocityY); projectileSpawnX += shotSpacing; } } @@ -534,13 +537,12 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ModContent.ProjectileType(); - int tornadoDamage = NPC.GetProjectileDamage(projectileType); int totalTornadoes = revenge ? 7 : expertMode ? 5 : 3; float spawnDistance = revenge ? 750f : expertMode ? 900f : 1050f; for (int i = 0; i < totalTornadoes; i++) { Vector2 spawnPosition = Main.player[NPC.target].Center + Vector2.UnitX * spawnDistance * (i - totalTornadoes / 2); - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer, tornadoDamage, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer, TornadoDamage, 1f); } } } @@ -552,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) { @@ -615,7 +618,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.4f; acceleration *= 1.4f; @@ -670,8 +673,7 @@ namespace CalamityMod.NPCs.StormWeaver Vector2 aimDirection = Main.player[NPC.target].Center - source; float ai = Main.rand.Next(100); int type = ProjectileID.CultistBossLightningOrbArc; - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), source, boltVelocity, type, damage, 0f, Main.myPlayer, aimDirection.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, boltVelocity, type, LightningDamage, 0f, Main.myPlayer, aimDirection.ToRotation(), ai); } } } @@ -774,19 +776,6 @@ namespace CalamityMod.NPCs.StormWeaver } } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = velocity * 0.25f; - float minimalDamageVelocity = velocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; if (phase4) @@ -840,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 @@ -883,7 +872,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 480 : 240; + int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 360 : 240; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration); } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 5ac021a23c..3608b9cc4d 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -35,9 +35,11 @@ namespace CalamityMod.NPCs.StormWeaver } } + public static int LightningOrbDamage = 64; // 256 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 80; // 160 NPC.npcSlots = 5f; NPC.width = 48; NPC.height = 80; @@ -66,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; @@ -116,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) @@ -148,8 +150,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.npc[(int)NPC.ai[2]].localAI[0] % spawnOrbGateValue == 0f) { int type = ProjectileID.CultistBossLightningOrb; - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, LightningOrbDamage, 0f, Main.myPlayer); } } } @@ -226,21 +227,6 @@ namespace CalamityMod.NPCs.StormWeaver else if (targetX > 0f) NPC.spriteDirection = 1; } - - // Calculate contact damage based on velocity - float velocity = (phase2 ? 12f : 10f) + (revenge ? 1.5f : expertMode ? 1f : 0f); - float minimalContactDamageVelocity = velocity * 0.25f; - float minimalDamageVelocity = velocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -258,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 @@ -309,7 +295,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 120 : 60; + int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 240 : 120; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration); } @@ -364,7 +350,6 @@ namespace CalamityMod.NPCs.StormWeaver public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index b1e816ffd4..dc21b19b4f 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -38,9 +38,9 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 56; NPC.height = 42; NPC.defense = 22; - NPC.lifeMax = 1130; + NPC.lifeMax = 900; NPC.aiStyle = AIType = -1; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.HitSound = SoundID.NPCHit38; NPC.DeathSound = SoundID.NPCDeath46; NPC.knockBackResist = 0.04f; diff --git a/NPCs/SulphurousSea/AquaticUrchin.cs b/NPCs/SulphurousSea/AquaticUrchin.cs index 7aa8b8cb5a..f794e7757a 100644 --- a/NPCs/SulphurousSea/AquaticUrchin.cs +++ b/NPCs/SulphurousSea/AquaticUrchin.cs @@ -29,9 +29,9 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 20; NPC.height = 20; NPC.defense = 10; - NPC.lifeMax = Main.hardMode ? 380 : 70; + NPC.lifeMax = Main.hardMode ? 300 : 100; NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath15; NPC.behindTiles = true; diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 84938091ca..597eded883 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -36,9 +36,9 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 54; NPC.height = 42; NPC.defense = 25; - NPC.lifeMax = 1250; + NPC.lifeMax = 1000; NPC.aiStyle = AIType = -1; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.HitSound = SoundID.NPCHit42; NPC.DeathSound = SoundID.NPCDeath5; NPC.knockBackResist = 0f; diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index c9ab7d25d6..893ea62786 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -32,12 +32,11 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 50; NPC.height = 36; NPC.defense = 30; - NPC.DR_NERD(0.15f); NPC.lifeMax = 50; NPC.knockBackResist = 0.25f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 60); + NPC.value = Item.buyPrice(copper: 60); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = SoundID.NPCDeath54; NPC.chaseable = false; diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index 10b51db4fe..602c085d80 100644 --- a/NPCs/SulphurousSea/Sulflounder.cs +++ b/NPCs/SulphurousSea/Sulflounder.cs @@ -30,10 +30,10 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 42; NPC.height = 32; NPC.defense = 15; - NPC.lifeMax = 50; + NPC.lifeMax = 60; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 80); + NPC.value = Item.buyPrice(copper: 80); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = SoundID.NPCDeath53; NPC.knockBackResist = 0.35f; diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index 5ae2c83db4..ac3bda6439 100644 --- a/NPCs/SulphurousSea/Toxicatfish.cs +++ b/NPCs/SulphurousSea/Toxicatfish.cs @@ -28,10 +28,10 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 98; NPC.height = 40; NPC.defense = 12; - NPC.lifeMax = 150; + NPC.lifeMax = 120; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath40; NPC.knockBackResist = 0.8f; diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index 6a7788ecb5..0d74458909 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -32,16 +32,15 @@ namespace CalamityMod.NPCs.SulphurousSea public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.noGravity = true; NPC.damage = 50; NPC.width = 150; NPC.height = 40; NPC.defense = 22; - NPC.lifeMax = 250; + NPC.lifeMax = 200; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath5; NPC.knockBackResist = 0.15f; diff --git a/NPCs/SunkenSea/AlphaSeaMinnow.cs b/NPCs/SunkenSea/AlphaSeaMinnow.cs index 58c72af262..189335adb2 100644 --- a/NPCs/SunkenSea/AlphaSeaMinnow.cs +++ b/NPCs/SunkenSea/AlphaSeaMinnow.cs @@ -285,7 +285,6 @@ namespace CalamityMod.NPCs.SunkenSea base.SetDefaults(); NPC.rarity = 3; NPC.catchItem = ModContent.ItemType(); - NPC.value = 100000; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index 1281c34049..bf1ea170d6 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -148,14 +148,12 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.catchItem = ModContent.ItemType(); NPC.rarity = 3; - NPC.value = 100000; } break; case (int)JellyColor.Gold: { NPC.catchItem = ModContent.ItemType(); NPC.rarity = 3; - NPC.value = 100000; } break; case (int)JellyColor.Voltaic: @@ -286,11 +284,6 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.ProduceGoldCritterDust(); } - if (Variant == (int)JellyColor.Radiant || Variant == (int)JellyColor.Gold) - { - NPC.rarity = 3; - NPC.value = 100000; - } } public override void ModifyTypeName(ref string typeName) diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index 04ceaf2fb2..d7dd89529c 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -47,6 +47,8 @@ namespace CalamityMod.NPCs.SunkenSea public ref float ShellRotation => ref NPC.localAI[0]; + public int originalDamage; + #region Textures public static Asset bottomJawTex; @@ -84,11 +86,10 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetDefaults() { - NPC.damage = Main.hardMode ? 60 : 30; + originalDamage = NPC.damage = Main.hardMode ? 60 : 30; NPC.width = 50; NPC.height = 30; NPC.defense = 9999; - NPC.DR_NERD(0.25f); NPC.lifeMax = Main.hardMode ? 300 : 150; if (Main.expertMode) { @@ -96,7 +97,7 @@ namespace CalamityMod.NPCs.SunkenSea } NPC.aiStyle = -1; AIType = -1; - NPC.value = Main.hardMode ? Item.buyPrice(0, 0, 5, 0) : Item.buyPrice(0, 0, 1, 0); + NPC.value = Main.hardMode ? Item.buyPrice(silver: 5) : Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit4; NPC.knockBackResist = 0; Banner = NPC.type; @@ -160,6 +161,7 @@ namespace CalamityMod.NPCs.SunkenSea { case (int)PhaseType.Idle: { + NPC.damage = 0; NPC.chaseable = false; NPC.velocity.X *= 0.9f; if (ShellRotation > 0) @@ -207,6 +209,7 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Attacking: { + NPC.damage = 0; NPC.knockBackResist = 0.05f; NPC.defense = Main.hardMode ? 15 : 6; NPC.chaseable = true; @@ -225,6 +228,8 @@ namespace CalamityMod.NPCs.SunkenSea } else { + NPC.damage = originalDamage; + if (NPC.velocity.Y < 0) { ShellRotation += 0.065f; @@ -252,6 +257,7 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Squirt: { + NPC.damage = 0; NPC.chaseable = true; // Slow down. Once the clam is rested, start incrementing Timer if (NPC.velocity.Y == 0) @@ -294,6 +300,7 @@ namespace CalamityMod.NPCs.SunkenSea // Fire the projectile if (Timer == (endClose - 5)) { + NPC.damage = originalDamage; Vector2 velocity = NPC.SafeDirectionTo(Target.Center, Vector2.UnitY) * 5; // If the player is on the other side of the clam, flip the jet so that it doesn't fire backwards @@ -324,6 +331,8 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Pod: { + NPC.damage = 0; + NPC.chaseable = true; NPC pod = Main.npc[(int)NPC.localAI[2] - 1]; // If the Pearlpod is invalid, go back to idling diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index 919ba85fac..e0ee8289b4 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -75,13 +75,12 @@ namespace CalamityMod.NPCs.SunkenSea NPC.height = 68; NPC.damage = 20; NPC.defense = 5; - NPC.DR_NERD(0.05f); NPC.lifeMax = 200; NPC.scale = 0.85f; NPC.noGravity = true; NPC.noTileCollide = false; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath55; NPC.knockBackResist = 0.5f; diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 9590d10b40..fc7a89e6ff 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 120; NPC.knockBackResist = 0f; NPC.alpha = 100; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 434b6b0f31..366696548a 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -66,11 +66,10 @@ namespace CalamityMod.NPCs.SunkenSea NPC.width = 160; NPC.height = 120; NPC.defense = 9999; - NPC.DR_NERD(0.3f); NPC.lifeMax = Main.hardMode ? 7500 : 1250; NPC.aiStyle = -1; AIType = -1; - NPC.value = Main.hardMode ? Item.buyPrice(0, 5, 0, 0) : Item.buyPrice(0, 1, 0, 0); + NPC.value = Main.hardMode ? Item.buyPrice(gold: 5) : Item.buyPrice(gold: 1); NPC.HitSound = SoundID.NPCHit4; NPC.knockBackResist = 0f; NPC.rarity = 2; @@ -128,6 +127,12 @@ namespace CalamityMod.NPCs.SunkenSea hasBeenHit = true; } + if (!hasBeenHit) + { + // No contact damage while chillaxing + NPC.damage = 0; + } + NPC.chaseable = hasBeenHit; if (hitAmount == 5) diff --git a/NPCs/SunkenSea/KelpieSeadragon.cs b/NPCs/SunkenSea/KelpieSeadragon.cs index 9f3c186c89..e131646269 100644 --- a/NPCs/SunkenSea/KelpieSeadragon.cs +++ b/NPCs/SunkenSea/KelpieSeadragon.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 150; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.15f; diff --git a/NPCs/SunkenSea/LazarusLampfish.cs b/NPCs/SunkenSea/LazarusLampfish.cs index 5c666ac521..0ea2671558 100644 --- a/NPCs/SunkenSea/LazarusLampfish.cs +++ b/NPCs/SunkenSea/LazarusLampfish.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 400; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.1f; diff --git a/NPCs/SunkenSea/Leerslug.cs b/NPCs/SunkenSea/Leerslug.cs index e80dce77e4..9e0692ce65 100644 --- a/NPCs/SunkenSea/Leerslug.cs +++ b/NPCs/SunkenSea/Leerslug.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 3; NPC.lifeMax = 200; NPC.knockBackResist = 0.2f; - NPC.value = Item.buyPrice(0, 0, 0, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/SunkenSea/LostShoal.cs b/NPCs/SunkenSea/LostShoal.cs index 007a96a9bd..19d401715f 100644 --- a/NPCs/SunkenSea/LostShoal.cs +++ b/NPCs/SunkenSea/LostShoal.cs @@ -87,7 +87,6 @@ namespace CalamityMod.NPCs.SunkenSea { Variant = (int)ShoalColor.Gold; NPC.catchItem = ItemID.GoldCoin; - NPC.value = 10000; } RandomOpacityOffset = Main.rand.NextFloat(MathHelper.TwoPi); diff --git a/NPCs/SunkenSea/Pearlpod.cs b/NPCs/SunkenSea/Pearlpod.cs index 0bad944772..85d2f0e357 100644 --- a/NPCs/SunkenSea/Pearlpod.cs +++ b/NPCs/SunkenSea/Pearlpod.cs @@ -57,7 +57,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 20; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index e4a4fa9c1c..f172a5c609 100644 --- a/NPCs/SunkenSea/PolypPanasea.cs +++ b/NPCs/SunkenSea/PolypPanasea.cs @@ -232,11 +232,6 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.ProduceGoldCritterDust(); } - if (Variant == (int)FishColor.Gold || Variant == (int)FishColor.Radiant) - { - NPC.rarity = 3; - NPC.value = 100000; - } } public void IdleBehavior() @@ -339,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/Polyperil.cs b/NPCs/SunkenSea/Polyperil.cs index d0931479ff..b2019f9781 100644 --- a/NPCs/SunkenSea/Polyperil.cs +++ b/NPCs/SunkenSea/Polyperil.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); // Banner = NPC.type; // BannerItem = ModContent.ItemType(); diff --git a/NPCs/SunkenSea/PolyperilTentacle.cs b/NPCs/SunkenSea/PolyperilTentacle.cs index 67400d3445..f7bd01e49f 100644 --- a/NPCs/SunkenSea/PolyperilTentacle.cs +++ b/NPCs/SunkenSea/PolyperilTentacle.cs @@ -62,7 +62,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = 0; // Banner = NPC.type; // BannerItem = ModContent.ItemType(); } diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index 44b03d44c7..ad485a77d8 100644 --- a/NPCs/SunkenSea/PrismBack.cs +++ b/NPCs/SunkenSea/PrismBack.cs @@ -65,11 +65,10 @@ namespace CalamityMod.NPCs.SunkenSea NPC.width = 88; NPC.height = 66; NPC.defense = 15; - NPC.DR_NERD(0.25f); NPC.lifeMax = 500; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit24; NPC.DeathSound = SoundID.NPCDeath27; NPC.knockBackResist = 0.15f; diff --git a/NPCs/SunkenSea/PrismaticGuppy.cs b/NPCs/SunkenSea/PrismaticGuppy.cs index 79e948cf17..78b9265cf9 100644 --- a/NPCs/SunkenSea/PrismaticGuppy.cs +++ b/NPCs/SunkenSea/PrismaticGuppy.cs @@ -218,7 +218,6 @@ namespace CalamityMod.NPCs.SunkenSea { CurrentColor = Main.rand.Next(3, 5); NPC.rarity = 3; - NPC.value = 100000; } // Decide item.......................... switch (CurrentColor) @@ -580,15 +579,8 @@ namespace CalamityMod.NPCs.SunkenSea if (CurrentColor == (int)FishColor.Gold) { - NPC.rarity = 3; - NPC.value = 100000; NPC.ProduceGoldCritterDust(); } - if (CurrentColor == (int)FishColor.Radiant) - { - NPC.rarity = 3; - NPC.value = 100000; - } } protected override void OnPredatorDetection(NPC predator) diff --git a/NPCs/SunkenSea/Probesnout.cs b/NPCs/SunkenSea/Probesnout.cs index f65242bb4b..48c6d7c384 100644 --- a/NPCs/SunkenSea/Probesnout.cs +++ b/NPCs/SunkenSea/Probesnout.cs @@ -424,7 +424,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.catchItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; @@ -475,7 +474,6 @@ namespace CalamityMod.NPCs.SunkenSea base.SetDefaults(); NPC.rarity = 3; NPC.catchItem = ItemType(); - NPC.value = 100000; } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/SandProwler.cs b/NPCs/SunkenSea/SandProwler.cs index 6aa9a401ee..b734bfcad1 100644 --- a/NPCs/SunkenSea/SandProwler.cs +++ b/NPCs/SunkenSea/SandProwler.cs @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/SunkenSea/SandProwlerNested.cs b/NPCs/SunkenSea/SandProwlerNested.cs index a083cfd7f1..980e5e4919 100644 --- a/NPCs/SunkenSea/SandProwlerNested.cs +++ b/NPCs/SunkenSea/SandProwlerNested.cs @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/SunkenSea/Scavenger.cs b/NPCs/SunkenSea/Scavenger.cs index b021457490..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); @@ -282,7 +286,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 350; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit38; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.15f; diff --git a/NPCs/SunkenSea/SeaFloaty.cs b/NPCs/SunkenSea/SeaFloaty.cs index e1cdc54587..a414ec9999 100644 --- a/NPCs/SunkenSea/SeaFloaty.cs +++ b/NPCs/SunkenSea/SeaFloaty.cs @@ -53,7 +53,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 5; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 0, 50); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.chaseable = false; diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index d5e4c0c4ee..abddd9f9d4 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -420,7 +420,6 @@ namespace CalamityMod.NPCs.SunkenSea base.SetDefaults(); NPC.catchItem = (short)ModContent.ItemType(); NPC.rarity = 3; - NPC.value = 100000; } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/Searslug.cs b/NPCs/SunkenSea/Searslug.cs index e734174565..a09f1258e6 100644 --- a/NPCs/SunkenSea/Searslug.cs +++ b/NPCs/SunkenSea/Searslug.cs @@ -54,7 +54,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 20; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; @@ -193,7 +192,7 @@ namespace CalamityMod.NPCs.SunkenSea // Wear protection! if (failed) { - player.AddBuff(BuffID.OnFire3, CalamityUtils.SecondsToFrames(5)); + player.AddBuff(BuffID.OnFire, CalamityUtils.SecondsToFrames(5)); } } } diff --git a/NPCs/SunkenSea/Sharkoon.cs b/NPCs/SunkenSea/Sharkoon.cs index 488b3b0c88..a695aaf629 100644 --- a/NPCs/SunkenSea/Sharkoon.cs +++ b/NPCs/SunkenSea/Sharkoon.cs @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/SunkenSea/Slugbun.cs b/NPCs/SunkenSea/Slugbun.cs index ace12fc895..7d55b2776d 100644 --- a/NPCs/SunkenSea/Slugbun.cs +++ b/NPCs/SunkenSea/Slugbun.cs @@ -70,7 +70,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 20; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; @@ -135,7 +134,6 @@ namespace CalamityMod.NPCs.SunkenSea { CurrentSkin = (int)SlugSkin.Radiant; NPC.rarity = 3; - NPC.value = 100000; } // Decide item.......................... switch (CurrentSkin) @@ -192,11 +190,6 @@ namespace CalamityMod.NPCs.SunkenSea } } } - if (CurrentSkin == (int)SlugSkin.Radiant) - { - NPC.rarity = 3; - NPC.value = 100000; - } } public override void FindFrame(int frameHeight) diff --git a/NPCs/SunkenSea/Steampod.cs b/NPCs/SunkenSea/Steampod.cs index 1bce51ca4a..606ff7c184 100644 --- a/NPCs/SunkenSea/Steampod.cs +++ b/NPCs/SunkenSea/Steampod.cs @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 10; NPC.lifeMax = 200; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; @@ -479,7 +479,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (hurtInfo.Damage <= 0) return; - target.AddBuff(BuffID.OnFire3, 120); + target.AddBuff(BuffID.OnFire, 120); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/StormlionSentry.cs b/NPCs/SunkenSea/StormlionSentry.cs index bb8a55dce1..7cadfdffe3 100644 --- a/NPCs/SunkenSea/StormlionSentry.cs +++ b/NPCs/SunkenSea/StormlionSentry.cs @@ -76,6 +76,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.damage = 15; NPC.defense = 3; NPC.knockBackResist = 0f; + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = Effects.StormlionEffects.Hit; NPC.DeathSound = Effects.StormlionEffects.Killed; NPC.noGravity = true; diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index 74e37f921d..1e171f6b9c 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -336,7 +336,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = (int)(NPC.GetProjectileDamage(type) * 0.5f); int totalProjectiles = 30; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 1f; @@ -345,7 +344,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int k = 0; k < totalProjectiles; k++) { Vector2 projectileVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, SupremeCalamitas.DartDamage, 0f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); } NPC.netUpdate = true; } diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 5feceaae21..10c78e8c89 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -57,13 +57,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.aiStyle = -1; AIType = -1; NPC.width = 40; NPC.height = 40; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats NPC.defense = 60; NPC.DR_NERD(NormalDR); NPC.lifeMax = 28000; @@ -162,8 +162,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float targetDist = Vector2.Distance(Target.Center, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - float velocity = 5f; float projectileVelocityToPass = velocity * 3f; Vector2 shootVelocity = (Target.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; @@ -179,7 +177,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, shootVelocity * 0.5f, type, damage, 1f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, shootVelocity * 0.5f, type, SupremeCalamitas.DartDamage, 1f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); for (int i = 0; i < 5; i++) { Dust ShotDust = Dust.NewDustPerfect(NPC.Center, Main.rand.NextBool(3) ? 60 : 114); @@ -208,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 e331c4fb42..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"); @@ -253,15 +253,21 @@ 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 FireblastDamage = 100; // 400 + public static int GigablastDamage = 110; // 440 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 220; // 440 NPC.npcSlots = 50f; NPC.width = NPC.height = 44; NPC.defense = 100; NPC.DR_NERD(normalDR); - NPC.value = Item.buyPrice(3, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 3); NPC.LifeMaxNERB(960000, 1150000, 900000); NPC.aiStyle = -1; AIType = -1; @@ -449,21 +455,12 @@ 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; - // Projectile damage values - int bulletHellblastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int barrageDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int fireblastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int gigablastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int monsterDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int waveDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int hellblastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int bulletHellblast = zenithAI ? ModContent.ProjectileType() : ModContent.ProjectileType(); int barrage = ModContent.ProjectileType(); int gigablast = zenithAI ? ModContent.ProjectileType() : ModContent.ProjectileType(); @@ -475,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; @@ -847,24 +844,24 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 300 && !Main.zenithWorld) // Blasts from above { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 600) // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from above, left, and right { if (!Main.zenithWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -951,17 +948,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (bulletHellCounter2 < 1200) { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 1500 && bulletHellCounter2 > 1200) { if (bulletHellCounter2 % 180 == 0) // Blasts from right - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 > 1500) { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); } bulletHellCounter++; @@ -972,21 +969,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 1200 && !Main.zenithWorld) // Blasts from below { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 1500) // Blasts from left { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1084,10 +1081,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.One, ModContent.ProjectileType(), PermafrostAbsoluteZeroDamage, 0f, Main.myPlayer, 0f, 0f, NPC.whoAmI); if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 240 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); bulletHellCounter++; if (bulletHellCounter >= baseBulletHellProjectileGateValue + 4) @@ -1097,21 +1094,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 2100 && !Main.zenithWorld) // Blasts from above { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 2400) // Blasts from right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1256,10 +1253,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 240 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); int divisor = revenge ? 225 : expertMode ? 450 : 675; @@ -1291,7 +1288,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(orb); } - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), monsterDamage, 0f, Main.myPlayer, 0f); + // Whispering Maelstrom passes through normal CanHitPlayer hooks then overrides them. This needs it to have contact damage but the number itself doesn't matter. + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), 100, 0f, Main.myPlayer, 0f); } bulletHellCounter++; @@ -1302,21 +1300,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 3000 && !Main.zenithWorld) // Blasts from below { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 3300) // Blasts from left { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1425,16 +1423,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (bulletHellCounter2 % 240 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 360 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 30 == 0) // Projectiles that move in wave pattern { int random = Main.rand.Next(-500, 501); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, wave, waveDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, wave, waveDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, wave, SkullDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, wave, SkullDamage, 0f, Main.myPlayer, 0f, 2f); } bulletHellCounter++; @@ -1445,25 +1443,25 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 3900 && !Main.zenithWorld) // Blasts from above { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 4200) // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from above, left, and right { if (!Main.zenithWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1595,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; @@ -1954,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); @@ -2167,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; @@ -2221,7 +2219,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient && attackPause == 0) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2240,7 +2238,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient && attackPause == 0) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2264,7 +2262,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float projectileVelocityToPass = projectileVelocity.Length() * 1.3f; Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, barrageDamage, 0f, Main.myPlayer, 0, 4f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, DartDamage, 0f, Main.myPlayer, 0, 4f, projectileVelocityToPass); NPC.netUpdate = true; } } @@ -2281,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) @@ -2383,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; @@ -2440,7 +2438,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas projectileVelocity *= 10f * uDieLul; int projectileType = hellblast; if (attackPause == 0) - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -2462,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; @@ -2510,7 +2508,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f; projectileVelocity *= 5f * uDieLul; int projectileType = gigablast; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + if (attackPause == 0) + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); } } @@ -2524,7 +2523,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - // Previously the 0.4% health threshold transition + // Previously the 40% health threshold transition if (lifeRatio <= 0.45f && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) { NPC.ai[0] = 1f; @@ -2733,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; @@ -2785,7 +2784,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2803,7 +2802,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2827,7 +2826,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float projectileVelocityToPass = projectileVelocity.Length() * 1.3f; Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 4f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, DartDamage, 0f, Main.myPlayer, 0f, 4f, projectileVelocityToPass); NPC.netUpdate = true; } } @@ -2842,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) @@ -2916,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; @@ -2973,7 +2972,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas projectileVelocity *= 10f * uDieLul; int projectileType = hellblast; if (attackPause == 0) - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -3000,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; @@ -3050,7 +3049,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); projectileVelocity *= 5f * uDieLul; int projectileType = gigablast; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); } } @@ -3772,15 +3771,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - { - target.AddBuff(ModContent.BuffType(), 600); - } } } } diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 3dc5c8320c..dc946029a9 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -74,10 +74,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } + public static int FistDamage = 105; // 420 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -335,7 +337,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = Main.zenithWorld ? SupremeCatastrophe.SlashDamage : FistDamage; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -401,7 +403,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = Main.zenithWorld ? SupremeCatastrophe.SlashDamage : FistDamage; Vector2 fistSpawnPosition = NPC.Center + Vector2.UnitX * 74f * NPC.direction; if ((broIsAlive == false ? BigAttackLimit <= 3 && BigAttackLimit > 0 : BigAttackLimit == 1) && death) @@ -415,7 +417,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, NPC.DirectionTo(Target.Center) * 9.5f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt(), 3); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, NPC.DirectionTo(Target.Center) * 9.5f, ModContent.ProjectileType(), FistDamage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt(), 3); } SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound with { Volume = 1.8f, Pitch = 0.5f }, NPC.Center); SoundStyle charge = new("CalamityMod/Sounds/Item/ScorchedEarthShot", 3); diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 8985549edc..a86a36d1ec 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -67,10 +67,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } + public static int SlashDamage = 105; // 420 + public static int TrailedSlashDamage = 120; // 480 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -270,9 +273,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas dashAttackTimer--; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, NPC.velocity.SafeNormalize(Vector2.UnitY) * 0.1f, type, damage, 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, damage, 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, damage, 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); @@ -379,7 +380,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = Main.zenithWorld ? SupremeCataclysm.FistDamage : SlashDamage; Vector2 slashSpawnPosition = NPC.Center + Vector2.UnitX * 125f * NPC.direction; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -444,12 +445,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = Main.zenithWorld ? SupremeCataclysm.FistDamage : SlashDamage; Vector2 slashSpawnPosition = NPC.Center; Vector2 firingVelocity = (broIsAlive == false ? (NPC.DirectionTo(Target.Center) + Target.velocity * 0.032f).SafeNormalize(Vector2.UnitY) : NPC.DirectionTo(Target.Center)); 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 805e23757a..cfdfcb7410 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -16,6 +16,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses private const float SpinVelocity = 12f; private const int SpinRadius = 45; + // Rev+ exclusive + public static float ContactDamageMult = 1.15f; // 62 (buffed from 54) + public static int BloodShotDamage = 12; // 48 + public static bool BuffedBrainofCthulhuAI(NPC npc, Mod mod) { // whoAmI variable @@ -33,28 +37,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - bool enrage = !BossRushEvent.BossRushActive; - int targetTileX = (int)Main.player[npc.target].Center.X / 16; - int targetTileY = (int)Main.player[npc.target].Center.Y / 16; - - Tile tile = Framing.GetTileSafely(targetTileX, targetTileY); - if (tile.WallType == WallID.CrimstoneUnsafe) - enrage = false; - - float enrageScale = death ? 0.5f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface && enrage) - { - npc.Calamity().CurrentlyEnraged = true; - enrageScale += 0.5f; - } - if (!Main.player[npc.target].ZoneCrimson && enrage) - { - npc.Calamity().CurrentlyEnraged = true; - enrageScale += 2f; - } - // Despawn check - bool despawn = Main.player[npc.target].dead; + bool despawn = (Main.player[npc.target].dead || !Main.player[npc.target].ZoneCrimson) && !BossRushEvent.BossRushActive; // Despawn if (despawn) @@ -68,9 +52,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.localAI[3] > 0f) npc.localAI[3] -= 1f; - // Extra distance for teleports if enraged - int teleportDistanceIncrease = (int)Math.Round(enrageScale * 3); - // Spawn Creepers if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 0f) { @@ -106,7 +87,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 @@ -204,7 +185,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Charge variables - float chargeVelocity = (death ? 18f : 15f) + 3f * enrageScale; + float chargeVelocity = death ? 19.5f : 15f; if (phase7) chargeVelocity *= 1.2f; @@ -235,15 +216,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float velocityScale = death ? 6f : 4.5f; float velocityBoost = velocityScale * (1f - lifeRatio); - float nonChargeSpeed = (death ? 24f : 18f) + velocityBoost + 3f * enrageScale; - if (CalamityWorld.LegendaryMode) + float nonChargeSpeed = (death ? 25.5f : 18f) + velocityBoost; + if (Main.getGoodWorld) nonChargeSpeed *= 1.15f; float minInertia = death ? 50f : 75f; float maxInertia = death ? 70f : 100f; float inertia = MathHelper.Lerp(minInertia, maxInertia, lifeRatio); - Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero); + Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 10f : Vector2.Zero); Vector2 idealVelocity = (destination - npc.Center).SafeNormalize(Vector2.UnitY) * nonChargeSpeed; npc.velocity = (npc.velocity * (inertia - 1f) + idealVelocity) / inertia; } @@ -267,7 +248,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { // Set damage - npc.damage = npc.defDamage; + npc.damage = (int)Math.Round(npc.defDamage * ContactDamageMult); } // Teleport @@ -289,8 +270,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.ForceRoarPitched, npc.Center); // Velocity - npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; - if (CalamityWorld.LegendaryMode) + npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 10f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; + if (Main.getGoodWorld) npc.velocity *= 1.15f; } } @@ -307,7 +288,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (!Main.dedServ) { @@ -332,10 +313,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) < minChargeDistance) { npc.ai[2] -= 1f; - npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (-chargeVelocity - 2f * enrageScale); + 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; } } @@ -344,7 +325,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] >= timer) { // Shoot projectiles from 4 directions, alternating between diagonal and cardinal - float bloodShotVelocity = (death ? 7.5f : 6f) + enrageScale; + float bloodShotVelocity = death ? 8f : 6f; // Scale projectile velocity float phase7ProjectileVelocityMult = 1.2f; @@ -422,7 +403,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.BloodShot; - int damage = npc.GetProjectileDamage(type); int numProj = death ? 9 : 4; int spread = death ? 32 : 15; if (phase7) @@ -440,7 +420,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int j = 0; j < numProj; j++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), position + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), position + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; if (!canHit) Main.projectile[proj].tileCollide = false; @@ -455,7 +435,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.BloodNautilusShot; - int damage = npc.GetProjectileDamage(type); int numProj = death ? 13 : 7; int spread = death ? 60 : 40; if (phase7) @@ -478,7 +457,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity2.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; if (!canHit2) Main.projectile[proj].tileCollide = false; @@ -500,7 +479,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == -1f || npc.ai[0] == -6f) { // Set damage - npc.damage = npc.defDamage; + npc.damage = (int)Math.Round(npc.defDamage * ContactDamageMult); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -570,8 +549,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - int teleportX = Main.rand.Next(minX, maxX + 1) + teleportDistanceIncrease; - int teleportY = Main.rand.Next(minY, maxY + 1) + teleportDistanceIncrease; + int teleportX = Main.rand.Next(minX, maxX + 1); + int teleportY = Main.rand.Next(minY, maxY + 1); if (Main.rand.NextBool()) teleportX *= -1; @@ -698,7 +677,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses creeperCount = GetBrainOfCthuluCreepersCountRevDeath(); float creeperRatio = creeperCount / (float)GetBrainOfCthuluCreepersCountRevDeath(); - float velocityScale = MathHelper.Lerp(0f, 2f, 1f - creeperRatio) + enrageScale; + float velocityScale = MathHelper.Lerp(0f, 2f, 1f - creeperRatio) + (death ? 0.5f : 0f); // Check for phase 2 bool phase2 = creeperCount <= 0; @@ -727,7 +706,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) @@ -771,8 +750,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses phase1TeleportTileX = (int)Main.player[npc.target].Center.X / 16; phase1TeleportTileY = (int)Main.player[npc.target].Center.Y / 16; - int min = 28 + teleportDistanceIncrease; - int max = 30 + teleportDistanceIncrease; + int min = 28; + int max = 30; if (Main.rand.NextBool()) phase1TeleportTileX += Main.rand.Next(min, max); @@ -864,16 +843,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) CalamityUtils.CalamityTargeting(npc, default); - float enrageScaleMax = 2f; - float enrageScale = death ? 0.5f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface) - enrageScale += 0.5f; - if (!Main.player[npc.target].ZoneCrimson) - enrageScale += 1f; - - if (enrageScale > enrageScaleMax) - enrageScale = enrageScaleMax; - bool brainIsNotTeleportingOrCharging = Main.npc[NPC.crimsonBoss].ai[0] == 0f || Main.npc[NPC.crimsonBoss].ai[0] == -1f || Main.npc[NPC.crimsonBoss].ai[0] == -6f; bool brainIsInPhase2 = Main.npc[NPC.crimsonBoss].ai[0] < 0f; @@ -882,7 +851,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (creeperCount > GetBrainOfCthuluCreepersCountRevDeath()) creeperCount = GetBrainOfCthuluCreepersCountRevDeath(); - float creeperRatio = 1f; + float creeperRatio; if (death && brainIsInPhase2) { bool brainIsInPhase3 = Main.npc[NPC.crimsonBoss].localAI[0] == 2f; @@ -896,10 +865,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Scale the aggressiveness of the charges with amount of Creepers remaining float chargeAggressionScale = creeperRatio <= 0.1f ? 1.75f : creeperRatio <= 0.2f ? 1.25f : creeperRatio <= 0.4f ? 0.875f : creeperRatio <= 0.6f ? 0.5f : creeperRatio <= 0.8f ? 0.25f : 0f; - if (enrageScale > 0f) - chargeAggressionScale *= 1f + enrageScale; if (death) - chargeAggressionScale *= 1.25f; + chargeAggressionScale *= 1.875f; // Give off blood dust before charging float beginTelegraphGateValue = TimeBeforeCreeperAttack - CreeperTelegraphTime; @@ -928,8 +895,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float brainXDist = Main.npc[NPC.crimsonBoss].Center.X - creeperCenter.X; float brainYDist = Main.npc[NPC.crimsonBoss].Center.Y - creeperCenter.Y; float brainDistance = (float)Math.Sqrt(brainXDist * brainXDist + brainYDist * brainYDist); - float velocity = (death ? 16f : 8f) + chargeAggressionScale; - velocity += 2f * enrageScale; + float velocity = (death ? 17f : 8f) + chargeAggressionScale; if (brainIsInPhase2) { float velocityFloor = Main.npc[NPC.crimsonBoss].velocity.Length() + velocity * 0.5f; @@ -984,18 +950,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Always fully visible while charging npc.alpha = 0; - float chargeVelocity = (death ? 12f : 6f) + chargeAggressionScale; - chargeVelocity += 2f * enrageScale; + float chargeVelocity = (death ? 13f : 6f) + chargeAggressionScale; float returnToBrainGateValue = 1f; if (!brainIsInPhase2) { // Set damage - npc.damage = npc.defDamage; + npc.damage = (int)Math.Round(npc.defDamage * ContactDamageMult); 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; @@ -1026,8 +991,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ProjectileID.BloodShot; - int damage = npc.GetProjectileDamage(projectileType); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, projectileVelocity, projectileType, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, projectileVelocity, projectileType, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; if (!canHit) Main.projectile[proj].tileCollide = false; @@ -1050,7 +1014,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 62da8e5ebf..9c2853f6ba 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs @@ -13,6 +13,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class CultistAI { + // Vanilla values + public static int CloneFireballDamage = 18; // 72 + public static int FireballDamage = 20; // 80 + public static int IceMistDamage = 25; // 100 + public static int LightningDamage = 30; // 120 + public static int DoomDamage = 45; // 180 (Also fixes Master Mode scaling) + public static bool BuffedCultistAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -52,9 +59,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float distanceAboveTarget = -240f; float moveSpeed = death ? 300f : 75f; - int iceMistDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossIceMist) : 0; - int fireballDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossFireBall) : npc.GetProjectileDamage(ProjectileID.CultistBossFireBallClone); - int lightningDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossLightningOrb) : 0; + int iceMistDamage = isCultist ? IceMistDamage : 0; + int fireballDamage = isCultist ? FireballDamage : CloneFireballDamage; + int lightningDamage = isCultist ? LightningDamage : 0; int iceMistFireRate = phase2 ? 50 : 60; float iceMistSpeed = (phase6 ? 12f : 10f) + (death ? (1f - lifeRatio) : 0f); @@ -69,11 +76,11 @@ 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 = 30; + iceMistFireRate = 40; iceMistSpeed = 15f; - fireballFireRate = 6; + fireballFireRate = 8; fireballSpeed *= 1.25f; lightningOrbPhaseTime = 60; ancientLightSpawnRate = 10; @@ -94,7 +101,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Enrage - if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) || CalamityWorld.LegendaryMode) + if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { calamityGlobalNPC.newAI[0] += 1f; if (calamityGlobalNPC.newAI[0] >= 120f) @@ -516,7 +523,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 shadowFireballDirection = center4 + new Vector2(npc.direction * 30, 12f); Vector2 shadowFireballVelocity = playerDirection * (fireballSpeed + (float)Main.rand.NextDouble()); shadowFireballVelocity = shadowFireballVelocity.RotatedByRandom(Math.PI / 6D); - Projectile.NewProjectile(npc.GetSource_FromAI(), shadowFireballDirection, shadowFireballVelocity, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), shadowFireballDirection, shadowFireballVelocity, ProjectileID.CultistBossFireBallClone, CloneFireballDamage, 0f, Main.myPlayer); } } } @@ -1051,7 +1058,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (CalamityGlobalNPC.adultEidolonWyrmHead != -1) { if (Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active) - npc.damage *= 3; + npc.damage = (int)Math.Round(npc.defDamage * PrimordialWyrmHead.LightDamageMult); } } @@ -1179,16 +1186,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] >= duration) { int type = ProjectileID.AncientDoomProjectile; - int damage = npc.GetProjectileDamage(type); + int damage = DoomDamage; - // Triple damage if the Primordial Wyrm is alive + // Increase damage if the Primordial Wyrm is alive if (Main.npc[(int)npc.ai[0]].type == ModContent.NPCType()) - damage *= 3; + damage = (int)Math.Round(damage * PrimordialWyrmHead.DoomDamageMult); 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/DeerclopsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs index 8b178b34e6..8fba6d9d83 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs @@ -24,6 +24,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static float borderScalar = 0f; public static Vector2 lastDeerclopsPosition; + // Vanilla values + public static int DebrisDamage = 18; // 72 + + // Rev+ exclusive + public static int IceSpikeDamage = 16; // 64 (buffed from 52) + public static int HandDamage = 13; // 52 (buffed from 40) + public static bool BuffedDeerclopsAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -38,11 +45,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Projectile types and damage int rubble = ProjectileID.DeerclopsRangedProjectile; - int rubbleDamage = npc.GetProjectileDamage(rubble); int iceSpike = ProjectileID.DeerclopsIceSpike; - int iceSpikeDamage = npc.GetProjectileDamage(iceSpike); int shadowHand = ProjectileID.InsanityShadowHostile; - int shadowHandDamage = npc.GetProjectileDamage(shadowHand); if (npc.target.WithinBounds(Main.player.Length) && Main.player[npc.target].dead) { @@ -63,7 +67,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float resistDamageAmount = MathHelper.Clamp((distanceFromTarget - IncreaseDRTriggerDistance) / (MaxDRIncreaseDistance - IncreaseDRTriggerDistance), 0f, 1f); npc.localAI[3] = MathHelper.Lerp(0f, 30f, resistDamageAmount); float dustAndDRScalar = Utils.Remap(npc.localAI[3], 0f, 30f, 0f, 1f); - calamityGlobalNPC.DR = MathHelper.Lerp(0.05f, 0.9f, dustAndDRScalar); + calamityGlobalNPC.DR = MathHelper.Lerp(0f, 0.9f, dustAndDRScalar); if (borderDelay > 0f) borderDelay -= 1f; @@ -128,7 +132,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn Shadow Hands if the player enters the shadows if (Main.netMode != NetmodeID.MultiplayerClient && hasTargetBeenInRange) - SpawnBorderShadowHands(npc, lifeRatio, shadowHand, shadowHandDamage, death); + SpawnBorderShadowHands(npc, lifeRatio, shadowHand, HandDamage, death); // AI states switch ((int)npc.ai[0]) @@ -270,7 +274,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; haltMovement = true; - MakeSpikesForward(npc, 1, targetData, iceSpike, iceSpikeDamage, lifeRatio, death); + MakeSpikesForward(npc, 1, targetData, iceSpike, IceSpikeDamage, lifeRatio, death); float iceSpikePhaseGateValue = 80f; if (npc.ai[1] >= iceSpikePhaseGateValue) @@ -314,7 +318,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses rubbleLimit = rubbleStart; for (int rubbleIndex = rubbleStart; rubbleIndex < rubbleLimit && rubbleIndex < numRubble; rubbleIndex++) - ShootRubbleUp(npc, ref sourceTileCoords, numRubble, distancedByThisManyTiles, rubbleIndex, rubble, rubbleDamage, lifeRatio, death); + ShootRubbleUp(npc, ref sourceTileCoords, numRubble, distancedByThisManyTiles, rubbleIndex, rubble, DebrisDamage, lifeRatio, death); } if (npc.ai[1] >= 60f) @@ -355,7 +359,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 actualVelocity = spinningPoint.RotatedBy(radians * k); float velocityMultiplier = 1f - k * velocityMultIncrement; - Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, shadowHandDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, HandDamage, 0f, Main.myPlayer); } } } @@ -375,7 +379,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; haltMovement = true; npc.TargetClosest(); - MakeSpikesBothSides(npc, 1, targetData, iceSpike, iceSpikeDamage, lifeRatio, death); + MakeSpikesBothSides(npc, 1, targetData, iceSpike, IceSpikeDamage, lifeRatio, death); float doubleIceSpikePhaseGateValue = 90f; if (npc.ai[1] >= doubleIceSpikePhaseGateValue) @@ -416,7 +420,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 actualVelocity = spinningPoint.RotatedBy(radians * k); float velocityMultiplier = 1f - (k * velocityMultIncrement * 0.5f); - Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, shadowHandDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, HandDamage, 0f, Main.myPlayer); } } } @@ -578,7 +582,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - private static void SpawnBorderShadowHands(NPC npc, float lifeRatio, int shadowHand, int shadowHandDamage, bool death) + private static void SpawnBorderShadowHands(NPC npc, float lifeRatio, int shadowHand, int HandDamage, bool death) { int shadowHandSpawnRate = death ? 15 : 20; npc.localAI[2] += 1f; @@ -601,12 +605,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 spawnPosition = npc.Center + (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * (playerDistanceFromDeerclops + minShadowHandSpawnDistanceFromPlayer); float shadowHandVelocity = death ? 6f : 5f; Vector2 spawnVelocity = (player.Center - spawnPosition).SafeNormalize(Vector2.UnitY) * shadowHandVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition, spawnVelocity, shadowHand, shadowHandDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition, spawnVelocity, shadowHand, HandDamage, 0f, Main.myPlayer); } } } - private static void ShootRubbleUp(NPC npc, ref Point sourceTileCoords, int howMany, int distancedByThisManyTiles, int whichOne, int rubble, int rubbleDamage, float lifeRatio, bool death) + private static void ShootRubbleUp(NPC npc, ref Point sourceTileCoords, int howMany, int distancedByThisManyTiles, int whichOne, int rubble, int DebrisDamage, float lifeRatio, bool death) { // Loop to spawn rubble // The rubble attempts are used to offset the Y coordinates of the rubble spawns to make sure they can spawn in non-solid tiles @@ -618,13 +622,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int posY = sourceTileCoords.Y + rubbleSpawnAttempts; if (WorldGen.ActiveAndWalkableTile(posX, posY)) { - SpawnRubble(npc, posX, posY, howMany, whichOne, rubble, rubbleDamage, lifeRatio, death); + SpawnRubble(npc, posX, posY, howMany, whichOne, rubble, DebrisDamage, lifeRatio, death); break; } } } - private static void SpawnRubble(NPC npc, int posX, int posY, int howMany, int whichOne, int rubble, int rubbleDamage, float lifeRatio, bool death) + private static void SpawnRubble(NPC npc, int posX, int posY, int howMany, int whichOne, int rubble, int DebrisDamage, float lifeRatio, bool death) { Vector2 rubbleVelocity = new Vector2(0f, -1f).RotatedBy((float)(whichOne * npc.direction) * 0.7f * ((float)Math.PI / 4f / (float)howMany)); int ai1_FrameToUse = Main.rand.Next(Main.projFrames[rubble] * 4); @@ -632,10 +636,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float delay = death ? 24f : 30f; float ai2_DelayBeforeGoingUp = (whichOne + 1) * delay; float velocityMultiplier = MathHelper.Lerp(0.01f, 0.015f, 1f - lifeRatio); - Projectile.NewProjectile(npc.GetSource_FromAI(), new Vector2(posX * 16 + 8, posY * 16 - 8), rubbleVelocity * velocityMultiplier, rubble, rubbleDamage, 0f, Main.myPlayer, 0f, ai1_FrameToUse, ai2_DelayBeforeGoingUp); + Projectile.NewProjectile(npc.GetSource_FromAI(), new Vector2(posX * 16 + 8, posY * 16 - 8), rubbleVelocity * velocityMultiplier, rubble, DebrisDamage, 0f, Main.myPlayer, 0f, ai1_FrameToUse, ai2_DelayBeforeGoingUp); } - private static void MakeSpikesForward(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int iceSpikeDamage, float lifeRatio, bool death) + private static void MakeSpikesForward(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int IceSpikeDamage, float lifeRatio, bool death) { if (Main.netMode == NetmodeID.MultiplayerClient) return; @@ -664,12 +668,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = iceSpikeStart; i < iceSpikeLimit && i < numIceSpikes; i++) { int xOffset = (int)Math.Round(i * xOffsetMult * iceSpikeScaleIncrease); - TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, i, xOffset, iceSpike, iceSpikeDamage, lifeRatio, death); + TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, i, xOffset, iceSpike, IceSpikeDamage, lifeRatio, death); } } } - private static void MakeSpikesBothSides(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int iceSpikeDamage, float lifeRatio, bool death) + private static void MakeSpikesBothSides(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int IceSpikeDamage, float lifeRatio, bool death) { if (Main.netMode == NetmodeID.MultiplayerClient) return; @@ -697,13 +701,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int iceSpikeIndex = iceSpikeStart; iceSpikeIndex >= 0 && iceSpikeIndex < iceSpikeLimit && iceSpikeIndex < numIceSpikes; iceSpikeIndex++) { int xOffset = (int)Math.Round(iceSpikeIndex * xOffsetMult * iceSpikeScaleIncrease); - TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, iceSpikeDamage, lifeRatio, death); - TryMakingSpike(npc, ref sourceTileCoords, -npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, iceSpikeDamage, lifeRatio, death); + TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, IceSpikeDamage, lifeRatio, death); + TryMakingSpike(npc, ref sourceTileCoords, -npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, IceSpikeDamage, lifeRatio, death); } } } - private static void TryMakingSpike(NPC npc, ref Point sourceTileCoords, int dir, int howMany, int whichOne, int xOffset, int iceSpike, int iceSpikeDamage, float lifeRatio, bool death) + private static void TryMakingSpike(NPC npc, ref Point sourceTileCoords, int dir, int howMany, int whichOne, int xOffset, int iceSpike, int IceSpikeDamage, float lifeRatio, bool death) { int posX = sourceTileCoords.X + xOffset * dir; int posY = FindBestY(npc, ref sourceTileCoords, posX); @@ -712,7 +716,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 iceSpikeSpawnPos = new Vector2(posX * 16 + 8, posY * 16 - 8); Vector2 iceSpikeVelocity = new Vector2(0f, -1f).RotatedBy((float)(whichOne * dir) * 0.7f * ((float)Math.PI / 4f / (float)howMany)); float iceSpikeScale = 0.1f + Main.rand.NextFloat() * 0.1f + (float)xOffset * 1.1f / (float)howMany; - Projectile.NewProjectile(npc.GetSource_FromAI(), iceSpikeSpawnPos, iceSpikeVelocity, iceSpike, iceSpikeDamage, 0f, Main.myPlayer, 0f, iceSpikeScale); + Projectile.NewProjectile(npc.GetSource_FromAI(), iceSpikeSpawnPos, iceSpikeVelocity, iceSpike, IceSpikeDamage, 0f, Main.myPlayer, 0f, iceSpikeScale); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 7934f5bd09..78436ec1da 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -27,13 +27,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float PhaseTransitionTelegraphTime = 180f; public const float GroundTelegraphStartGateValue = FlightPhaseResetGateValue - PhaseTransitionTelegraphTime; public const float FlightTelegraphStartGateValue = FlightPhaseGateValue - PhaseTransitionTelegraphTime; - private const int OneInXChanceToFireLaser = 200; public const float ProbeLaserGateValue_Mechdusa = 360f; public const float ProbeLaserGateValue_Rev = 240f; public const float ProbeLaserGateValue = 120f; public const float ProbeLaserTelegraphTime = 60f; + // Vanilla values + public static int ProbeLaserDamage = 22; // 88 + + // Rev+ exclusive + public static int LaserDamage = 25; // 100 (buffed); Applies to all Rev+ lasers + public static bool BuffedDestroyerAI(NPC npc, Mod mod) { int mechdusaCurvedSpineSegmentIndex = 0; @@ -120,13 +125,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool increaseSpeed = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles; bool increaseSpeedMore = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; - float enrageScale = 0f; - if (Main.IsItDay()) - { - calamityGlobalNPC.CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 2f; - } - // Phase for flying at the player bool flyAtTarget = (calamityGlobalNPC.newAI[3] >= FlightPhaseGateValue && startFlightPhase) || hasSpawnDR; @@ -177,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; @@ -217,10 +215,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speed += speedBoost; turnSpeed += turnSpeedBoost; - segmentVelocity += 5f * enrageScale; - speed += 0.05f * enrageScale; - turnSpeed += 0.075f * enrageScale; - if (flyAtTarget) { float speedMultiplier = phase5 ? 1.8f : phase4 ? 1.65f : 1.5f; @@ -235,7 +229,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speed *= brokenSegmentAggressionMultiplier; turnSpeed *= brokenSegmentAggressionMultiplier; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity *= 1.2f; speed *= 1.2f; @@ -245,18 +239,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool probeLaunched = npc.ai[2] == 1f; if (npc.type == NPCID.TheDestroyerBody) { - // Enrage, fire more cyan lasers - if (enrageScale > 0f) - { - if (calamityGlobalNPC.newAI[2] < 480f) - calamityGlobalNPC.newAI[2] += 1f; - } - else - { - if (calamityGlobalNPC.newAI[2] > 0f) - calamityGlobalNPC.newAI[2] -= 1f; - } - // Regenerate Probes in Death Mode if the number of Probes is less than 40 and the number of living NPCs is less than the segment count + 40 (this limit is here just in case) if (death && probeLaunched) { @@ -314,7 +296,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[segment].realLife = npc.whoAmI; Main.npc[segment].ai[1] = index; Main.npc[index].ai[0] = segment; - Main.npc[index].Calamity().newAI[0] = -90f - Main.npc[index].ai[0] * (death ? 12f : 3f); // This controls the delay between laser shots + Main.npc[index].Calamity().newAI[0] = -90f - Main.npc[index].ai[0] * (death ? 8f : 3f); // This controls the delay between laser shots NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segment); index = segment; } @@ -363,18 +345,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses type = ModContent.ProjectileType(); break; } - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -385,7 +355,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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) * 100f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 100f, perturbedSpeed, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 1200; } } @@ -426,9 +396,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - if (calamityGlobalNPC.newAI[2] > 0f) - calamityGlobalNPC.destroyerLaserColor = 2; - npc.SyncDestroyerLaserColor(); } @@ -502,24 +469,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Controls the fire rate getting slower as health lowers if (!death) { - if (npc.localAI[3] == 0f && phase2) + if (npc.localAI[3] == 0f && phase3) { npc.localAI[3] = 1f; npc.SyncVanillaLocalAI(); laserShootTimeBonus -= npc.ai[0] * 2f; } - else if (npc.localAI[3] == 1f && phase3) + else if (npc.localAI[3] == 1f && startFlightPhase) { npc.localAI[3] = 2f; npc.SyncVanillaLocalAI(); laserShootTimeBonus -= npc.ai[0] * 2f; } - else if (npc.localAI[3] == 2f && startFlightPhase) - { - npc.localAI[3] = 3f; - npc.SyncVanillaLocalAI(); - laserShootTimeBonus -= npc.ai[0]; - } } calamityGlobalNPC.newAI[0] = laserShootTimeBonus; npc.SyncExtraAI(); @@ -528,8 +489,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { // Laser speed - float projectileSpeed = (death ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f; - projectileSpeed += enrageScale; + float projectileSpeed = death ? 5f : 4f; // Set projectile damage and type int projectileType = ProjectileID.DeathLaser; @@ -552,23 +512,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 100f; - // Shoot projectile - int damage = npc.GetProjectileDamage(projectileType); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 1200; } @@ -736,7 +682,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Despawn - if (player.dead) + if ((player.dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { shouldFly = false; npc.velocity.Y += 2f; @@ -1024,35 +970,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (calamityGlobalNPC.newAI[1] < DRIncreaseTime && ((npc.position - npc.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 0f)) calamityGlobalNPC.newAI[1] += 1f; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (npc.type == NPCID.TheDestroyer) - { - if (npc.velocity.Length() <= minimalContactDamageVelocity) - { - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((npc.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp((float)Math.Round(npc.defDamage * 0.5), npc.defDamage, velocityDamageScalar); - } - } - else - { - float bodyAndTailVelocity = (npc.position - npc.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - npc.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp(0f, npc.defDamage, velocityDamageScalar); - } - } - return false; } @@ -1179,19 +1096,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (targetData.Type != 0 && Collision.CanHit(npc.position, npc.width, npc.height, targetData.Position, targetData.Width, targetData.Height)) { int type = ProjectileID.PinkLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - int totalProjectiles = death ? 3 : 1; Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; if (NPC.IsMechQueenUp) @@ -1214,7 +1118,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } Vector2 laserVelocity = projectileVelocity * velocityMultiplier; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, ProbeLaserDamage.CalculateMechDamage(), 0f, Main.myPlayer); } npc.netUpdate = true; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index ddb1421ec3..a6c99486c7 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -11,6 +11,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class DukeFishronAI { + // Vanilla values + public static float Phase2ContactDamageMult = 1.436f; // 201 + public static float Phase3ContactDamageMult = 1.315f; // 184 + public static bool BuffedDukeFishronAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -29,15 +33,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool charging = npc.ai[3] < 10f; // Adjust stats - int setDamage = npc.defDamage; + npc.damage = npc.defDamage; if (phase3AI) { - setDamage = (int)Math.Round(setDamage * 1.32); + npc.damage = (int)Math.Round(npc.defDamage * Phase3ContactDamageMult); npc.defense = 0; } else if (phase2AI) { - setDamage = (int)Math.Round(setDamage * 1.44); + npc.damage = (int)Math.Round(npc.defDamage * Phase2ContactDamageMult); npc.defense = (int)Math.Round(npc.defDefense * 0.8); } else @@ -57,7 +61,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idlePhaseVelocity = 10f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { idlePhaseAcceleration *= 1.15f; idlePhaseVelocity *= 1.15f; @@ -85,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; @@ -93,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; @@ -111,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; @@ -171,7 +175,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bubbleSpinPhaseDivisor = 1; bubbleSpinBubbleVelocity = 15f; - setDamage *= 2; + npc.damage *= 2; npc.defense = npc.defDefense * 3; } @@ -184,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; @@ -255,7 +259,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn effects if (npc.ai[0] == -1f) { - // Avoid cheap bullshit + // Disable contact damage while spawning npc.damage = 0; // Velocity @@ -313,9 +317,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 1 else if (npc.ai[0] == 0f && !player.dead) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity if (npc.ai[1] == 0f) npc.ai[1] = 300 * Math.Sign((npc.Center - player.Center).X); @@ -340,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]) @@ -431,9 +432,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[0] == 1f) { - // Set damage - npc.damage = setDamage; - // Accelerate npc.velocity *= 1.01f; @@ -464,9 +462,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Bubble belch else if (npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity if (npc.ai[1] == 0f) npc.ai[1] = 300 * Math.Sign((npc.Center - player.Center).X); @@ -512,9 +507,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Sharknado spawn else if (npc.ai[0] == 3f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); @@ -551,9 +543,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Transition to phase 2 else if (npc.ai[0] == 4f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); @@ -576,9 +565,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 2 else if (npc.ai[0] == 5f && !player.dead) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity if (npc.ai[1] == 0f) npc.ai[1] = 300 * Math.Sign((npc.Center - player.Center).X); @@ -603,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]) @@ -701,9 +687,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[0] == 6f) { - // Set damage - npc.damage = setDamage; - // Accelerate npc.velocity *= 1.01f; @@ -734,9 +717,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Bubble spin else if (npc.ai[0] == 7f) { - // Set damage - npc.damage = 0; - // Play sounds and spawn bubbles if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.Zombie20, npc.Center); @@ -750,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; @@ -779,9 +759,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn cthulhunado else if (npc.ai[0] == 8f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); @@ -806,9 +783,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Transition to phase 3 else if (npc.ai[0] == 9f) { - // Avoid cheap bullshit - npc.damage = 0; - // Alpha adjustments if (npc.ai[2] < phaseTransitionTimer - 90) { @@ -851,9 +825,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 3 else if (npc.ai[0] == 10f && !player.dead) { - // Avoid cheap bullshit - npc.damage = 0; - // Alpha if (npc.alpha < 255) { @@ -890,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) @@ -985,9 +956,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[0] == 11f) { - // Set damage - npc.damage = setDamage; - // Accelerate npc.velocity *= 1.01f; @@ -1041,7 +1009,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Pause before teleport else if (npc.ai[0] == 12f) { - // Avoid cheap bullshit + // Disable contact damage during the teleporting phase npc.damage = 0; // Alpha diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 132e76bf5f..7aade7a6d2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -17,46 +17,35 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses private const int TotalDeathModeWorms = 4; public const float DRIncreaseTime = 600f; + // Rev+ exclusive + public static float HeadDamageMult = 1.25f; // 60 (buffed from 48) + public static float BodyDamageMult = 1.5f; // 30 (buffed from 20) + public static float TailDamageMult = 1.5f; // 26 (buffed from 17) + public static int FireballDamage = 12; // 48; Applies to both Cursed Flames and (Death) Shadowflame fireballs + public static bool BuffedEaterofWorldsAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + // Set contact damage + npc.damage = (int)Math.Round(npc.defDamage * (npc.type == NPCID.EaterofWorldsHead ? HeadDamageMult : npc.type == NPCID.EaterofWorldsBody ? BodyDamageMult : TailDamageMult)); + // 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 if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); - bool enrage = !BossRushEvent.BossRushActive; - int targetTileX = (int)Main.player[npc.target].Center.X / 16; - int targetTileY = (int)Main.player[npc.target].Center.Y / 16; - - Tile tile = Framing.GetTileSafely(targetTileX, targetTileY); - if (tile.WallType == WallID.EbonstoneUnsafe) - enrage = false; - - float enrageScale = 0f; - if ((npc.position.Y / 16f) < Main.worldSurface && enrage) - { - calamityGlobalNPC.CurrentlyEnraged = true; - enrageScale += 0.5f; - } - if (!Main.player[npc.target].ZoneCorrupt && enrage) - { - calamityGlobalNPC.CurrentlyEnraged = true; - enrageScale += 2f; - } - // Total body segments float totalSegments = GetEaterOfWorldsSegmentsCountRevDeath(); @@ -77,7 +66,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Boost velocity by 50% phase bool phase4 = lifeRatio < (death ? 0.5f : 0.2f); - // Go fucking crazy in Master Mode + // Go fucking crazy in Death Mode bool phase5 = lifeRatio < 0.1f && death; bool phase6 = lifeRatio < 0.05f && death; @@ -93,7 +82,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; @@ -110,7 +99,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] > vileSpitGateValue - ProjectileTelegraphDuration) { Vector2 dustCenter = vileSpitShootLocation + Main.rand.NextVector2CircularEdge(5f, 5f); - Dust dust = Dust.NewDustDirect(dustCenter, 1, 1, 18, npc.velocity.X * 0.1f, npc.velocity.Y * 0.1f, 80, default, 2f); + Dust dust = Dust.NewDustDirect(dustCenter, 1, 1, DustID.CorruptGibs, npc.velocity.X * 0.1f, npc.velocity.Y * 0.1f, 80, default, 2f); dust.noGravity = true; dust.velocity *= 0.3f; } @@ -121,13 +110,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (phase2) { - float timer = enrageScale > 0f ? 90f : 120f; + float timer = 120f; float shootBoost = lifeRatio * 90f; timer += shootBoost; - if (enrageScale >= 2f) - timer = 60f; - float showTelegraphGateValue = timer - ProjectileTelegraphDuration; if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) @@ -150,21 +136,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(npc.velocity.ToRotation(), MathHelper.PiOver4) == npc.velocity.ToRotation()) { calamityGlobalNPC.newAI[0] = 0f; - Vector2 cursedFlameDirection = npc.Center; - float targetXDirection = Main.player[npc.target].Center.X - cursedFlameDirection.X; - float targetYDirection = Main.player[npc.target].Center.Y - cursedFlameDirection.Y; - float projSpeed = 7f + enrageScale * 2f; - float flameTargetDistance = (float)Math.Sqrt(targetXDirection * targetXDirection + targetYDirection * targetYDirection); - flameTargetDistance = projSpeed / flameTargetDistance; - targetXDirection *= flameTargetDistance; - targetYDirection *= flameTargetDistance; - targetYDirection += npc.velocity.Y * 0.5f; - targetXDirection += npc.velocity.X * 0.5f; - cursedFlameDirection.X -= targetXDirection; - cursedFlameDirection.Y -= targetYDirection; - + Vector2 cursedFlameDirection = Utils.DirectionTo(npc.Center, Main.player[npc.target].Center) * 7f + (npc.velocity * 0.5f); int type = (death && phase3) ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; - Projectile.NewProjectile(npc.GetSource_FromAI(), cursedFlameDirection.X, cursedFlameDirection.Y, targetXDirection, targetYDirection, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + npc.velocity, cursedFlameDirection, type, FireballDamage, 0f, Main.myPlayer); } } @@ -355,10 +329,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!inTiles && npc.type == NPCID.EaterofWorldsHead) { Rectangle rectangle = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - int noFlyZone = death ? (800 - (phase5 ? 400 : 200)) : 900; - noFlyZone -= (int)(enrageScale * 200f); - if (noFlyZone < 100) - noFlyZone = 100; + int noFlyZone = death ? (phase5 ? 400 : 600) : 900; bool freeMoveAnyway = true; for (int k = 0; k < Main.maxPlayers; k++) @@ -379,32 +350,32 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Velocity and acceleration - float velocityScale = (death ? 4.8f : 2.4f) * enrageScale; + float velocityScale = death ? 4.8f : 2.4f; float velocityBoost = velocityScale * (1f - lifeRatio); - float accelerationScale = (death ? 0.06f : 0.03f) * enrageScale; + float accelerationScale = death ? 0.06f : 0.03f; float accelerationBoost = accelerationScale * (1f - lifeRatio); float segmentVelocity = 12f + velocityBoost; float segmentAcceleration = 0.15f + accelerationBoost; if (phase6) { - segmentVelocity += 2.4f * (enrageScale + 1f); - segmentAcceleration += 0.12f * (enrageScale + 1f); + segmentVelocity += 2.4f; + segmentAcceleration += 0.12f; } else if (phase5) { - segmentVelocity += 1.8f * (enrageScale + 1f); - segmentAcceleration += 0.09f * (enrageScale + 1f); + segmentVelocity += 1.8f; + segmentAcceleration += 0.09f; } else if (phase4) { - segmentVelocity += 1.2f * (enrageScale + 1f); - segmentAcceleration += 0.06f * (enrageScale + 1f); + segmentVelocity += 1.2f; + segmentAcceleration += 0.06f; } else if (phase3) { - segmentVelocity += 0.6f * (enrageScale + 1f); - segmentAcceleration += 0.03f * (enrageScale + 1f); + segmentVelocity += 0.6f; + segmentAcceleration += 0.03f; } if (death) @@ -413,7 +384,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses segmentAcceleration += (npc.justHit ? 0.16f : 0.04f); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity += 4f; segmentAcceleration += 0.05f; @@ -450,7 +421,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; @@ -541,13 +512,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses targetPosY *= timeToReachTarget; // Despawn - bool shouldDespawn = npc.type == NPCID.EaterofWorldsHead && Main.player[npc.target].dead; + bool shouldDespawn = npc.type == NPCID.EaterofWorldsHead && (Main.player[npc.target].dead || !Main.player[npc.target].ZoneCorrupt || !Main.player[npc.target].ZoneCrimson) && !BossRushEvent.BossRushActive; if (shouldDespawn) { bool everyoneDead = true; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player p in Main.ActivePlayers) { - if (Main.player[i].active && !Main.player[i].dead) + if (!p.dead && p.ZoneCorrupt) { everyoneDead = false; break; @@ -568,13 +539,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.life = 0; if (Main.dedServ) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segmentAmt, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segmentAmt); segmentAmt = attachedSegments; } if (Main.dedServ) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } targetPosX = 0f; targetPosY = segmentVelocity; @@ -653,7 +624,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float pushDistanceLowerLimit = 14f - numHeads; float pushDistanceUpperLimit = 140f - numHeads * 10f; float pushDistance = MathHelper.Lerp(pushDistanceLowerLimit, pushDistanceUpperLimit, 1f - lifeRatio) * npc.scale; - float pushVelocity = 0.25f + enrageScale * 0.125f; + float pushVelocity = 0.25f; for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active) @@ -705,38 +676,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (calamityGlobalNPC.newAI[1] < DRIncreaseTime && ((npc.position - npc.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 0f)) calamityGlobalNPC.newAI[1] += 1f; - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float minimalContactDamageHeadVelocity = segmentVelocity * 0.25f; - float minimalDamageHeadVelocity = segmentVelocity * 0.5f; - float minimalContactDamageBodyVelocity = segmentVelocity * 0.4f; - float minimalDamageBodyVelocity = segmentVelocity * 0.8f; - if (npc.type == NPCID.EaterofWorldsHead) - { - if (npc.velocity.Length() <= minimalContactDamageHeadVelocity) - { - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((npc.velocity.Length() - minimalContactDamageHeadVelocity) / minimalDamageHeadVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp((float)Math.Round(npc.defDamage * 0.5), npc.defDamage, velocityDamageScalar); - } - } - else - { - float bodyAndTailVelocity = (npc.position - npc.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageBodyVelocity) - { - npc.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageBodyVelocity) / minimalDamageBodyVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp(0f, npc.defDamage, velocityDamageScalar); - } - } - if (npc.type == NPCID.EaterofWorldsHead || (npc.type != NPCID.EaterofWorldsHead && Main.npc[(int)npc.ai[1]].alpha >= 85)) { if (npc.alpha > 0 && npc.life > 0) @@ -774,7 +713,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 ef21e65935..5a5ab61042 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -12,6 +12,27 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class EmpressofLightAI { + // NOTE: This is applied to all difficulties, in CalamityPlayerHitHurt + public static float EverlastingRainbowTrailDamageMult = 0.75f; + + // Vanilla values + public static float DashDamageMult = 1.5f; // 165 + public static int PrismaticBoltDamage = 30; // 120 + public static int EverlastingRainbowDamage = 30; // 120 + public static int EtherealLanceDamage = 30; // 120 + public static int SunDanceDamage = 35; // 140 + public static int Phase2PrismaticBoltDamage = 35; // 140 + public static int Phase2EverlastingRainbowDamage = 35; // 140 + public static int Phase2EtherealLanceDamage = 35; // 140 + public static int Phase2SunDanceDamage = 40; // 160 + + // Vanilla sets her defDamage to 184 (80 * 2 * 1.15) in Expert Mode + // However, some weird contraption in her Expert AI that knocks her base contact damage to the intended value of 110 + // This hasn't been found anywhere so our solution for now is avoid using defDamage altogether + public static int ContactDamageCorrection = Main.masterMode ? 248 : 110; + + public static int CalculateDamageForEnrage(this int damage) => NPC.ShouldEmpressBeEnraged() ? damage * 2 : damage; + public static bool BuffedEmpressofLightAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -33,6 +54,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool phase2 = npc.AI_120_HallowBoss_IsInPhase2(); bool phase3 = lifeRatio <= phase3LifeRatio; + int boltDamage = (phase2 ? Phase2PrismaticBoltDamage : PrismaticBoltDamage).CalculateDamageForEnrage(); + int rainbowDamage = (phase2 ? Phase2EverlastingRainbowDamage : EverlastingRainbowDamage).CalculateDamageForEnrage(); + int lanceDamage = (phase2 ? Phase2EtherealLanceDamage : EtherealLanceDamage).CalculateDamageForEnrage(); + int sunDanceDamage = (phase2 ? Phase2SunDanceDamage : SunDanceDamage).CalculateDamageForEnrage(); + bool shouldBeInPhase2ButIsStillInPhase1 = lifeRatio <= phase2LifeRatio && !phase2; if (shouldBeInPhase2ButIsStillInPhase1) calamityGlobalNPC.DR = 0.99f; @@ -45,8 +71,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && dayTimeEnrage; - int projectileDamageMultiplier = dayTimeEnrage ? 2 : 1; - Vector2 rainbowStreakDistance = new Vector2(-250f, -350f); Vector2 everlastingRainbowDistance = new Vector2(0f, -450f); Vector2 etherealLanceDistance = new Vector2(0f, -450f); @@ -72,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; @@ -150,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; @@ -398,14 +422,14 @@ 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; if ((int)npc.ai[1] % streakSpawnFrequency == 0 && npc.ai[1] < 60f) { int projectileType = ProjectileID.HallowBossRainbowStreak; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = boltDamage; float ai3 = npc.ai[1] / 60f; Vector2 rainbowStreakVelocity = new Vector2(0f, death ? -10f : -8f).RotatedBy(MathHelper.PiOver2 * Main.rand.NextFloatDirection()); @@ -417,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); } } @@ -539,7 +552,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int projectileType = ProjectileID.FairyQueenLance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = lanceDamage; Vector2 v3 = targetHoverPos - spawnLocation; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -613,15 +626,15 @@ 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) { int projectileType = ProjectileID.HallowBossLastingRainbow; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = rainbowDamage; int projectileType2 = ProjectileID.HallowBossRainbowStreak; - int projectileDamage2 = npc.GetProjectileDamage(projectileType2) * projectileDamageMultiplier; + int projectileDamage2 = boltDamage; float projRotationMultiplier = i; Vector2 spinningpoint = Vector2.UnitY.RotatedBy(MathHelper.PiOver2 + MathHelper.TwoPi * projRotationMultiplier + projRotation); @@ -629,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 @@ -692,7 +705,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] % sunDanceGateValue == 0f && npc.ai[1] < totalSunDancePhaseTime) { int projectileType = ProjectileID.FairyQueenSunDance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = sunDanceDamage; int sunDanceExtension = (int)(npc.ai[1] / sunDanceGateValue); int targetFloatDirection = (targetData2.Center.X > npc.Center.X) ? 1 : 0; @@ -812,7 +825,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int projectileType = ProjectileID.FairyQueenLance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = lanceDamage; for (float i = 0f; i <= 1f; i += 1f / totalProjectiles) { @@ -894,7 +907,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((npc.ai[1] - 1f) % rainbowStreakGateValue == 0f) { int projectileType = ProjectileID.HallowBossRainbowStreak; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = boltDamage; float ai3 = (npc.ai[1] - chargeGateValue - 1f) / chargeDuration; Vector2 rainbowStreakVelocity = new Vector2(0f, death ? -5f : -4f).RotatedBy(MathHelper.PiOver2 * Main.rand.NextFloatDirection()); @@ -911,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. @@ -935,7 +945,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == chargeGateValue + chargeDuration) npc.velocity *= 0.45f; - npc.damage = (int)Math.Round(npc.defDamage * (dayTimeEnrage ? 3D : 1.5)); + // Unlike other temporary damage boosts from bosses, vanilla Empress AI increases damage as defDamage while dashing, so we don't need to account for it + npc.damage = (int)Math.Round(ContactDamageCorrection.CalculateDamageForEnrage() * DashDamageMult); } else { @@ -1064,7 +1075,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int projectileType = ProjectileID.FairyQueenLance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = lanceDamage; Vector2 v = straightLanceSpawnPredict - straightLanceSpawnDirection; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -1141,27 +1152,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((int)npc.ai[1] % stationaryStreakSpawnFrequency == 0 && shouldSpawnStreaks) { int projectileType = ProjectileID.HallowBossRainbowStreak; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = boltDamage; 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 2b50234d9d..a5cd8b3f9e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -14,6 +14,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { private const float ProjectileOffset = 50f; + // Rev+ exclusive + public static float Phase1ContactDamageMult = 1.333f; // 40 (buffed from 30) + public static float Phase2ContactDamageMult = 1.6f; // 48 (buffed from 36) + public static float Phase3ContactDamageMult = 1.8f; // 54 (buffed from 40) + public static int BloodShotDamage = 8; // 32 + public static bool BuffedEyeofCthulhuAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -39,16 +45,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lineUpDist = death ? 15f : 20f; + // Set contact damage + npc.damage = (int)Math.Round(npc.defDamage * (phase3 ? Phase3ContactDamageMult : phase2 ? Phase2ContactDamageMult : Phase1ContactDamageMult)); + // Servant and projectile velocity, the projectile velocity is multiplied by 2 float servantAndProjectileVelocity = death ? 10f : 6f; - - float enrageScale = death ? 0.5f : 0f; - if (Main.IsItDay()) - { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 2f; - } - npc.reflectsProjectiles = false; // Get a target @@ -117,33 +118,23 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool charge = Vector2.Distance(Main.player[npc.target].Center, npc.Center) >= 320f; // 20 tile distance - if (dead) + if ((dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) npc.timeLeft = 10; + return false; } else if (npc.ai[0] == 0f) { if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; + float hoverSpeed = death ? 9.5f + 7f * (1f - lifeRatio) : 7f; + float hoverAcceleration = death ? 0.2f + 0.15f * (1f - lifeRatio) : 0.15f; - float hoverSpeed = 7f; - float hoverAcceleration = 0.15f; - hoverSpeed += 5f * enrageScale; - hoverAcceleration += 0.1f * enrageScale; - - if (death) - { - hoverSpeed += 7f * (1f - lifeRatio); - hoverAcceleration += 0.15f * (1f - lifeRatio); - } - - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed += 3f; hoverAcceleration += 0.08f; @@ -172,7 +163,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) @@ -191,7 +182,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (spawnServant) { - int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, enrageScale); + int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu); Main.npc[eye].velocity = servantSpawnVelocity; if (Main.dedServ && eye < Main.maxNPCs) @@ -200,8 +191,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { int projType = ProjectileID.BloodNautilusShot; - int projDamage = npc.GetProjectileDamage(projType); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, projDamage, 0f, Main.myPlayer); + 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; } } @@ -216,16 +206,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - npc.rotation = eyeRotation; float additionalVelocityPerCharge = 2f; - float chargeSpeed = 8f + npc.ai[3] * additionalVelocityPerCharge; - chargeSpeed += 5f * enrageScale; + 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; @@ -235,11 +221,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = npc.defDamage; - 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); @@ -247,15 +230,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; if (npc.ai[2] >= slowDownGateValue) { - // Avoid cheap bullshit - npc.damage = 0; - float decelerationScalar = death ? ((lifeRatio - phase2LifeRatio) / (1f - phase2LifeRatio)) : 1f; if (decelerationScalar < 0f) 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) @@ -275,9 +255,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float numCharges = death ? 4f : 3f; if (npc.ai[3] >= numCharges) { - // Avoid cheap bullshit - npc.damage = 0; - npc.ai[1] = 0f; npc.ai[3] = 0f; } @@ -288,9 +265,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase2) { - // Avoid cheap bullshit - npc.damage = 0; - npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -303,10 +277,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.reflectsProjectiles = true; if (npc.ai[0] == 1f) @@ -325,39 +296,24 @@ 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; if (Main.netMode != NetmodeID.MultiplayerClient) { - int servantSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, enrageScale); + int servantSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu); Main.npc[servantSpawn].velocity.X = servantSpawnVelocity.X; Main.npc[servantSpawn].velocity.Y = servantSpawnVelocity.Y; 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++) @@ -406,27 +362,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { npc.defense = 0; - int setDamage = (int)Math.Round(npc.defDamage * (phase3 ? 1.4 : 1.2)); - int reducedSetDamage = (int)Math.Round(setDamage * 0.5); if (npc.ai[1] == 0f & phase3) npc.ai[1] = 5f; if (npc.ai[1] == 0f) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - - float hoverSpeed = 5.5f + 3f * (phase2LifeRatio - lifeRatio); - float hoverAcceleration = 0.06f + 0.02f * (phase2LifeRatio - lifeRatio); - hoverSpeed += 4f * enrageScale; - hoverAcceleration += 0.04f * enrageScale; - - if (death) - { - hoverSpeed += 5.5f * (phase2LifeRatio - lifeRatio); - hoverAcceleration += 0.06f * (phase2LifeRatio - lifeRatio); - } + float hoverSpeed = (death ? 7.5f : 5.5f) + (death ? 8.5f : 3f) * (phase2LifeRatio - lifeRatio); + float hoverAcceleration = (death ? 0.08f : 0.06f) + (death ? 0.08f : 0.02f) * (phase2LifeRatio - lifeRatio); Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 400f; float distanceFromHoverDestination = npc.Distance(hoverDestination); @@ -447,7 +390,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed += 1f; hoverAcceleration += 0.1f; @@ -470,14 +413,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.BloodNautilusShot; - int damage = npc.GetProjectileDamage(type); int numProj = 3; int spread = 10; 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, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; } } @@ -495,22 +437,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = setDamage; - SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); npc.rotation = eyeRotation; float additionalVelocityPerCharge = 3f; - float chargeSpeed = 10f + (3.5f * (phase2LifeRatio - lifeRatio)) + npc.ai[3] * additionalVelocityPerCharge; - chargeSpeed += 4f * enrageScale; - if (death) - chargeSpeed += 6.5f * (phase2LifeRatio - lifeRatio); + float chargeSpeed = (death ? 12f : 10f) + ((death ? 10f : 3.5f) * (phase2LifeRatio - lifeRatio)) + npc.ai[3] * additionalVelocityPerCharge; if (npc.ai[3] == 1f) 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; @@ -520,9 +456,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = setDamage; - int phase2ChargeDelay = death ? (70 - (int)Math.Round(25f * (phase2LifeRatio - lifeRatio))) : 85; float slowDownGateValue = phase2ChargeDelay * (death ? 0.9f : 0.75f); @@ -530,9 +463,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; if (npc.ai[2] >= slowDownGateValue) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - float decelerationScalar = death ? ((lifeRatio - phase3LifeRatio) / (phase2LifeRatio - phase3LifeRatio)) : 1f; if (decelerationScalar < 0f) decelerationScalar = 0f; @@ -555,9 +485,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float numCharges = death ? 4f : 3f; if (npc.ai[3] >= numCharges) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.ai[1] = 0f; npc.ai[3] = 0f; npc.ForceNetUpdate(false); @@ -571,9 +498,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if ((npc.ai[3] == 4f & phase3) && npc.Center.Y > Main.player[npc.target].Center.Y) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -581,12 +505,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (Main.netMode != NetmodeID.MultiplayerClient) { - // Set damage - npc.damage = setDamage; - float speedBoost = death ? 10f * (phase3LifeRatio - lifeRatio) : 7f * (phase3LifeRatio - lifeRatio); - float finalChargeSpeed = 18f + speedBoost; - finalChargeSpeed += 10f * enrageScale; + float finalChargeSpeed = (death ? 23f : 18f) + speedBoost; Vector2 eyeChargeDirection = npc.Center; float targetX = Main.player[npc.target].Center.X - eyeChargeDirection.X; @@ -652,9 +572,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 4f) { - // Set damage - npc.damage = setDamage; - if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.ForceRoarPitched, npc.Center); @@ -666,9 +583,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] >= lineUpDistControl) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.velocity *= 0.95f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -689,9 +603,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxCharges = death ? (finalPhaseDeath ? 0f : penultimatePhaseDeath ? 1f : 2f) : finalPhaseRev ? 2f : 3f; if (npc.ai[3] >= maxCharges) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.ai[1] = 0f; npc.ai[3] = 0f; } @@ -702,14 +613,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 5f) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - float offset = death ? 540f : 600f; float speedBoost = death ? 15f * (phase3LifeRatio - lifeRatio) : 5f * (phase3LifeRatio - lifeRatio); float accelerationBoost = death ? 0.425f * (phase3LifeRatio - lifeRatio) : 0.125f * (phase3LifeRatio - lifeRatio); - float hoverSpeed = 8f + speedBoost; - float hoverAcceleration = 0.25f + accelerationBoost; + float hoverSpeed = (death ? 10f : 8f) + speedBoost; + float hoverAcceleration = (death ? 0.3125f : 0.25f) + accelerationBoost; bool horizontalCharge = calamityGlobalNPC.newAI[0] == 1f || calamityGlobalNPC.newAI[0] == 3f; float timeGateValue = horizontalCharge ? (110f - (death ? 60f * (phase3LifeRatio - lifeRatio) : 0f)) : (95f - (death ? 55f * (phase3LifeRatio - lifeRatio) : 0f)); @@ -720,9 +628,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses hoverAcceleration += velocityScalar * 0.0025f; } - hoverSpeed += enrageScale * 4f; - hoverAcceleration += enrageScale * 0.125f; - Vector2 eyeLineUpChargeDirection = npc.Center; float lineUpChargeTargetX = Main.player[npc.target].Center.X - eyeLineUpChargeDirection.X; float lineUpChargeTargetY = Main.player[npc.target].Center.Y + offset - eyeLineUpChargeDirection.Y; @@ -749,7 +654,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 servantSpawnVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * servantAndProjectileVelocity; Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset; - float enrageScaleToPass = enrageScale; int maxServants = death ? (finalPhaseDeath ? 1 : penultimatePhaseDeath ? 2 : 3) : (finalPhaseRev ? 2 : 4); bool spawnServant = NPC.CountNPCS(NPCID.ServantofCthulhu) < maxServants; @@ -765,22 +669,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (spawnServant) { - int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, enrageScaleToPass); + int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu); Main.npc[eye].velocity.X = servantSpawnVelocity.X; Main.npc[eye].velocity.Y = servantSpawnVelocity.Y; 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 projDamage = npc.GetProjectileDamage(projType); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, projDamage, 0f, Main.myPlayer); + 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; @@ -839,14 +742,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 6f) { - // Set damage - npc.damage = setDamage; - if (Main.netMode != NetmodeID.MultiplayerClient) { float speedBoost = death ? 15f * (phase3LifeRatio - lifeRatio) : 5f * (phase3LifeRatio - lifeRatio); - float chargeSpeed = 18f + speedBoost; - chargeSpeed += 10f * enrageScale; + float chargeSpeed = (death ? 23f : 18f) + speedBoost; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; npc.ai[1] = 7f; @@ -856,9 +755,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 7f) { - // Set damage - npc.damage = setDamage; - if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); @@ -870,9 +766,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] >= lineUpDistControl) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.velocity *= 0.95f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -885,8 +778,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lineUpDistNetUpdate = lineUpDistControl + 13f; if (npc.ai[2] >= lineUpDistNetUpdate) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; npc.ForceNetUpdate(false); npc.ai[2] = 0f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index 424374536f..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; @@ -11,6 +13,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class GolemAI { + // Rev+ exclusive + public static int FireballDamage = 24; // 96 (modified to be always at maximum Expert damage and does not scale) + public static int LaserDamage = 29; // 116 (modified to be always at maximum Expert damage and does not scale) + public static int InfernoBoltDamage = 35; // 140 + public static bool BuffedGolemAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -57,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); @@ -83,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++) { @@ -109,7 +113,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Spawn arm dust - if (!CalamityWorld.LegendaryMode) + if (!Main.getGoodWorld) { if (!leftFistAlive) { @@ -171,50 +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; - int damage = npc.GetProjectileDamage(type); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, type, damage, 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) { @@ -224,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) @@ -238,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; @@ -256,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; @@ -426,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; @@ -435,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; @@ -447,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; + } } } @@ -490,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++) { @@ -519,12 +398,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses projectileVelocity *= 1.25f; int type = ProjectileID.Fireball; - int damage = npc.GetProjectileDamage(type); + int damage = FireballDamage; Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center; 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++) { @@ -533,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; } } @@ -548,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 = npc.GetProjectileDamage(type); - 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; @@ -708,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; @@ -798,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; @@ -839,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++) { @@ -983,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; @@ -1000,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 @@ -1044,7 +882,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headFireballTargetY *= headFireballTargetDist; int type = ProjectileID.Fireball; - int damage = npc.GetProjectileDamage(type); + int damage = FireballDamage; int fireballAmount = death ? 2 : 1; Vector2 fireballVelocity = new Vector2(headFireballTargetX, headFireballTargetY); @@ -1073,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 @@ -1096,21 +946,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses fireballFistsDedTargetY *= fireballFistsDedTargetDist; int type = ProjectileID.Fireball; - int damage = npc.GetProjectileDamage(type); + 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; @@ -1120,7 +970,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; int projType = ProjectileID.EyeBeam; - int dmg = npc.GetProjectileDamage(projType); + int dmg = LaserDamage; if (npc.localAI[1] == 0f) { @@ -1146,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; @@ -1175,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; @@ -1184,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; } @@ -1211,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(); @@ -1222,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; @@ -1243,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]; @@ -1350,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 = npc.GetProjectileDamage(projectileType); - 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 = npc.GetProjectileDamage(type); + 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 c97b951193..d9d895141c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -15,6 +15,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static readonly SoundStyle SpawnCrystalSound = new SoundStyle("CalamityMod/Sounds/Custom/KingSlimeJewelSpawn"); + // Death exclusive + public static float SapphireJewelContactDamageMult = 1.5f; // 144 + public static bool BuffedKingSlimeAI(NPC npc, Mod mod) { // Percent life remaining @@ -27,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; @@ -74,7 +77,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.defense = npc.defDefense; if (blueCrystalAlive) { - setDamage = (int)Math.Round(setDamage * 1.5); + setDamage = (int)Math.Round(setDamage * SapphireJewelContactDamageMult); npc.defense *= 2; } @@ -316,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) @@ -398,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) @@ -510,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)) @@ -548,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; @@ -636,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 e98a738be2..f6c6d16f79 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs @@ -17,6 +17,20 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static readonly SoundStyle DeathrayChargeSound = new("CalamityMod/Sounds/Custom/MoonLordLaserCharge"); + // Vanilla values + public static int BoltDamage = 30; // 120 + public static int EyeDamage = 30; // 120 + public static int SphereDamage = 40; // 160 + public static int DeathrayDamage = 75; // 300 + + public static int TrueEyeBoltDamage = 35; // 140 + public static int TrueEyeEyeDamage = 35; // 140 + public static int TrueEyeDeathrayDamage = 50; // 200 + public static int TrueEyeSphereDamage = 55; // 220 + + // Vanilla values (GFB) + public static int MoonBoulderDamage = 70; // 280 + public static bool BuffedMoonLordAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -44,7 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) aggressionLevel = 6; if (npc.type == NPCID.MoonLordCore) @@ -769,7 +783,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (attackTimer == 180f && Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ProjectileID.PhantasmalDeathray; - int damage = npc.GetProjectileDamage(projectileType); npc.TargetClosest(false); Vector2 deathrayRotationSpeed = Main.player[npc.target].Center - npc.Center; @@ -780,7 +793,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deathrayRotationDirection = 1f; deathrayRotationSpeed = deathrayRotationSpeed.RotatedBy(-(double)deathrayRotationDirection * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayRotationSpeed.X, deathrayRotationSpeed.Y, projectileType, damage, 0f, Main.myPlayer, deathrayRotationDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayRotationSpeed.X, deathrayRotationSpeed.Y, projectileType, DeathrayDamage, 0f, Main.myPlayer, deathrayRotationDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); npc.ai[2] = (deathrayRotationSpeed.ToRotation() + MathHelper.Pi + MathHelper.TwoPi) * deathrayRotationDirection; npc.netUpdate = true; } @@ -807,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++) { @@ -929,8 +942,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 boltVelocity = Vector2.Normalize(v4) * velocity; int type = ProjectileID.PhantasmalBolt; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltDirection.X, npc.Center.Y + boltDirection.Y, boltVelocity.X, boltVelocity.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltDirection.X, npc.Center.Y + boltDirection.Y, boltVelocity.X, boltVelocity.Y, type, BoltDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1162,10 +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 damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), handAttackMovement, handAttackDirection, type, damage, 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 @@ -1287,8 +1297,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sphereFireDirection.Y += (finalSphereHandSpeed - 4.5f) * 1f; sphereFireDirection *= 1.2f; int type = ProjectileID.PhantasmalSphere; - int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, sphereFireDirection.X, sphereFireDirection.Y, type, damage, 1f, Main.myPlayer, 0f, npc.whoAmI); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, sphereFireDirection.X, sphereFireDirection.Y, type, SphereDamage, 1f, Main.myPlayer, 0f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; } @@ -1529,8 +1538,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 boltShootSpeed = Vector2.Normalize(v) * velocity; int type = ProjectileID.PhantasmalBolt; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltShootDirection.X, npc.Center.Y + boltShootDirection.Y, boltShootSpeed.X, boltShootSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltShootDirection.X, npc.Center.Y + boltShootDirection.Y, boltShootSpeed.X, boltShootSpeed.Y, type, BoltDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1775,14 +1783,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocity = death ? 9f : 8f; Vector2 freeEyeBoltVel = Vector2.Normalize(v8) * velocity; int type = ProjectileID.PhantasmalBolt; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + freeEyeBoltDirection.X, npc.Center.Y + freeEyeBoltDirection.Y, freeEyeBoltVel.X, freeEyeBoltVel.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + freeEyeBoltDirection.X, npc.Center.Y + freeEyeBoltDirection.Y, freeEyeBoltVel.X, freeEyeBoltVel.Y, type, TrueEyeBoltDamage, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[0] == 2f || npc.ai[0] == 4f) { int type = ProjectileID.PhantasmalSphere; - int damage = npc.GetProjectileDamage(type); if (secondAttackTimer < 15f) { @@ -1857,12 +1863,12 @@ 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++) { if (!WorldGen.SolidTile((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f))) - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, (float)Main.rand.Next(-1599, 1600) * 0.01f, (float)Main.rand.Next(-1599, 1) * 0.01f, ProjectileID.MoonBoulder, 70, 10f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, (float)Main.rand.Next(-1599, 1600) * 0.01f, (float)Main.rand.Next(-1599, 1) * 0.01f, ProjectileID.MoonBoulder, MoonBoulderDamage, 10f); } } } @@ -1918,7 +1924,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (trueEyeSphereProj.type == type && trueEyeSphereProj.ai[1] == npc.whoAmI && trueEyeSphereProj.ai[0] != -1f) { trueEyeSphereProj.ai[0] = -1f; - trueEyeSphereProj.damage = damage; + trueEyeSphereProj.damage = TrueEyeSphereDamage; trueEyeSphereProj.velocity = trueEyeSphereVelocity; trueEyeSphereProj.netUpdate = true; } @@ -1997,8 +2003,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 trueEyeEyeSpeed = Vector2.Normalize(trueEyeDirection) * velocity; float ai3 = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * npc.ai[2]; int type = ProjectileID.PhantasmalEye; - int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), trueEyeEyeDirection, trueEyeEyeSpeed, type, damage, 0f, Main.myPlayer, 0f, ai3); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), trueEyeEyeDirection, trueEyeEyeSpeed, type, TrueEyeEyeDamage, 0f, Main.myPlayer, 0f, ai3); Main.projectile[proj].timeLeft = 1200; } } @@ -2070,8 +2075,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deathrayTargetDist = deathrayTargetDist.RotatedBy(-(double)deathraySweepDirection * MathHelper.TwoPi / 6f); int type = ProjectileID.PhantasmalDeathray; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayTargetDist.X, deathrayTargetDist.Y, type, damage, 0f, Main.myPlayer, deathraySweepDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayTargetDist.X, deathrayTargetDist.Y, type, TrueEyeDeathrayDamage, 0f, Main.myPlayer, deathraySweepDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); npc.ai[2] = (deathrayTargetDist.ToRotation() + MathHelper.Pi + MathHelper.TwoPi) * deathraySweepDirection; npc.netUpdate = true; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index 2fc7601040..8093a7ec60 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -27,6 +27,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float StopChargeGateValue = BeginChargeSlowDownGateValue - 30f; public const float MovementVelocityMultiplierForSlowAttacks = 0.5f; + // Vanilla values + public static float Phase2ContactDamageMult = 1.4f; // 140 + public static int PinkSeedDamage = 19; // 76 + public static int PoisonSeedDamage = 24; // 96 + public static int ThornBallDamage = 27; // 108 + + // Expert AI has uses a magic number which we have to correct for + public static int ContactDamageCorrection = Main.masterMode ? 150 : 100; + + // Rev+ exclusive + public static int ThornBallSpikeDamage = 22; // 88 + public static int GasBulbDamage = 27; // 108 + public static int PinkCloudDamage = 22; // 88 + public static int GreenCloudDamage = 24; // 96 + public static float DashDamageMult = 1.25f; // 175 + public static bool BuffedPlanteraAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -50,12 +66,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool vomitFreeTentacles = lifeRatio < 0.25f && death; bool phase4 = lifeRatio < 0.2f; - // Contact damage values for phase 2 - int setDamage = (int)Math.Round(npc.defDamage * 1.4); - int reducedSetDamage = (int)Math.Round(setDamage * 0.5); + npc.damage = (int)Math.Round(ContactDamageCorrection * (phase2 ? Phase2ContactDamageMult : 1f)); // Variables and target - bool enrage = !BossRushEvent.BossRushActive; + bool enrage = false; bool despawn = false; // Check for Jungle @@ -172,7 +186,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -213,7 +227,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shootPoisonSeed = npc.ai[1] % 9f == 0f && !shootThornBall; float projectileSpeed = 14f; int projectileType = shootThornBall ? ProjectileID.ThornBall : shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera; - int damage = npc.GetProjectileDamage(projectileType); + int damage = shootThornBall ? ThornBallDamage : shootPoisonSeed ? PoisonSeedDamage : PinkSeedDamage; Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); Vector2 spawnOffset = npc.Center + projectileVelocity * 70f; @@ -301,8 +315,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = death ? 36 : 30; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - 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++) { @@ -320,7 +333,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float ai0 = Main.rand.Next(3); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * randomSpeed, type, damage, 0f, Main.myPlayer, ai0); + Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * randomSpeed, type, GreenCloudDamage, 0f, Main.myPlayer, ai0); } } @@ -367,7 +380,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileSpeed = 9f; int projectileType = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(projectileType); Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); Vector2 spawnOffset = npc.Center + projectileVelocity * 70f; @@ -381,7 +393,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * projectileSpeed, projectileType, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * projectileSpeed, projectileType, GasBulbDamage, 0f, Main.myPlayer); } } @@ -390,9 +402,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Slow down and return to normal behavior if (npc.ai[3] <= BeginChargeSlowDownGateValue) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - npc.velocity *= chargeDeceleration; float timeToDecelerateDecrement = phase4 ? 1.5f : 1f; npc.ai[3] -= timeToDecelerateDecrement; @@ -427,14 +436,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Emit spore gas in phase 3 else if (npc.ai[3] <= BeginChargeGateValue) { - // Set damage - npc.damage = setDamage; - + npc.damage = (int)Math.Round(ContactDamageCorrection * Phase2ContactDamageMult * DashDamageMult); float sporeGasDashGateValue = death ? 6f : 9f; if (phase3 && npc.ai[3] % sporeGasDashGateValue == 0f) { int projectileType = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(projectileType); float randomVelocityMultiplier = secondCharge ? 0.05f : death ? 0.3f : 0.2f; Vector2 projectileVelocity = npc.velocity * Main.rand.NextVector2CircularEdge(randomVelocityMultiplier, randomVelocityMultiplier); Vector2 spawnOffset = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 30f; @@ -449,7 +455,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float ai0 = Main.rand.Next(3); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, ai0); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity, projectileType, GasBulbDamage, 0f, Main.myPlayer, ai0); } npc.ai[3] -= 1f; @@ -460,9 +466,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Move a specified distance away from the target and charge once that distance is reached else { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - // Line up before charging if (npc.Calamity().newAI[0] == 0f) { @@ -502,9 +505,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] -= timeToLineUpChargeDecrement; if (npc.ai[3] <= BeginChargeGateValue) { - // Set damage - npc.damage = setDamage; - // Charge npc.ai[3] = BeginChargeGateValue; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; @@ -522,8 +522,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = secondCharge ? 6 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - 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++) { @@ -541,7 +540,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float ai0 = Main.rand.Next(3); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity * randomSpeed, type, damage, 0f, Main.myPlayer, ai0); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity * randomSpeed, type, GasBulbDamage, 0f, Main.myPlayer, ai0); } } @@ -553,9 +552,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - // Avoid cheap bullshit - npc.damage = phase2 ? reducedSetDamage : 0; - // Velocity ranges from 4 to 7.2, Acceleration ranges from 0.04 to 0.072, non-enraged phase 1 // Velocity ranges from 7 to 12.6, Acceleration ranges from 0.07 to 0.126, non-enraged phase 2 // Velocity ranges from 9 to 16.2, Acceleration ranges from 0.07 to 0.126, non-enraged phase 3 @@ -648,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; @@ -675,10 +671,10 @@ 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 = npc.GetProjectileDamage(projectileType); + int damage = shootThornBall ? ThornBallDamage : shootPoisonSeed ? PoisonSeedDamage : PinkSeedDamage; Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); Vector2 spawnOffset = npc.Center + projectileVelocity * 70f; @@ -728,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) { @@ -803,7 +797,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses numProj++; int type = ProjectileID.PoisonSeedPlantera; - int damage = npc.GetProjectileDamage(type); + int damage = PoisonSeedDamage; float rotation = MathHelper.ToRadians(spread); bool vomitTentacles = vomitFreeTentacles && NPC.CountNPCS(ModContent.NPCType()) < maxTentaclesAfterFirstTentaclePhase; if (vomitTentacles) @@ -815,7 +809,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (shootPinkSeed) { type = ProjectileID.SeedPlantera; - damage = npc.GetProjectileDamage(type); + damage = PinkSeedDamage; } else type = ProjectileID.PoisonSeedPlantera; @@ -867,7 +861,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (shootThornBall) { type = ProjectileID.ThornBall; - damage = npc.GetProjectileDamage(type); + damage = ThornBallDamage; Vector2 spawnOffset = npc.Center + projectileVelocity * 50f; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -1092,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); @@ -1103,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; @@ -1137,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; @@ -1173,8 +1167,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float extendTime = 180f; if (planteraIsCharging) { - npc.damage = 0; - if (npc.localAI[0] > 0f) { npc.localAI[0] = 0f; @@ -1183,7 +1175,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.localAI[0] < extendTime) { - npc.damage = npc.defDamage; npc.localAI[0] += 1f; if (npc.localAI[0] >= extendTime) npc.SyncExtraAI(); @@ -1215,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 14880299e8..b695a3093d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -15,6 +15,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class QueenBeeAI { + // Vanilla values + public static int StingerDamage = 11; // 44; Also applies to GFB stinger replacements + + // Death exclusive + public static int BeenadeDamage = 15; // 90 + public static int BeenadeBeeDamage = 12; // 72 + public static bool BuffedQueenBeeAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -38,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; @@ -741,7 +748,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 stingerVelocity = new Vector2(stingerTargetX, stingerTargetY); int type = Main.zenithWorld ? (phase3 ? ModContent.ProjectileType() : ProjectileID.FlamingWood) : ProjectileID.QueenBeeStinger; - int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation, stingerVelocity, type, Main.zenithWorld ? 25 : npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); + int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation, stingerVelocity, type, StingerDamage, 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); Main.projectile[projectile].timeLeft = 1200; Main.projectile[projectile].extraUpdates = 1; @@ -750,7 +757,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int numExtraStingers = death ? (phase6 ? 4 : 2) : (phase6 ? 2 : 1); for (int i = 0; i < numExtraStingers; i++) { - projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + Main.rand.NextVector2CircularEdge(16f, 16f) * (i + 1), stingerVelocity * MathHelper.Lerp(0.75f, 1f, i / (float)numExtraStingers), type, Main.zenithWorld ? 25 : npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); + projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + Main.rand.NextVector2CircularEdge(16f, 16f) * (i + 1), stingerVelocity * MathHelper.Lerp(0.75f, 1f, i / (float)numExtraStingers), type, StingerDamage, 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); Main.projectile[projectile].timeLeft = 1200; Main.projectile[projectile].extraUpdates = 1; } @@ -873,7 +880,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (i % 2f != 0f) perturbedSpeed *= 0.8f; - int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, Main.zenithWorld ? 25 : npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, Main.player[npc.target].position.Y); + int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, StingerDamage, 0f, Main.myPlayer, 0f, Main.player[npc.target].position.Y); Main.projectile[projectile].timeLeft = 1200; Main.projectile[projectile].extraUpdates = 1; @@ -944,9 +951,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 beenadeSpawnLocation = npc.Center + new Vector2(20f * npc.direction, -40f); SoundEngine.PlaySound(SoundID.Item76, beenadeSpawnLocation); int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), beenadeSpawnLocation, Vector2.UnitX * 6f * npc.direction, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), beenadeSpawnLocation, Vector2.UnitX * 6f * npc.direction, type, BeenadeDamage, 0f, Main.myPlayer); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index 46ec34802e..2949c7af76 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -12,6 +12,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class QueenSlimeAI { + // Vanilla values + public static int SmallGelDamage = Main.masterMode ? 20 : 17; // 68 + public static int SpikeDamage = Main.masterMode ? 20 : 17; // 68 + public static int LargeGelDamage = 30; // 120 + public static int SlamDamage = 40; // 160 + public static bool BuffedQueenSlimeAI(NPC npc, Mod mod) { // Difficulty bools @@ -327,12 +333,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) { int numGelProjectiles = 12; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numGelProjectiles = 15; float gelVelocity = death ? 20f : 16f; int type = ProjectileID.QueenSlimeGelAttack; - int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -340,11 +345,11 @@ 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); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -465,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)) @@ -511,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) @@ -520,8 +525,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.QueenSlimeSmash; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, SlamDamage, 0f, Main.myPlayer); // Line of explosions in Master Mode if (death) @@ -537,7 +541,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { expandDelay = MathHelper.Lerp(0f, maxExpandDelay, Math.Abs(i - maxSmashesPerSide) / (float)maxSmashesPerSide); if (i != maxSmashesPerSide) - Projectile.NewProjectile(npc.GetSource_FromAI(), extraSmashPosition, Vector2.Zero, type, damage, 0f, Main.myPlayer, -expandDelay); + Projectile.NewProjectile(npc.GetSource_FromAI(), extraSmashPosition, Vector2.Zero, type, SlamDamage, 0f, Main.myPlayer, -expandDelay); extraSmashPosition -= Vector2.UnitX * smashSpawnDistanceOffset; } @@ -548,7 +552,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileVelocity = death ? 18f : 12f; type = ProjectileID.QueenSlimeMinionBlueSpike; - damage = npc.GetProjectileDamage(type); Vector2 destination = (new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int numProj = 20; @@ -556,7 +559,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, -2f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, SpikeDamage, 0f, Main.myPlayer, 0f, -2f); } if (phase5) @@ -566,7 +569,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, -2f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, SpikeDamage, 0f, Main.myPlayer, 0f, -2f); } } } @@ -625,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; @@ -646,7 +649,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 fireFrom = npc.Center; int projectileAmt = 2; int type = ProjectileID.QueenSlimeMinionBlueSpike; - int damage = npc.GetProjectileDamage(type); Vector2 velocityIncrease = death ? (Vector2.UnitY * 4f) : Vector2.Zero; for (int i = 0; i < projectileAmt; i++) { @@ -655,7 +657,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int j = 0; j < totalProjectiles; j++) { Vector2 projVelocity = (npc.velocity + velocityIncrease).RotatedBy(radians * j + MathHelper.PiOver2); - Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, SpikeDamage, 0f, Main.myPlayer, 0f, -1f); } } } @@ -731,12 +733,11 @@ 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; - int damage = npc.GetProjectileDamage(type); if (phase2) { Vector2 destination = (new Vector2(npc.Center.X, npc.Center.Y + 100f) - npc.Center).SafeNormalize(Vector2.UnitY); @@ -744,11 +745,11 @@ 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))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -758,11 +759,11 @@ 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); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -780,7 +781,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses foreach (int t in targets) { Vector2 velocity2 = (Main.player[t].Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileVelocity; - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -870,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; @@ -1025,7 +1026,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses vector6 *= 1.5f; int type = ProjectileID.QueenSlimeMinionBlueSpike; - Projectile.NewProjectile(npc.GetSource_FromAI(), center, vector6 * (death ? 0.8f : 0.5f), type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), center, vector6 * (death ? 0.8f : 0.5f), type, SpikeDamage, 0f, Main.myPlayer); npc.localAI[0] = 25f; if (num22 > 4) break; @@ -1055,7 +1056,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[0] = 50f; int type = ProjectileID.QueenSlimeMinionBlueSpike; Vector2 spikeVelocity = new Vector2(num19, num20) * (death ? 0.8f : 0.5f); - Projectile.NewProjectile(npc.GetSource_FromAI(), center, spikeVelocity, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), center, spikeVelocity, type, SpikeDamage, 0f, Main.myPlayer); } } } @@ -1210,7 +1211,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int type = ProjectileID.QueenSlimeMinionPinkBall; Vector2 pinkBallVelocity = new Vector2(num24, num25) * (death ? 0.8f : 0.5f); - Projectile.NewProjectile(npc.GetSource_FromAI(), center2, pinkBallVelocity, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), center2, pinkBallVelocity, type, SmallGelDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index 641afdf1a7..4d20d1977f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -18,6 +18,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float HandSwipeDistance = 960f; // 60 tiles public const float HandSwipeDistance_Master = 1280f; // 80 tiles + // Vanilla values + public static float SpinDamageMult = 1.3f; // 91 + public static int SkullDamage = 17; // 68; Also applies to crossbones + + // Rev+ exclusive + public static int ShadowflameDamage = 20; // 80 + public static bool BuffedSkeletronAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -55,6 +62,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set defense npc.defense = npc.defDefense; + npc.damage = npc.defDamage; npc.reflectsProjectiles = false; @@ -154,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; } @@ -210,7 +218,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Hand DR, scale DR up if the hands are still alive as Skeletron's HP lowers npc.chaseable = handsDead; - float minDR = 0.05f; + float minDR = 0f; float maxDR = 0.9999f; calamityGlobalNPC.DR = !handsDead ? (float)Math.Sqrt(MathHelper.Lerp(minDR, maxDR, respawnHands ? (respawnHandsLifeRatio - lifeRatio) / respawnHandsLifeRatio : 2f - lifeRatio / respawnHandsLifeRatio)) : minDR; calamityGlobalNPC.unbreakableDR = !handsDead; @@ -240,7 +248,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); // Inverse parabolic projectile spreads Vector2 baseVel = npc.SafeDirectionTo(Main.player[npc.target].Center) * (death ? 6f : 5f); @@ -250,7 +257,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float offset = MathHelper.ToRadians(MathHelper.Lerp(-spread * 0.5f, spread * 0.5f, i / (numProj - 1f))); float velocityMult = MathHelper.Lerp(0.5f, 1.5f, MathF.Abs(centralCount - i) / centralCount); - Projectile shot = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), firingPos, baseVel.RotatedBy(offset) * velocityMult, type, damage, 0f, Main.myPlayer, -2f); + Projectile shot = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), firingPos, baseVel.RotatedBy(offset) * velocityMult, type, SkullDamage, 0f, Main.myPlayer, -2f); shot.timeLeft = 600; } @@ -347,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); @@ -366,15 +373,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses skullFiringPos += skullProjDirection * 5f; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, damage, 0f, Main.myPlayer, -1f); + int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, SkullDamage, 0f, Main.myPlayer, -1f); Main.projectile[skullProjectile].timeLeft = 600; if (death && handsDead) { skullProjDirection = new Vector2(skullProjTargetX, skullProjTargetY).SafeNormalize(Vector2.UnitY); skullProjDirection *= skullProjSpeed * 2f; - int skullProjectile2 = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, damage, 0f, Main.myPlayer, -2f); + int skullProjectile2 = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, SkullDamage, 0f, Main.myPlayer, -2f); Main.projectile[skullProjectile2].timeLeft = 600; } @@ -386,9 +392,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Float above target if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; - calamityGlobalNPC.newAI[1] += 1f; float chargePhaseChangeRateBoost = phase5 ? (death ? 24f : 8f) : phase4 ? (death ? 6f : 4f) : ((death ? 4.5f : 3f) * ((1f - lifeRatio) / (1f - phase4LifeRatio))); if (!handsDead) @@ -425,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; @@ -515,10 +518,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spin charge else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - - 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)) { @@ -572,7 +572,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - npc.defense -= 10; + npc.defense = npc.defDefense - 10; + npc.damage = (int)Math.Round(npc.defDamage * SpinDamageMult); float phaseChangeRateBoost = phase3 ? 0f : 1f - (lifeRatio - phase3LifeRatio) / (1f - phase3LifeRatio); npc.ai[2] += 1f + phaseChangeRateBoost; @@ -596,8 +597,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float shadowFlameProjectileSpeed = death ? 6f : 4f; Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * shadowFlameProjectileSpeed; int type = ProjectileID.Shadowflames; - int damage = npc.GetProjectileDamage(type); - int shadowFlameProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + int shadowFlameProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, ShadowflameDamage, 0f, Main.myPlayer, 0f, 1f); Main.projectile[shadowFlameProjectile].timeLeft = 600; } } @@ -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) { @@ -655,15 +655,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float skullProjSpeed = phase5 ? (6f + (death ? 2f * ((phase5LifeRatio - lifeRatio) / phase5LifeRatio) : 0f)) : 4f; Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * skullProjSpeed; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); for (int k = 0; k < chargeSkullAmt + 1; k++) { Vector2 perturbedSpeed = initialProjectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, k / (float)(chargeSkullAmt - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, -1f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, SkullDamage, 0f, Main.myPlayer, -1f); Main.projectile[proj].timeLeft = 600; if (death) { - int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, -2f); + int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, SkullDamage, 0f, Main.myPlayer, -2f); Main.projectile[proj2].timeLeft = 600; } } @@ -692,8 +691,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float headSpinTargetDist = (float)Math.Sqrt(headSpinTargetX * headSpinTargetX + headSpinTargetY * headSpinTargetY); // Increase speed while charging - npc.damage = (int)Math.Round(npc.defDamage * 1.3); - if (!phase3) { float velocityBoost = MathHelper.Lerp(0f, 3f, (1f - lifeRatio) / (1f - phase3LifeRatio)); @@ -710,7 +707,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headSpinVelocityMult *= baseDistanceVelocityMult; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) headSpinVelocityMult *= 1.3f; headSpinTargetDist = headSpinVelocityMult / headSpinTargetDist; @@ -768,9 +765,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - // Avoid cheap bullshit - npc.damage = 0; - npc.velocity.Y += 0.1f; if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.95f; @@ -874,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) { @@ -896,9 +890,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 0f || npc.ai[2] == 3f) { - // Avoid cheap bullshit - npc.damage = 0; - if (Main.npc[(int)npc.ai[1]].ai[1] == 3f && npc.timeLeft > 10) npc.timeLeft = 10; @@ -1022,9 +1013,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 1f) { - // Avoid cheap bullshit - npc.damage = 0; - Vector2 handCurrentPosition = npc.Center; float handDrawbackXPos = Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0] - handCurrentPosition.X; float handDrawbackYPos = Main.npc[(int)npc.ai[1]].Top.Y + 230f - handCurrentPosition.Y; @@ -1040,9 +1028,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.Top.Y < Main.npc[(int)npc.ai[1]].Top.Y - 200f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] = 2f; npc.ai[3] = 0f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * handSwipeVelocity; @@ -1051,9 +1036,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 2f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[3] += 1f; if (npc.ai[3] >= handSwipeDuration || Vector2.Distance(Main.npc[(int)npc.ai[1]].Center, npc.Center) > handSwipeDistance || cancelSlap) { @@ -1071,8 +1053,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float skullProjSpeed = handSwipeVelocity * (phase3 ? 0.6f : 0.2f); Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * skullProjSpeed; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, damage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); + int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, SkullDamage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); Main.projectile[skullProjectile].timeLeft = 600; } } @@ -1081,9 +1062,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 4f) { - // Avoid cheap bullshit - npc.damage = 0; - Vector2 handStrikeCurrentPos = npc.Center; float handStrikeXPos = Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0] - handStrikeCurrentPos.X; float handStrikeYPos = Main.npc[(int)npc.ai[1]].Top.Y + 230f - handStrikeCurrentPos.Y; @@ -1099,9 +1077,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 500f || npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X + 500f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] = 5f; npc.ai[3] = 0f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * handSwipeVelocity; @@ -1110,9 +1085,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 5f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[3] += 1f; if (npc.ai[3] >= handSwipeDuration || Vector2.Distance(Main.npc[(int)npc.ai[1]].Center, npc.Center) > handSwipeDistance || cancelSlap) { @@ -1130,8 +1102,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float skullProjSpeed = handSwipeVelocity * (phase3 ? 0.6f : 0.2f); Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * skullProjSpeed; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, damage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); + int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, SkullDamage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); Main.projectile[skullProjectile].timeLeft = 600; } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index ba08d0ffc7..663fa2f28e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -17,6 +17,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class SkeletronPrimeAI { + // Vanilla values + public static int SpinDamageMult = 2; // 158 + public static int LaserDamage = 25; // 100 + + // Rev+ exclusive + public static int SkullDamage = 25; // 100 + public static int RocketDamage = 30; // 120 + public static bool BuffedSkeletronPrimeAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -101,6 +109,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.chaseable = allArmsDead; npc.defense = npc.defDefense; + npc.damage = npc.defDamage; // Phases bool phase2 = lifeRatio < 0.66f; @@ -155,11 +164,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Float near player if (npc.ai[1] == 0f || npc.ai[1] == 4f) { - // Avoid unfair bullshit - npc.damage = 0; - // 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; @@ -270,8 +276,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spinning if (npc.ai[1] == 1f) { - npc.defense *= 2; - npc.damage = npc.defDamage * 2; + npc.defense = npc.defDefense * 2; + npc.damage = npc.defDamage * SpinDamageMult; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; @@ -285,18 +291,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = death ? 15 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float velocity = 3f; double angleA = radians * 0.5; @@ -306,7 +300,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 laserFireDirection = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; } npc.localAI[1] += 1f; @@ -439,9 +433,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Despawning if (npc.ai[1] == 3f) { - // Avoid unfair bullshit - npc.damage = 0; - if (NPC.IsMechQueenUp) { int mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Retinazer); @@ -485,9 +476,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Fly around in a circle if (npc.ai[1] == 5f) { - // Avoid unfair bullshit - npc.damage = 0; - npc.ai[2] += 1f; npc.rotation = npc.velocity.X / 50f; @@ -549,20 +537,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses enragedHeadSkullTargetY = value.Y; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, damage, 0f, Main.myPlayer, -3f, 0f); + int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, SkullDamage.CalculateMechDamage(), 0f, Main.myPlayer, -3f, 0f); Main.projectile[enragedSkulls].timeLeft = 480; Main.projectile[enragedSkulls].tileCollide = false; } @@ -591,9 +567,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Fly overhead and spit missiles if (npc.ai[1] == 6f) { - // Avoid unfair bullshit - npc.damage = 0; - npc.rotation = npc.velocity.X / 15f; float flightVelocity = death ? 25f : 18f; @@ -617,20 +590,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 velocity = (-Vector2.UnitY * 3f).RotatedByRandom(MathHelper.Pi / 8f); int type = ProjectileID.RocketSkeleton; - int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 30f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, npc.target, 1f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 30f, velocity.X, velocity.Y, type, RocketDamage.CalculateMechDamage(), 0f, Main.myPlayer, npc.target, 1f); Main.projectile[proj].timeLeft = 540; } @@ -711,9 +672,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } - // Avoid cheap bullshit - npc.damage = 0; - bool normalLaserRotation = npc.localAI[1] % 2f == 0f; // Movement @@ -823,24 +781,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[0] = 0f; float laserSpeed = 4f; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } laserArmTargetDist = laserSpeed / laserArmTargetDist; laserArmTargetX *= laserArmTargetDist; laserArmTargetY *= laserArmTargetDist; Vector2 laserVelocity = new Vector2(laserArmTargetX, laserArmTargetY); - Projectile.NewProjectile(npc.GetSource_FromAI(), laserArmPosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 100f, laserVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), laserArmPosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 100f, laserVelocity, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); } } } @@ -891,18 +837,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = death ? 24 : 16; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float velocity = 3f; double angleA = radians * 0.5; @@ -912,7 +846,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 laserFireDirection = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; } npc.localAI[1] += 1f; @@ -976,9 +910,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } - // Avoid cheap bullshit - npc.damage = 0; - bool fireSlower = false; if (laserAlive) { @@ -1124,18 +1055,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item62, npc.Center); npc.localAI[0] = 0f; int type = ProjectileID.RocketSkeleton; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float rocketSpeed = 10f; cannonArmTargetDist = rocketSpeed / cannonArmTargetDist; @@ -1143,7 +1062,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses cannonArmTargetY *= cannonArmTargetDist; Vector2 rocketVelocity = new Vector2(cannonArmTargetX, cannonArmTargetY); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), cannonArmPosition + rocketVelocity.SafeNormalize(Vector2.UnitY) * 40f, rocketVelocity, type, damage, 0f, Main.myPlayer, npc.target, 2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), cannonArmPosition + rocketVelocity.SafeNormalize(Vector2.UnitY) * 40f, rocketVelocity, type, RocketDamage.CalculateMechDamage(), 0f, Main.myPlayer, npc.target, 2f); Main.projectile[proj].timeLeft = 540; } } @@ -1171,18 +1090,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item62, npc.Center); npc.localAI[0] = 0f; int type = ProjectileID.RocketSkeleton; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float rocketSpeed = 10f; Vector2 cannonSpreadTargetDist = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * rocketSpeed; @@ -1191,7 +1098,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = cannonSpreadTargetDist.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 40f, perturbedSpeed, type, damage, 0f, Main.myPlayer, npc.target, 2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 40f, perturbedSpeed, type, RocketDamage.CalculateMechDamage(), 0f, Main.myPlayer, npc.target, 2f); Main.projectile[proj].timeLeft = 600; } } @@ -1261,9 +1168,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sawAlive = true; } - // Avoid cheap bullshit - npc.damage = 0; - // Return to the head if (npc.ai[2] == 99f) { @@ -1447,9 +1351,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 280f) { - // Set damage - npc.damage = npc.defDamage; - float chargeVelocity = 16f; if (!cannonAlive) chargeVelocity += 1.5f; @@ -1473,9 +1374,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge 4 times (more if arms are dead) else if (npc.ai[2] == 2f) { - // Set damage - npc.damage = npc.defDamage; - if (npc.position.Y > Main.player[npc.target].position.Y || npc.velocity.Y < 0f) { float chargeAmt = 4f; @@ -1515,9 +1413,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 500f || npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X + 500f) { - // Set damage - npc.damage = npc.defDamage; - float chargeVelocity = 14f; if (!cannonAlive) chargeVelocity += 1f; @@ -1541,9 +1436,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge 4 times (more if arms are dead) else if (npc.ai[2] == 5f && npc.Center.X < Main.player[npc.target].Center.X - 100f) { - // Set damage - npc.damage = npc.defDamage; - float chargeAmt = 4f; if (!cannonAlive) chargeAmt += 1f; @@ -1624,12 +1516,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses viceAlive = true; } - // Min saw damage - int reducedSetDamage = (int)Math.Round(npc.defDamage * 0.5); - - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - if (npc.ai[2] == 99f) { float acceleration = death ? 0.375f : 0.25f; @@ -1802,9 +1688,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 200f) { - // Set damage - npc.damage = npc.defDamage; - float chargeVelocity = 22f; if (!cannonAlive) chargeVelocity += 1.5f; @@ -1827,9 +1710,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[2] == 2f) { - // Set damage - npc.damage = npc.defDamage; - if (npc.position.Y > Main.player[npc.target].position.Y || npc.velocity.Y < 0f) npc.ai[2] = 3f; } @@ -1838,9 +1718,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (npc.ai[2] == 4f) { - // Set damage - npc.damage = npc.defDamage; - float chargeVelocity = 11f; if (!cannonAlive) chargeVelocity += 1.5f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index ad4c94e90f..f1ff62a5df 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -13,10 +13,36 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class TwinsAI { + // Vanilla values + public static float RapidFireDamageMult = 0.75f; // 80 (buffed) + public static float RetinazerPhase2ContactDamageMult = 1.5f; // 114 + public static float SpazmatismPhase2ContactDamageMult = 1.5f; // 127 + public static int FlamethrowerDamage = 27; // 108; Applies to both flamethrower types + public static int FireballDamage = 22; // 88; Applies to both fireball types + + // Rev+ exclusive + public static int LaserDamage = 23; // 92 (buffed) + public static int RedLaserDamage = 27; // 108 (buffed) + public static int HomingDartDamage = 27; // 108 + + public static int CalculateMechDamage(this int damage) + { + // Reduce mech boss projectile damage depending on the new ore progression changes + if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) + { + double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; + double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; + if (!NPC.downedMechBossAny) + damage = (int)(damage * firstMechMultiplier); + else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) + damage = (int)(damage * secondMechMultiplier); + } + return damage; + } + public static bool BuffedRetinazerAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target @@ -27,13 +53,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = death ? 0.3f : 0f; - if (Main.IsItDay()) - { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 1f; - } - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -106,7 +125,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.reflectsProjectiles = false; // Despawn - if (Main.player[npc.target].dead) + if ((Main.player[npc.target].dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) @@ -120,13 +139,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; - - float maxVelocity = 8.25f; - float acceleration = 0.115f; - maxVelocity += 4f * enrageScale; - acceleration += 0.05f * enrageScale; + float maxVelocity = (death ? 9.45f : 8.25f); + float acceleration = (death ? 0.13f : 0.115f); if (death) { @@ -134,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; @@ -188,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; } @@ -198,23 +212,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserSpeed = 10.5f; - laserSpeed += 3f * enrageScale; + float laserSpeed = death ? 11.4f : 10.5f; int type = ProjectileID.EyeLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - + int damage = LaserDamage.CalculateMechDamage(); Vector2 laserVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 90f, laserVelocity, type, damage, 0f, Main.myPlayer); } @@ -224,16 +225,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - npc.rotation = hoverRotation; - float chargeSpeed = 15f; - chargeSpeed += 10f * enrageScale; + 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; @@ -242,16 +239,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] += 1f; float decelerateGateValue = (death ? 36f : 32f) + (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); if (npc.ai[2] >= decelerateGateValue) { - // Avoid cheap bullshit - npc.damage = 0; - float decelerationMultiplier = (death ? 0.84f : 0.92f) - (death ? 0.16f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); npc.velocity *= decelerationMultiplier; @@ -305,9 +296,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - if (NPC.IsMechQueenUp) npc.reflectsProjectiles = true; @@ -335,22 +323,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 projectileVelocity = npc.rotation.ToRotationVector2() * 7f; float offset = 90f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * offset, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * offset, projectileVelocity, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -404,7 +380,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.chaseable = !spazInPhase1; - int setDamage = (int)Math.Round(npc.defDamage * 1.5); + npc.damage = (int)Math.Round(npc.defDamage * RetinazerPhase2ContactDamageMult); npc.defense = npc.defDefense + 10; calamityGlobalNPC.DR = spazInPhase1 ? 0.9999f : 0.2f; calamityGlobalNPC.unbreakableDR = spazInPhase1; @@ -414,15 +390,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; + float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; + float acceleration = death ? 0.1975f + 0.05f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.175f; - float maxVelocity = 9.5f + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.175f + (death ? 0.05f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 4.5f * enrageScale; - acceleration += 0.075f * enrageScale; - - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -477,23 +448,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] = 0f; float laserSpeed = 10f; - laserSpeed += enrageScale; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 laserVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 120f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 120f, laserVelocity, type, RedLaserDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -502,15 +460,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (npc.ai[1] == 1f) { - // Avoid cheap bullshit - npc.damage = 0; + float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; + float acceleration = death ? 0.295f + 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.25f; - float maxVelocity = 9.5f + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.25f + (death ? 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 4.5f * enrageScale; - acceleration += 0.15f * enrageScale; - - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -534,20 +487,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] = 0f; float laserSpeed = 9f; - laserSpeed += enrageScale; int type = ProjectileID.DeathLaser; - int damage = (int)Math.Round(npc.GetProjectileDamage(type) * 0.75); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } + int damage = (int)Math.Round(RedLaserDamage.CalculateMechDamage() * RapidFireDamageMult); Vector2 laserVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 120f, laserVelocity, type, damage, 0f, Main.myPlayer); @@ -573,17 +514,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = setDamage; - // Set rotation and velocity npc.rotation = hoverRotation; - float chargeSpeed = 22f + (death ? 8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 10f * enrageScale; + 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; @@ -593,9 +530,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 3f) { - // Set damage - npc.damage = setDamage; - npc.ai[2] += 1f; float chargeTime = spazAlive ? 45f : 30f; @@ -603,14 +537,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeTime = spazAlive ? 90f : 60f; if (death) chargeTime -= chargeTime * 0.25f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio); - chargeTime -= chargeTime / 5 * enrageScale; + chargeTime -= chargeTime * (death ? 0.06f : 0f); // Slow down if (npc.ai[2] >= chargeTime) { - // Avoid cheap bullshit - npc.damage = 0; - npc.velocity *= 0.93f; if (Math.Abs(npc.velocity.X) < 0.1) @@ -632,7 +563,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float laserDartSpeed = (death ? 9f : 6f) * (spazAlive ? 1f : 1.5f); int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); + int damage = HomingDartDamage.CalculateMechDamage(); // Reduce mech boss projectile damage depending on the new ore progression changes if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) @@ -654,7 +585,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge four times float chargeGateValue = 30f; - chargeGateValue -= chargeGateValue / 4 * enrageScale; + chargeGateValue -= chargeGateValue * (death ? 0.07f : 0f); if (npc.ai[2] >= chargeTime + chargeGateValue) { npc.ai[2] = 0f; @@ -689,14 +620,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Get in position for charge else if (npc.ai[1] == 4f) { - // Avoid cheap bullshit - npc.damage = 0; - float chargeLineUpDistance = spazAlive ? 600f : 500f; - float chargeSpeed = 18f + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float chargeAcceleration = 0.45f + (death ? 0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 6f * enrageScale; - chargeAcceleration += 0.15f * enrageScale; + float chargeSpeed = (death ? 19.8f : 18f) + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeAcceleration = (death ? 0.495f : 0.45f) + (death ? 0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (spazAlive) { @@ -704,7 +630,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -743,13 +669,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = death ? 0.3f : 0f; - if (Main.IsItDay()) - { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 1f; - } - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -828,7 +747,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.reflectsProjectiles = false; // Despawn - if (Main.player[npc.target].dead) + if ((Main.player[npc.target].dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) @@ -844,14 +763,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Cursed fireball phase if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity - float maxVelocity = 12f; - float acceleration = 0.4f; - maxVelocity += 6f * enrageScale; - acceleration += 0.2f * enrageScale; + float maxVelocity = death ? 13.8f : 12f; + float acceleration = death ? 0.46f : 0.4f; if (death) { @@ -859,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; @@ -904,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; } @@ -914,24 +828,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - float cursedFireballSpeed = 15f; - cursedFireballSpeed += 3f * enrageScale; + float cursedFireballSpeed = death ? 15.9f : 15f; int type = ProjectileID.CursedFlameHostile; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 fireballVelocity = ((Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * cursedFireballSpeed) + new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)) * 0.05f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + fireballVelocity.SafeNormalize(Vector2.UnitY) * 50f, fireballVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + fireballVelocity.SafeNormalize(Vector2.UnitY) * 50f, fireballVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -940,17 +841,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charging phase else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - // Rotation and velocity npc.rotation = hoverRotation; - float chargeSpeed = 18f; - chargeSpeed += 8f * enrageScale; - if (death) - chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (CalamityWorld.LegendaryMode) + float chargeSpeed = death ? 20.4f + phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 18f; + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -959,17 +854,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] += 1f; float timeBeforeSlowDown = death ? 30f : 10f; if (npc.ai[2] >= timeBeforeSlowDown) { - // Avoid cheap bullshit - npc.damage = 0; - // Slow down npc.velocity *= 0.8f; @@ -1025,9 +914,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Transition phase else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - if (NPC.IsMechQueenUp) npc.reflectsProjectiles = true; @@ -1056,21 +942,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = npc.ai[1] % 20f == 0f ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * 16f + Main.rand.NextVector2CircularEdge(3f, 3f); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer, 0f, 1f); Main.projectile[proj].tileCollide = false; } } @@ -1129,8 +1003,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.chaseable = !retInPhase1; // Increase defense and damage - int setDamage = (int)Math.Round(npc.defDamage * 1.5); - int reducedSetDamage = (int)Math.Round(setDamage * 0.5); + npc.damage = (int)Math.Round(npc.defDamage * SpazmatismPhase2ContactDamageMult); npc.defense = npc.defDefense + 18; calamityGlobalNPC.DR = retInPhase1 ? 0.9999f : 0.2f; calamityGlobalNPC.unbreakableDR = retInPhase1; @@ -1142,13 +1015,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Shadowflamethrower phase if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - - float maxVelocity = 6.2f + (death ? 2f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.1f + (death ? 0.03f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 3f * enrageScale; - acceleration += 0.06f * enrageScale; + float maxVelocity = (death ? 7.1f : 6.2f) + (death ? 2f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float acceleration = (death ? 0.118f : 0.1f) + (death ? 0.03f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); float distanceFromTarget = 180f; Vector2 destination = Main.player[npc.target].Center + Vector2.UnitX * distanceFromTarget * direction; @@ -1161,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; @@ -1200,36 +1068,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; npc.localAI[1] = 0f; - float flamethrowerSpeed = 6f; - flamethrowerSpeed += 3f * enrageScale; + float flamethrowerSpeed = death ? 6.9f : 6f; float timeForFlamethrowerToReachMaxVelocity = 60f; float flamethrowerSpeedScalar = MathHelper.Clamp(npc.ai[2] / timeForFlamethrowerToReachMaxVelocity, 0f, 1f); flamethrowerSpeed = MathHelper.Lerp(0.1f, flamethrowerSpeed, flamethrowerSpeedScalar); int type = npc.ai[3] % 2f == 0f ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 flamethrowerVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * flamethrowerSpeed + npc.velocity * 0.5f; if (NPC.IsMechQueenUp) flamethrowerVelocity = (npc.rotation + MathHelper.PiOver2).ToRotationVector2() * flamethrowerSpeed + npc.velocity * 0.5f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, FlamethrowerDamage.CalculateMechDamage(), 0f, Main.myPlayer); if (death && npc.ai[3] % 30f == 0f) { type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; - damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 50f, flamethrowerVelocity * 2f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 50f, flamethrowerVelocity * 2f, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -1257,18 +1111,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge if (npc.ai[1] == 1f) { - // Set damage - npc.damage = setDamage; - // Play charge sound SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); // Set rotation and velocity npc.rotation = hoverRotation; - float chargeSpeed = 18f + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 16f * enrageScale; - if (CalamityWorld.LegendaryMode) + float chargeSpeed = (death ? 22.8f : 18f) + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1280,9 +1130,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 2f) { - // Set damage - npc.damage = setDamage; - npc.ai[2] += retAlive ? 1f : 1.25f; float chargeTime = 30f - (death ? 10f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); @@ -1290,9 +1137,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Slow down if (npc.ai[2] >= chargeTime) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - float deceleration = 0.85f - (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); npc.velocity *= deceleration; @@ -1327,9 +1171,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Crazy charge else if (npc.ai[1] == 3f) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - // Reset AI array and go to shadowflamethrower phase or fireball phase if ret is dead float secondFastCharge = 4f; if (npc.ai[3] >= (retAlive ? secondFastCharge : secondFastCharge + 1f)) @@ -1348,11 +1189,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (Main.netMode != NetmodeID.MultiplayerClient) { // Velocity - float spazmatismPhase3ChargeSpeed = 20f + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - spazmatismPhase3ChargeSpeed += 10f * enrageScale; + 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; @@ -1381,18 +1221,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileSpeed = spazmatismPhase3ChargeSpeed * 0.5f; int type = (!retAlive && npc.ai[3] % 2f == 0f) ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; int numProj = 3; @@ -1402,7 +1230,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 25f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 25f, perturbedSpeed, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } @@ -1414,9 +1242,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Crazy charge else if (npc.ai[1] == 4f) { - // Set damage - npc.damage = setDamage; - if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); @@ -1430,9 +1255,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Slow down if (npc.ai[2] >= spazmatismRetDeadChargeSpeed) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - npc.velocity *= 0.93f; if (Math.Abs(npc.velocity.X) < 0.1) npc.velocity.X = 0f; @@ -1461,14 +1283,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Get in position for charge else if (npc.ai[1] == 5f) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - float chargeLineUpDistance = retAlive ? 600f : 500f; - float chargeSpeed = 16f + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float chargeAcceleration = 0.4f + (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 5.333f * enrageScale; - chargeAcceleration += 0.133f * enrageScale; + float chargeSpeed = (death ? 17.5f : 16f) + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeAcceleration = (death ? 0.44f : 0.4f) + (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (retAlive) { @@ -1476,7 +1293,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -1497,21 +1314,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileSpeed = 16f; int type = npc.ai[3] % 2f == 0f ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 25f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 25f, projectileVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 04c820a6cb..e1fe967125 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -16,6 +16,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float TotalLasersPerBarrage = 3f; public const float EnragedLaserFiringDuration = 300f; + // Rev+ exclusive + public static int LaserDamage = 15; // 60 (modified to be always at maximum Expert damage and does not scale) + public static int SickleDamage = 22; // 88 + + // Death exclusive + public static int FireballDamage = 18; // 108 + public static bool BuffedWallofFleshAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -44,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) { @@ -87,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) @@ -119,8 +126,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * npc.velocity.Length(); Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f; - int damage = npc.GetProjectileDamage(ProjectileID.DemonSickle); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, ProjectileID.DemonSickle, damage, 0f, Main.myPlayer, 0f, projectileVelocity.Length() * 3f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, ProjectileID.DemonSickle, SickleDamage, 0f, Main.myPlayer, 0f, projectileVelocity.Length() * 3f); Main.projectile[proj].timeLeft = 600; Main.projectile[proj].tileCollide = false; @@ -131,7 +137,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.Fireball; - damage = npc.GetProjectileDamage(type); int numProj = 3; int spread = 15; float rotation = MathHelper.ToRadians(spread); @@ -140,7 +145,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(fireballVelocity, fireballVelocity); Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))) + randomVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 50f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 50f, perturbedSpeed, type, FireballDamage, 0f, Main.myPlayer); } } } @@ -318,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; @@ -546,13 +551,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.defense = npc.defDefense; if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5) { - npc.damage = death ? 180 : 120; + npc.damage = npc.defDamage * 2; npc.defense = 30; acceleration += death ? 0.1f : 0.08f; } else if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.75) { - npc.damage = death ? 135 : 90; + npc.damage = (int)Math.Round(npc.defDamage * 1.5f); npc.defense = 20; acceleration += death ? 0.05f : 0.04f; } @@ -877,14 +882,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float velocity = (fireEnragedLasers ? 3f : 4f) + shootBoost; int projectileType = ProjectileID.EyeLaser; - int damage = npc.GetProjectileDamage(projectileType); bool targetTooClose = npc.Distance(Main.player[npc.target].Center) < 160f; float projectileOffset = targetTooClose ? 60f : 150f; Vector2 projectileVelocity = (lookAt - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * projectileOffset; - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, LaserDamage, 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; if (!canHit) 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/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs index 2573731e44..f167f0e5c5 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs @@ -12,10 +12,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies { public static class SlimeAI { - public const float SpikedSlimeSpikeBarrageGateValue = 30f; - public const float SpikedSlimeSpikeGateValue = 50f; - public const float SpikedSlimeSpikeTelegraphTime = 30f; - public static void ChooseRandomItem(out int dropItem) { // Use a fallback of -1. @@ -105,7 +101,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (npc.type == NPCID.SpikedJungleSlime) { projectileShootType = ProjectileID.JungleSpike; - projectileShootSpeedFactor *= 1.5f; + projectileShootSpeedFactor *= 0.6f; } ref float jumpDelay = ref npc.ai[0]; @@ -184,7 +180,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (Main.netMode != NetmodeID.MultiplayerClient && projectileShootCountdown <= 0f) { var source = npc.GetSource_FromAI(); - if (Main.expertMode && distanceFromTarget < 120f) + if (distanceFromTarget < 120f) { for (int i = 0; i < 5; i++) { @@ -196,12 +192,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (CalamityWorld.death) Main.projectile[proj].extraUpdates += 1; - projectileShootCountdown = SpikedSlimeSpikeBarrageGateValue; + projectileShootCountdown = 30f; } } else { - Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center - Vector2.UnitY * (npc.type == NPCID.SpikedJungleSlime ? 10f : 100f)) * projectileShootSpeedFactor * (CalamityWorld.death ? 3.25f : CalamityWorld.revenge ? 5.5f : 4.5f); + Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center - Vector2.UnitY * 100f) * projectileShootSpeedFactor * (CalamityWorld.death ? 3.25f : CalamityWorld.revenge ? 5.5f : 4.5f); int proj = Projectile.NewProjectile(source, npc.Center, velocity, projectileShootType, 9, 0f, Main.myPlayer); if (CalamityWorld.death) { @@ -209,43 +205,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies Main.projectile[proj].timeLeft = 1200; } - projectileShootCountdown = SpikedSlimeSpikeGateValue; + projectileShootCountdown = 50f; } } } else - projectileShootCountdown = SpikedSlimeSpikeGateValue; - - if (npc.type == NPCID.SpikedIceSlime) - { - // Emit dust from center when about to shoot - if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) - { - Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 135, 0f, 0f, 100, default, 3f); - dust.noGravity = true; - dust.velocity *= 0f; - } - } - else if (npc.type == NPCID.SpikedJungleSlime) - { - // Emit dust from center when about to shoot - if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) - { - Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 61, 0f, 0f, 0, default, 3f); - dust.noGravity = true; - dust.velocity *= 0f; - } - } - else if (npc.type == NPCID.SlimeSpiked) - { - // Emit dust from center when about to shoot - if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) - { - Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 4, 0f, 0f, 0, new Color(78, 136, 255, 150), 1.5f); - dust.noGravity = true; - dust.velocity *= 0f; - } - } + projectileShootCountdown = 50f; } // Decrement the target reset counter. @@ -407,7 +372,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies { // Move up if tiles are hit on the Y axis. if (npc.collideY) - npc.velocity.Y = -(CalamityWorld.death ? 4f : CalamityWorld.revenge ? 3f : 2f); + npc.velocity.Y = -(CalamityWorld.death ? 4f : 3f); if (npc.velocity.Y < 0f && npc.ai[3] == npc.position.X) { @@ -418,8 +383,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (npc.velocity.Y > 0f) npc.ai[3] = npc.position.X; - float riseSpeed = CalamityWorld.death ? 0.6f : CalamityWorld.revenge ? 0.55f : 0.5f; - float maxRiseSpeed = CalamityWorld.death ? 6f : CalamityWorld.revenge ? 5f : 4f; + float riseSpeed = CalamityWorld.death ? 0.6f : 0.55f; + float maxRiseSpeed = CalamityWorld.death ? 6f : 5f; if (isLavaSlime) { riseSpeed += 0.2f; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index ad7517e5bd..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"); @@ -99,11 +97,19 @@ namespace CalamityMod.NPCs.Yharon } } + public static int FlareDamage = 72; // 288; FlareBomb, FlareDust, FlareDust2 + public static int FireballDamage = 72; // 288 + public static int TornadoDamage = 90; // 360; Flarenado, Infernado, Infernado2 + public static int BordernadoDamage = 125; // 500; SkyFlareRevenge + + // GFB exclusive + public static int VortexDamage = 90; // 360 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 220; // 440 NPC.npcSlots = 50f; - NPC.GetNPCDamage(); NPC.width = 200; NPC.height = 200; NPC.defense = 90; @@ -111,9 +117,8 @@ namespace CalamityMod.NPCs.Yharon NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(2, 50, 0, 0); + NPC.value = Item.buyPrice(platinum: 2, gold: 50); NPC.boss = true; - NPC.DR_NERD(normalDR); NPC.noGravity = true; NPC.noTileCollide = true; @@ -218,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; @@ -363,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 @@ -390,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 @@ -404,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; } } @@ -545,7 +550,7 @@ namespace CalamityMod.NPCs.Yharon Vector2 distanceFromDestination = destination - NPC.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * velocity; - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -710,8 +715,7 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, FlareDamage, 0f, Main.myPlayer, NPC.target, 1f); } } @@ -826,7 +830,7 @@ namespace CalamityMod.NPCs.Yharon Vector2 distanceFromDestination = destination - NPC.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * velocity; - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -917,7 +921,7 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = Main.zenithWorld ? NPC.GetProjectileDamage(type) : 0; + int damage = Main.zenithWorld ? VortexDamage : 0; float bulletHellVortexDuration = flareDustPhaseTimer + teleportPhaseTimer - 15f; int extraTime = Main.zenithWorld ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); @@ -1054,7 +1058,7 @@ namespace CalamityMod.NPCs.Yharon { int ringReduction = (int)MathHelper.Lerp(0f, 14f, NPC.ai[2] / flareDustPhaseTimer); int totalProjectiles = 38 - ringReduction; // 36 for first ring, 22 for last ring - DoFlareDustBulletHell(0, flareDustSpawnDivisor, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, 0f, 0f, false); + DoFlareDustBulletHell(0, flareDustSpawnDivisor, FlareDamage, totalProjectiles, 0f, 0f, false); } } @@ -1157,10 +1161,9 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float finalVelocity = 12f; float projectileAcceleration = 1.1f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, FlareDamage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); } } @@ -1193,7 +1196,7 @@ namespace CalamityMod.NPCs.Yharon Vector2 distanceFromDestination = destination - NPC.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * velocity; - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -1287,7 +1290,7 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = Main.zenithWorld ? NPC.GetProjectileDamage(type) : 0; + int damage = Main.zenithWorld ? VortexDamage : 0; float bulletHellVortexDuration = flareDustPhaseTimer + teleportPhaseTimer - 15f; int extraTime = Main.zenithWorld ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); @@ -1430,7 +1433,7 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { - DoFlareDustBulletHell(1, flareDustPhaseTimer, NPC.GetProjectileDamage(ModContent.ProjectileType()), 8, 13f, 3.6f, false); + DoFlareDustBulletHell(1, flareDustPhaseTimer, FlareDamage, 8, 13f, 3.6f, false); } } @@ -1536,10 +1539,9 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float finalVelocity = 15f; float projectileAcceleration = 1.11f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, FlareDamage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); } } @@ -1583,8 +1585,7 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, FlareDamage, 0f, Main.myPlayer, NPC.target, 1f); } } @@ -1714,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 @@ -1724,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; @@ -1766,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; @@ -1792,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; @@ -1807,7 +1808,7 @@ namespace CalamityMod.NPCs.Yharon chargeSpeed *= velocityMult; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) phaseSwitchTimer *= 0.5f; if (NPC.ai[0] == 0f) @@ -1837,7 +1838,7 @@ namespace CalamityMod.NPCs.Yharon if (!targetDead) { - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -2022,7 +2023,7 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = Main.zenithWorld ? NPC.GetProjectileDamage(type) : 0; + int damage = Main.zenithWorld ? VortexDamage : 0; float bulletHellVortexDuration = spinPhaseTimer + 15f; int extraTime = Main.zenithWorld ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); @@ -2238,6 +2239,9 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] >= fireballBreathTimer) { + // Set damage once charge starts + NPC.damage = setDamage; + if (NPC.ai[1] % (expertMode ? 6f : 8f) == 0f && Main.netMode != NetmodeID.MultiplayerClient) { float xOffset = 30f; @@ -2245,12 +2249,8 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), position, projectileVelocity, type, damage, 0f, Main.myPlayer); + 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) @@ -2308,9 +2308,8 @@ namespace CalamityMod.NPCs.Yharon int yharonFireballTimer = (int)(NPC.ai[1] - splittingFireballBreathTimer + 1f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (yharonFireballTimer <= splittingFireballBreathTimer2 && yharonFireballTimer % splittingFireballBreathDivisor == 0 && Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), position, NPC.velocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), position, NPC.velocity, type, FireballDamage, 0f, Main.myPlayer, 0f, 0f); } if (NPC.ai[1] > splittingFireballBreathPhaseTimer - splittingFireballBreathYVelocityTimer) @@ -2354,13 +2353,13 @@ namespace CalamityMod.NPCs.Yharon float radialOffset = secondPhasePhase == 4 ? 2.8f : 3.2f; if (NPC.localAI[3] == 0f) { - DoFlareDustBulletHell(1, spinPhaseTimer, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, projectileVelocity, radialOffset, true); + DoFlareDustBulletHell(1, spinPhaseTimer, FlareDamage, totalProjectiles, projectileVelocity, radialOffset, true); } else { int ringReduction = (int)MathHelper.Lerp(0f, 12f, NPC.ai[1] / spinPhaseTimer); int totalProjectiles2 = 38 - ringReduction; // 36 for first ring, 24 for last ring - DoFlareDustBulletHell(0, flareDustSpawnDivisor2, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles2, 0f, 0f, true); + DoFlareDustBulletHell(0, flareDustSpawnDivisor2, FlareDamage, totalProjectiles2, 0f, 0f, true); } } } @@ -2370,7 +2369,7 @@ namespace CalamityMod.NPCs.Yharon { int ringReduction = (int)MathHelper.Lerp(0f, 12f, NPC.ai[1] / spinPhaseTimer); int totalProjectiles = 38 - ringReduction; // 36 for first ring, 24 for last ring - DoFlareDustBulletHell(0, flareDustSpawnDivisor, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, 0f, 0f, true); + DoFlareDustBulletHell(0, flareDustSpawnDivisor, FlareDamage, totalProjectiles, 0f, 0f, true); } } @@ -2435,7 +2434,7 @@ namespace CalamityMod.NPCs.Yharon { SoundEngine.PlaySound(ShortRoarSound, NPC.Center); - DoFireRing(expertMode ? 300 : 180, NPC.GetProjectileDamage(ModContent.ProjectileType()), NPC.target, 1f); + DoFireRing(expertMode ? 300 : 180, FlareDamage, NPC.target, 1f); } } @@ -3044,21 +3043,12 @@ namespace CalamityMod.NPCs.Yharon for (int i = 0; i < 4; i++) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 360, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, VortexDamage, 0f, Main.myPlayer, 360, NPC.whoAmI); } } } #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) { @@ -3075,7 +3065,6 @@ namespace CalamityMod.NPCs.Yharon public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } #endregion diff --git a/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs b/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs index 3ba126974b..c153053208 100644 --- a/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs +++ b/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Packets packet.Write(codeBreaker.InputtedCellCount); packet.Write(codeBreaker.InitialCellCountBeforeDecrypting); packet.Write(codeBreaker.HeldSchematicID); - packet.Write(codeBreaker.ContainsBloodSample); + packet.Write(codeBreaker.ContainsBloodyVein); packet.Send(toClient, ignoreClient); } @@ -35,7 +35,7 @@ namespace CalamityMod.Packets int cellCount = packet.ReadInt32(); int cellCountBeforeDecrypting = packet.ReadInt32(); int schematicID = packet.ReadInt32(); - bool containsBloodSample = packet.ReadBoolean(); + bool containsBloodyVein = packet.ReadBoolean(); // Verify to ensure that the tile entity is a valid one. if (codeBreaker is null) @@ -44,7 +44,7 @@ namespace CalamityMod.Packets codeBreaker.InputtedCellCount = cellCount; codeBreaker.InitialCellCountBeforeDecrypting = cellCountBeforeDecrypting; codeBreaker.HeldSchematicID = schematicID; - codeBreaker.ContainsBloodSample = containsBloodSample; + codeBreaker.ContainsBloodyVein = containsBloodyVein; } } } 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 86% rename from Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs rename to Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index 4c9237af5b..9be0eb5191 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; } /// @@ -350,11 +366,15 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void AI() { var player = Main.player[Projectile.owner]; + Projectile.gfxOffY = player.gfxOffY; var modplayer = player.GetModPlayer(); 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; @@ -374,7 +394,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles if (AfterImageLength > 0) { oldProjectileRot.Add(Projectile.rotation); - oldProjectilePos.Add(Projectile.Center); + oldProjectilePos.Add(Projectile.Center + new Vector2(0, Projectile.gfxOffY)); if (oldProjectileRot.Count > AfterImageLength) { oldProjectileRot.RemoveAt(0); @@ -389,7 +409,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) @@ -421,11 +441,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles var col = Projectile.Opacity * (i / (float)AfterImageLength) * 0.1f; if (Projectile.spriteDirection == 1) { - Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, 1, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, oldScale[i], SpriteEffects.None, 0); } else { - Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, 1, SpriteEffects.FlipHorizontally, 0); + Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, oldScale[i], SpriteEffects.FlipHorizontally, 0); } } } @@ -470,6 +490,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 +514,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 42b5160a1d..ba04dae241 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -2,6 +2,7 @@ using System.IO; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -127,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); @@ -175,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.8), 0f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, Apollo.BoltDamage, 0f, Main.myPlayer); } } 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 2693b4a241..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; } @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + Vector2.Normalize(Projectile.velocity) * -6f, type, (int)Math.Round(Projectile.damage * 0.5), 0f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + Vector2.Normalize(Projectile.velocity) * -6f, type, AresGaussNuke.SparkDamage, 0f, Main.myPlayer); } } } @@ -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 9588221e55..669e1333c7 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -2,6 +2,7 @@ using System.IO; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -125,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); @@ -178,7 +171,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.8), 0f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, AresPlasmaFlamethrower.BoltDamage, 0f, Main.myPlayer); } } 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 2242660b7a..b3c3cdd0de 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 50; Projectile.height = 50; Projectile.hostile = true; @@ -33,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 600; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } @@ -149,7 +148,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 75); + target.AddBuff(ModContent.BuffType(), 120); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Boss/AstralGodRay.cs b/Projectiles/Boss/AstralGodRay.cs index bca3fb8b44..1dabcb8439 100644 --- a/Projectiles/Boss/AstralGodRay.cs +++ b/Projectiles/Boss/AstralGodRay.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 75); + target.AddBuff(ModContent.BuffType(), 120); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Boss/AstralLaser.cs b/Projectiles/Boss/AstralLaser.cs index f81ffeeeac..af2e96b9ad 100644 --- a/Projectiles/Boss/AstralLaser.cs +++ b/Projectiles/Boss/AstralLaser.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft >= 85) - target.AddBuff(ModContent.BuffType(), 45); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 34eee8c747..2281798333 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 45); + target.AddBuff(ModContent.BuffType(), 60); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Boss/BirbAuraFlare.cs b/Projectiles/Boss/BirbAuraFlare.cs index 9c8cf55d24..7b77bda05b 100644 --- a/Projectiles/Boss/BirbAuraFlare.cs +++ b/Projectiles/Boss/BirbAuraFlare.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Boss float y = projTileX * 16 + 900; Vector2 laserVelocity = new Vector2(x, 160f) - new Vector2(x, y); int type = ModContent.ProjectileType(); - int damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + int damage = Dragonfolly.LightningDamage; if (Projectile.ai[0] >= 2f) { x += 1000f; diff --git a/Projectiles/Boss/BrimstoneBall.cs b/Projectiles/Boss/BrimstoneBall.cs index 8009e83729..a171fbf0b7 100644 --- a/Projectiles/Boss/BrimstoneBall.cs +++ b/Projectiles/Boss/BrimstoneBall.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index e0d36a0248..59e57349d3 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -36,16 +36,6 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(Projectile.localAI[0]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - Projectile.localAI[0] = reader.ReadSingle(); - } - public override void AI() { int target = Player.FindClosest(Projectile.Center, 1, 1); @@ -118,14 +108,6 @@ namespace CalamityMod.Projectiles.Boss trailDust.scale = Main.rand.NextFloat(0.2f, 0.6f); } - if (Projectile.localAI[0] == 0f) - { - Projectile.localAI[0] = 1f; - - if (Projectile.ai[0] == 0f) - Projectile.damage = NPC.AnyNPCs(ModContent.NPCType()) ? Projectile.GetProjectileDamage(ModContent.NPCType()) : Projectile.GetProjectileDamage(ModContent.NPCType()); - } - Lighting.AddLight(Projectile.Center, 0.75f * Projectile.Opacity, 0f, 0f); time++; } @@ -140,7 +122,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 0f || Main.zenithWorld) target.AddBuff(ModContent.BuffType(), 180); else - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index 2fb7384d2e..52038731eb 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 240); // Cook you up (still scales with player size in case it's manipulated) int smokeCount = 4 + (int)MathHelper.Clamp(target.width * 0.1f, 0f, 20f); diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 2b2c2d18c1..dee61c274d 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 0f || Main.zenithWorld) target.AddBuff(ModContent.BuffType(), 180); else - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index 92cded34d9..36f5a082d3 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 0f || Main.zenithWorld) target.AddBuff(ModContent.BuffType(), 180); else - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index c35f3e1f66..ce7f33d38b 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; @@ -83,7 +82,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 240); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 9ae84d9397..94fdc5611a 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss internal static readonly float CircularHitboxRadius = 170f; public static int MinimumDamagePerFrame = 4; - public static int MaximumDamagePerFrame = 16; + public static int MaximumDamagePerFrame = 14; public static float AdrenalineLossPerFrame = 0.04f; public static float SpeedToForceMaxDamage = 25f; @@ -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 8f2f6b0ce0..2bf79eff7a 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -123,7 +123,6 @@ namespace CalamityMod.Projectiles.Boss Vector2 fireFrom = new Vector2(Main.npc[(int)Projectile.ai[1]].Center.X + (Main.npc[(int)Projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)Projectile.ai[1]].Center.Y - 74f) + velocity * distanceBetweenProjectiles; int projectileAmt = (int)(Projectile.localAI[1] / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); - int damage = (int)Math.Round(Projectile.damage * 0.6); float projectileVelocityToPass = 12f; for (int i = 0; i < projectileAmt; i++) @@ -133,10 +132,8 @@ namespace CalamityMod.Projectiles.Boss for (int j = 0; j < totalProjectiles; j++) { Vector2 projVelocity = Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); - int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, death ? 2f : 1f, 0f, projectileVelocityToPass); + 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; } @@ -234,7 +231,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 240); } public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; 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/DestroyerElectricLaser.cs b/Projectiles/Boss/DestroyerElectricLaser.cs index 5a30ce18b1..0b9e4572dd 100644 --- a/Projectiles/Boss/DestroyerElectricLaser.cs +++ b/Projectiles/Boss/DestroyerElectricLaser.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index 83a4612665..d440cb096b 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, AstrumDeusBody.LaserDamage, 0f, Main.myPlayer, 1f, 0f); } } } @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.timeLeft > MaxTimeLeft - FadeTime || (Projectile.timeLeft < FadeTime && Projectile.ai[0] == 0f)) return; - target.AddBuff(ModContent.BuffType(), 75); + target.AddBuff(ModContent.BuffType(), 120); } } } 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/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index b8319f6a3b..665620b277 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -215,10 +215,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[0] == 3f) - target.AddBuff(ModContent.BuffType(), 160); - else - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 18c38a055e..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,13 +128,10 @@ 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) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + Projectile.damage = Yharon.TornadoDamage; } public override bool CanHitPlayer(Player target) => 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/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index dc8229123f..14f0fba566 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -128,7 +128,6 @@ namespace CalamityMod.Projectiles.Boss return; target.AddBuff(BuffID.Frostburn, 180, true); - target.AddBuff(BuffID.Chilled, 90, true); } } } 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 2b152da1fe..9fcca7cfd2 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using CalamityMod.World; @@ -16,6 +17,7 @@ namespace CalamityMod.Projectiles.Boss public class HolyBlast : ModProjectile, ILocalizedModType { public bool started = false; + public int FireDamage = 0; private const int TimeLeft = 120; private const int AccelerationTime = 60; @@ -30,10 +32,6 @@ namespace CalamityMod.Projectiles.Boss Main.projFrames[Type] = 4; } - public override void OnSpawn(IEntitySource source) - { - } - public override void SetDefaults() { Projectile.Calamity().DealsDefenseDamage = true; @@ -46,6 +44,17 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + FireDamage = Providence.FireDamage.CalculateProvidenceDamage(); + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + FireDamage = ProfanedGuardianCommander.FireDamage; + } + } + public override void SendExtraAI(BinaryWriter writer) { writer.Write(Projectile.localAI[0]); @@ -58,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 320, 20); + ProvUtils.ApplyGFBDamage(Projectile, 180, 20); Lighting.AddLight(Projectile.Center, 0.9f, 0.7f, 0f); @@ -150,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; @@ -161,7 +170,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + additionalVelocity, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + additionalVelocity, type, FireDamage, 0f, Projectile.owner); } } @@ -192,7 +201,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 320); + ProvUtils.ApplyDebuffs(target, 180); } } } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index cb0933c919..f3dfbf99bc 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -2,12 +2,14 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -16,6 +18,7 @@ namespace CalamityMod.Projectiles.Boss public class HolyBomb : ModProjectile, ILocalizedModType { float SquishAnimation = 1f; + public int FireDamage = 0; public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() @@ -35,9 +38,19 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + FireDamage = Providence.FireDamage.CalculateProvidenceDamage(); + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + FireDamage = ProfanedGuardianDefender.FireDamage; + } + } public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 160, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 20); Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); @@ -62,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss SquishAnimation = 0f; if (Projectile.owner == Main.myPlayer) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, velocityY, ModContent.ProjectileType(), (int)Math.Round(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, velocityY, ModContent.ProjectileType(), FireDamage, Projectile.knockBack, Projectile.owner, 0f, 0f); } if (Projectile.ai[1] == 0f) @@ -129,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 160); + ProvUtils.ApplyDebuffs(target, 120); } } } 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 8cc4b52c1c..b64fc8f3e2 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 80, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -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); @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 80); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 4ae37dde93..b72f9b7df6 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 80, 10); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -56,10 +56,6 @@ namespace CalamityMod.Projectiles.Boss int playerTracker = Player.FindClosest(Projectile.Center, 1, 1); - // Natural damage is removed from GFB - if (Projectile.ai[1] == 0f && !Main.zenithWorld) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); - Projectile.ai[1] += 1f; if (Projectile.ai[1] < 180f && Projectile.ai[1] > 60f) { @@ -130,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 80); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index d07046f83a..85d5c1a5bb 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 120, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.35f, 0.275f, 0f); diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 00a92cabf5..a2d60a83e6 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 120, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.45f * Projectile.Opacity, 0.35f * Projectile.Opacity, 0f); diff --git a/Projectiles/Boss/HomingGasBulb.cs b/Projectiles/Boss/HomingGasBulb.cs index 8865901223..58c661a17a 100644 --- a/Projectiles/Boss/HomingGasBulb.cs +++ b/Projectiles/Boss/HomingGasBulb.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -56,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss float scaleFactor2 = Projectile.velocity.Length(); velocity.Normalize(); velocity *= scaleFactor2; - Projectile.velocity = (Projectile.velocity * 24f + velocity) / 25f; + Projectile.velocity = (Projectile.velocity * 22f + velocity) / (death ? 12f : 15f); // Tracking strength Projectile.velocity.Normalize(); Projectile.velocity *= scaleFactor2; } @@ -89,7 +90,8 @@ namespace CalamityMod.Projectiles.Boss { int type = ModContent.ProjectileType(); float ai0 = Main.rand.Next(3); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Normalize(Projectile.velocity) * 0.2f, type, (int)Math.Round(Projectile.damage * 0.8), 0f, Main.myPlayer, ai0); + int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Normalize(Projectile.velocity) * 0.2f, type, PlanteraAI.PinkCloudDamage, 0f, Main.myPlayer, ai0); + Main.projectile[proj].timeLeft = 180; } } } diff --git a/Projectiles/Boss/HomingGasBulbSporeGas.cs b/Projectiles/Boss/HomingGasBulbSporeGas.cs index d467e3eeb4..2fbf24928d 100644 --- a/Projectiles/Boss/HomingGasBulbSporeGas.cs +++ b/Projectiles/Boss/HomingGasBulbSporeGas.cs @@ -40,10 +40,9 @@ 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; } if (Projectile.localAI[0] > 255f) @@ -55,25 +54,23 @@ namespace CalamityMod.Projectiles.Boss float lightValues = (255 - Projectile.alpha) * 0.6f / 255f; Lighting.AddLight(Projectile.Center, lightValues, 0f, lightValues); - Projectile.alpha = (int)(100.0 + Projectile.localAI[0] * 0.7); 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) + { + Projectile.Opacity = Utils.GetLerpValue(0, 40, Projectile.timeLeft); + } } - public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f; + public override bool CanHitPlayer(Player target) => Projectile.Opacity > 0.8f; public override Color? GetAlpha(Color lightColor) { - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) - { - byte b2 = (byte)((26f - (Projectile.ai[1] - (CalamityWorld.LegendaryMode ? 600f : 900f))) * 10f); - byte a2 = (byte)(Projectile.alpha * (b2 / 255f)); - return new Color(b2, b2, b2, a2); - } - return new Color(255, 255, 255, Projectile.alpha); + return lightColor; } public override bool PreDraw(ref Color lightColor) @@ -93,7 +90,7 @@ namespace CalamityMod.Projectiles.Boss default: break; } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * Projectile.Opacity, 1, texture); return false; } @@ -102,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/HomingLaserDart.cs b/Projectiles/Boss/HomingLaserDart.cs index dc93ed2c2b..fd55783718 100644 --- a/Projectiles/Boss/HomingLaserDart.cs +++ b/Projectiles/Boss/HomingLaserDart.cs @@ -193,14 +193,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(BuffID.OnFire, 180); - } - public override Color? GetAlpha(Color lightColor) => new Color(255, 50, 50, Projectile.alpha); public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/IceBlast.cs b/Projectiles/Boss/IceBlast.cs index 5d27626298..2e152db191 100644 --- a/Projectiles/Boss/IceBlast.cs +++ b/Projectiles/Boss/IceBlast.cs @@ -92,7 +92,6 @@ namespace CalamityMod.Projectiles.Boss return; target.AddBuff(BuffID.Frostburn, 120, true); - target.AddBuff(BuffID.Chilled, 60, true); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index 4dc005054e..548dc997ad 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -78,13 +78,12 @@ namespace CalamityMod.Projectiles.Boss int totalProjectiles = 8; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = (int)Math.Round(Projectile.damage * 0.75); float velocity = 1f; Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vector255, type, damage, 0f, Projectile.owner, 1f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vector255, type, Cryogen.IceRainDamage, 0f, Projectile.owner, 1f, 0f); } } @@ -97,11 +96,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[0] >= 120f) - { - target.AddBuff(BuffID.Frostburn, 180, true); - target.AddBuff(BuffID.Chilled, 90, true); - } + target.AddBuff(BuffID.Frostburn, 180, true); } } } diff --git a/Projectiles/Boss/IceRain.cs b/Projectiles/Boss/IceRain.cs index 53674d6619..e2c4acdebe 100644 --- a/Projectiles/Boss/IceRain.cs +++ b/Projectiles/Boss/IceRain.cs @@ -106,7 +106,6 @@ namespace CalamityMod.Projectiles.Boss return; target.AddBuff(BuffID.Frostburn, 120, true); - target.AddBuff(BuffID.Chilled, 60, true); } } } diff --git a/Projectiles/Boss/IchorBlob.cs b/Projectiles/Boss/IchorBlob.cs index 479fb920eb..2281985e4c 100644 --- a/Projectiles/Boss/IchorBlob.cs +++ b/Projectiles/Boss/IchorBlob.cs @@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.localAI[1] <= 900f && Projectile.localAI[1] > 120f) - target.AddBuff(BuffID.Ichor, 240); + target.AddBuff(BuffID.Ichor, 360); } } } diff --git a/Projectiles/Boss/IchorShot.cs b/Projectiles/Boss/IchorShot.cs index f1e2338a03..5933ef2afd 100644 --- a/Projectiles/Boss/IchorShot.cs +++ b/Projectiles/Boss/IchorShot.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 240); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index dbfda46530..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,13 +130,10 @@ 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) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + Projectile.damage = Yharon.TornadoDamage; } public override bool CanHitPlayer(Player target) => 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 c73d5dc424..7b2c97c25d 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.timeLeft == 720) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + Projectile.damage = Yharon.TornadoDamage; } public override bool CanHitPlayer(Player target) => Projectile.timeLeft <= 720; @@ -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 664acc90b4..19d312fc7d 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -2,6 +2,7 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using CalamityMod.World; @@ -9,6 +10,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -16,6 +18,8 @@ namespace CalamityMod.Projectiles.Boss { public class MoltenBlast : ModProjectile, ILocalizedModType { + public int BlobDamage = 0; + private const int TimeLeft = 90; private const int AccelerationTime = 60; private const float Acceleration = 1.05f; @@ -39,6 +43,17 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + BlobDamage = Providence.BlobDamage.CalculateProvidenceDamage(); + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + BlobDamage = ProfanedGuardianDefender.BlobDamage; + } + } + public override void SendExtraAI(BinaryWriter writer) { writer.Write(Projectile.localAI[0]); @@ -53,7 +68,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 160, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 20); Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); @@ -153,10 +168,10 @@ 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(), (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), BlobDamage, 0f, Projectile.owner); } } @@ -171,7 +186,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 160); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 209481a110..07160d9da1 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 80, 10); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 80); + ProvUtils.ApplyDebuffs(target, 120); } } } 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/PlagueStingerGoliath.cs b/Projectiles/Boss/PlagueStingerGoliath.cs index 0f064415ea..dfa96ab31d 100644 --- a/Projectiles/Boss/PlagueStingerGoliath.cs +++ b/Projectiles/Boss/PlagueStingerGoliath.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/PlagueStingerGoliathV2.cs b/Projectiles/Boss/PlagueStingerGoliathV2.cs index cba5fae545..70a5a75a2c 100644 --- a/Projectiles/Boss/PlagueStingerGoliathV2.cs +++ b/Projectiles/Boss/PlagueStingerGoliathV2.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index 7ca90e54b2..4f73827498 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Boss } if (projScale == 1f) - ProvUtils.ApplyGFBDamage(Projectile, 400, 20); + ProvUtils.ApplyGFBDamage(Projectile, 240, 20); Projectile.scale = (float)Math.Sin(Projectile.localAI[0] * MathHelper.Pi / (scissorLasers ? 100f : 180f)) * 10f * projScale; if (Projectile.scale > projScale) @@ -240,7 +240,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 400); + ProvUtils.ApplyDebuffs(target, 240); } public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; diff --git a/Projectiles/Boss/QueenBeenade.cs b/Projectiles/Boss/QueenBeenade.cs index 4a2ff25994..952687ebf8 100644 --- a/Projectiles/Boss/QueenBeenade.cs +++ b/Projectiles/Boss/QueenBeenade.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -126,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss { float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; float speedY = (float)Main.rand.Next(-35, 36) * 0.02f; - Projectile.NewProjectile(Projectile.GetSource_Death(), Projectile.Center, new Vector2(speedX, speedY), type, (int)Math.Round(Projectile.damage * 0.85), 0f, Main.myPlayer, 0f, minVelocity, maxVelocity); + Projectile.NewProjectile(Projectile.GetSource_Death(), Projectile.Center, new Vector2(speedX, speedY), type, QueenBeeAI.BeenadeBeeDamage, 0f, Main.myPlayer, 0f, minVelocity, maxVelocity); } } } diff --git a/Projectiles/Boss/RavagerNuke.cs b/Projectiles/Boss/RavagerNuke.cs index b701bec6ac..09a008f4ff 100644 --- a/Projectiles/Boss/RavagerNuke.cs +++ b/Projectiles/Boss/RavagerNuke.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 44; Projectile.height = 44; Projectile.hostile = true; diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index 7f2f6405fa..8a241ad463 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -175,7 +175,7 @@ IL_25092: if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index 4941a9ffe3..d663afad52 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.Opacity != 1f) return; - target.AddBuff(ModContent.BuffType(), 40); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/SCalBrimstoneFireblast.cs b/Projectiles/Boss/SCalBrimstoneFireblast.cs index c8ae0a8a65..7fdd5e45b1 100644 --- a/Projectiles/Boss/SCalBrimstoneFireblast.cs +++ b/Projectiles/Boss/SCalBrimstoneFireblast.cs @@ -3,12 +3,15 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.CalClone; +using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using static Humanizer.In; @@ -20,6 +23,7 @@ namespace CalamityMod.Projectiles.Boss { public new string LocalizationCategory => "Projectiles.Boss"; public static readonly SoundStyle ImpactSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneFireblastImpact"); + public int DartDamage = 0; public bool withinRange = false; public bool setLifetime = false; public override void SetStaticDefaults() @@ -41,6 +45,19 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + DartDamage = SupremeCalamitas.DartDamage; + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + DartDamage = Cryogen.IceRainDamage; + else if (parent.type == ModContent.NPCType()) + DartDamage = CalamitasClone.DartDamage; + } + } + public override void AI() { Projectile.frameCounter++; @@ -213,7 +230,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, DartDamage, 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); } } diff --git a/Projectiles/Boss/SCalBrimstoneGigablast.cs b/Projectiles/Boss/SCalBrimstoneGigablast.cs index e9d0c5bc16..4cc65df873 100644 --- a/Projectiles/Boss/SCalBrimstoneGigablast.cs +++ b/Projectiles/Boss/SCalBrimstoneGigablast.cs @@ -3,12 +3,14 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Particles; @@ -19,6 +21,7 @@ namespace CalamityMod.Projectiles.Boss { public new string LocalizationCategory => "Projectiles.Boss"; public static readonly SoundStyle ImpactSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneGigablastImpact"); + public int DartDamage = 0; public bool withinRange = false; public bool setLifetime = false; public override void SetStaticDefaults() @@ -40,6 +43,17 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + DartDamage = SupremeCalamitas.DartDamage; + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + DartDamage = CalamitasClone.DartDamage; + } + } + public override void AI() { Projectile.frameCounter++; @@ -197,7 +211,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, DartDamage, 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); } } diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index 6db2345c81..2b5d10c0b6 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(BuffID.Venom, 180); } } } 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/SirenSong.cs b/Projectiles/Boss/SirenSong.cs index 8a343083b5..bf58180b67 100644 --- a/Projectiles/Boss/SirenSong.cs +++ b/Projectiles/Boss/SirenSong.cs @@ -78,13 +78,5 @@ namespace CalamityMod.Projectiles.Boss CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.Dazed, 120); - } } } diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 7cb58e9c83..0856f46a52 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -75,8 +75,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int type = ModContent.ProjectileType(); - int damage = Projectile.GetProjectileDamage(ModContent.NPCType()); - int nado = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, type, damage, 4f, Main.myPlayer, 16f, 50f); + int nado = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, type, Yharon.BordernadoDamage, 4f, Main.myPlayer, 16f, 50f); Main.projectile[nado].Bottom = Projectile.Center; Main.projectile[nado].netUpdate = true; } diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index f1527b37fd..f84715fe34 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 32; Projectile.height = 32; Projectile.hostile = true; @@ -50,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; @@ -69,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); } @@ -112,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/SupremeCataclysmFist.cs b/Projectiles/Boss/SupremeCataclysmFist.cs index ebc27bf2d3..0ed0cb59ab 100644 --- a/Projectiles/Boss/SupremeCataclysmFist.cs +++ b/Projectiles/Boss/SupremeCataclysmFist.cs @@ -280,13 +280,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => (Projectile.Opacity >= 1f || Projectile.ai[2] >= 3); - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(ModContent.BuffType(), 240, true); - } public override bool OnTileCollide(Vector2 oldVelocity) { SoundStyle b = new("CalamityMod/Sounds/Custom/Kickball"); 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 578220cb13..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. @@ -149,15 +149,14 @@ namespace CalamityMod.Projectiles.Boss Vector2 laserFirePosition = Main.npc[OwnerIndex].Center + beamDirection * distanceBetweenProjectiles; int laserCount = (int)(LaserLength / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); - int damage = Projectile.GetProjectileDamage(Main.npc[OwnerIndex].type); for (int i = 0; i < laserCount; i++) { int totalProjectiles = 2; 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; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserFirePosition, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f); + 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; } @@ -241,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/ThornBallSpike.cs b/Projectiles/Boss/ThornBallSpike.cs index 790a4288bb..e60fdf23eb 100644 --- a/Projectiles/Boss/ThornBallSpike.cs +++ b/Projectiles/Boss/ThornBallSpike.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; } - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 90); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 120); public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs index 8b54687e48..f0286ca08f 100644 --- a/Projectiles/Boss/ToxicCloud.cs +++ b/Projectiles/Boss/ToxicCloud.cs @@ -87,9 +87,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(BuffID.Poisoned, 240); - target.AddBuff(BuffID.Venom, 240); - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 480); } } } 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 2f8648e584..b7b87e1de4 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Boss public class YharonFireball : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; - private float speedX = -1f; - private float speedX2 = -2f; + private float speedX = -3f; + private float speedX2 = -5f; public override void SetStaticDefaults() { @@ -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; @@ -95,13 +94,13 @@ namespace CalamityMod.Projectiles.Boss { for (int x = 0; x < 3; x++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -6f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); - speedX += 1f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -50f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + speedX += 3f; } for (int x = 0; x < 2; x++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -6f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); - speedX2 += 4f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -75f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + speedX2 += 10f; } } Projectile.ExpandHitboxBy(144); diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index df9e249e70..96b9044f0d 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -29,10 +29,10 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; + Projectile.Opacity = 0.25f; Projectile.alpha = 255; Projectile.penetrate = -1; Projectile.timeLeft = 3600; @@ -60,21 +60,43 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; - if (Projectile.ai[0] < TimeBeforeFalling) + if (Projectile.velocity.Y >= -16f) { - Projectile.ai[0] += 1f; - Projectile.velocity.Y -= 0.1f; - if (Projectile.velocity.Y < MaxUpwardVelocity) - Projectile.velocity.Y = MaxUpwardVelocity; + if (Projectile.Opacity < 1f) + { + Projectile.Opacity = 1f; + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + int dustAmount = 36; + + for (int i = 0; i < dustAmount; i++) + { + Vector2 dustSpawnPosition = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.5f; + dustSpawnPosition = dustSpawnPosition.RotatedBy((double)((float)(i - (dustAmount / 2 - 1)) * MathHelper.TwoPi / (float)dustAmount), default) + Projectile.Center; + Vector2 dustVelocity = dustSpawnPosition - Projectile.Center; + + int dust = Dust.NewDust(dustSpawnPosition + dustVelocity, 0, 0, DustID.Pixie, dustVelocity.X, dustVelocity.Y); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = dustVelocity; + } + } + } + + if (Projectile.velocity.Y < -1f) + { + // 129 frames to get from -50 to -1 + Projectile.velocity.Y *= 0.97f; } else { - Projectile.velocity.X *= 0.8f; + // 85 frames to get from -1 to 16 Projectile.velocity.Y += 0.2f; - if (Projectile.velocity.Y > MaxDownwardVelocity) - Projectile.velocity.Y = MaxDownwardVelocity; + if (Projectile.velocity.Y > 16f) + Projectile.velocity.Y = 16f; } + Projectile.velocity.X *= 0.995f; + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; if (Projectile.localAI[0] == 0f) @@ -83,6 +105,13 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(FireballSound, Projectile.Center); } + if (Projectile.ai[0] >= 2f) + { + Projectile.alpha -= 25; + if (Projectile.alpha < 0) + Projectile.alpha = 0; + } + if (Main.rand.NextBool(16)) { Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 200, default, 1f); @@ -91,6 +120,7 @@ namespace CalamityMod.Projectiles.Boss } } + public override bool CanHitPlayer(Player target) => Projectile.velocity.Y >= -16f; public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 42280745b3..b3e0db582e 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -14,10 +14,14 @@ using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; using CalamityMod.Items.Fishing.FishingRods; +using CalamityMod.Items.Armor.Daedalus; +using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlagueEnemies; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Healing; @@ -190,21 +194,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; @@ -265,10 +254,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. @@ -410,12 +395,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 @@ -455,10 +434,6 @@ namespace CalamityMod.Projectiles projectile.Kill(); } - // Chlorophyte Crystal AI rework. - if (projectile.type == ProjectileID.CrystalLeaf) - return ChlorophyteCrystalAI.DoChlorophyteCrystalAI(projectile); - if (projectile.minion && ExplosiveEnchantCountdown > 0) { ExplosiveEnchantCountdown--; @@ -1043,112 +1018,9 @@ namespace CalamityMod.Projectiles } } - else if (projectile.type == ProjectileID.Sharknado) - { - projectile.damage = projectile.GetProjectileDamage(NPCID.DukeFishron); - - 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) { - projectile.damage = projectile.GetProjectileDamage(NPCID.DukeFishron); - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { bool death = CalamityWorld.death || BossRushEvent.BossRushActive; @@ -2293,7 +2165,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; @@ -2504,7 +2376,7 @@ namespace CalamityMod.Projectiles for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center + Vector2.Normalize(velocity2) * 16f, velocity2, type, (int)Math.Round(projectile.damage * 0.8), 0f, Main.myPlayer); + Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center + Vector2.Normalize(velocity2) * 16f, velocity2, type, PlanteraAI.ThornBallSpikeDamage, 0f, Main.myPlayer); } } @@ -2561,110 +2433,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) @@ -2892,7 +2660,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; } @@ -3866,22 +3634,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; } @@ -4047,6 +3812,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)) { @@ -4137,36 +3914,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())) @@ -4252,10 +3999,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); @@ -4420,7 +4166,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) { @@ -4594,22 +4340,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 @@ -4690,31 +4429,46 @@ 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) mult += 0.5f; speed *= mult; @@ -4854,7 +4608,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) { @@ -4880,18 +4640,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 @@ -4909,7 +4666,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); } @@ -5159,13 +4916,6 @@ namespace CalamityMod.Projectiles shouldDrawBool = false; } - // Chlorophyte Crystal AI rework. - if (projectile.type == ProjectileID.CrystalLeaf) - { - ChlorophyteCrystalAI.DoChlorophyteCrystalDrawing(projectile); - shouldDrawBool = false; - } - if (Main.LocalPlayer.Calamity().trippy) OddMushroomProjectileDrawing(projectile); @@ -5316,7 +5066,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) { @@ -5392,17 +5141,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 1e8a7636c2..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,384 +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.BombSkeletronPrime, defenseDamage }, - { ProjectileID.CannonballHostile, defenseDamage }, + #region CATEGORY 4: Defense Damage support { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados - { ProjectileID.CultistBossFireBall, defenseDamage }, - { ProjectileID.CultistBossIceMist, defenseDamage }, - { ProjectileID.CultistBossLightningOrbArc, defenseDamage }, // Reused by Storm Weaver - { ProjectileID.DD2BetsyFireball, defenseDamage }, { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, { ProjectileID.DeerclopsIceSpike, defenseDamage }, - { ProjectileID.DeerclopsRangedProjectile, defenseDamage }, // Deerclops rubble - { ProjectileID.DemonSickle, defenseDamage }, - { ProjectileID.FairyQueenLance, defenseDamage }, // Empress of Light's lance walls { ProjectileID.FairyQueenSunDance, defenseDamage }, // Empress of Light's Sun Dance { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes - { ProjectileID.FrostWave, defenseDamage }, // Ice Queen frost waves, reused by Storm Weaver - { ProjectileID.HallowBossLastingRainbow, defenseDamage }, // Empress of Light's lingering rainbow trail hitboxes { 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.QueenSlimeSmash, defenseDamage }, - { ProjectileID.RocketSkeleton, defenseDamage }, // Skeleton Commando rockets, reused by Rev+ Skeletron Prime - { 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 @@ -851,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/AugerHoldout.cs b/Projectiles/DraedonsArsenal/AugerHoldout.cs new file mode 100644 index 0000000000..50ddab506d --- /dev/null +++ b/Projectiles/DraedonsArsenal/AugerHoldout.cs @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; +using static Terraria.Player; + + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AugerHoldout : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float attackTimer => ref Projectile.ai[0]; + public Player Owner => Main.player[Projectile.owner]; + public float scaleFx = 1; + public int fireRate => Owner.itemAnimationMax; + public int time = 0; + public bool longSwing => swingCount >= 2; + public int cooldown => -Owner.itemAnimationMax * (Owner.Calamity().buffedAuger ? 2 : longSwing ? 3 : 1); + public float bladeRot = 0; // Rotation of the blade + public int swingCount = 0; // Increases at the start of a swing + public float bladefx = 0; // Scaling on the effects of the blade + // Both checks to make sure sounds/hitboxes only happen once per swing + public bool makeSound = true; + public bool makeHitbox = true; + public int cooldownGiven => (int)(400 / Owner.GetAttackSpeed()); // Cooldown is effected by melee speed, lines up perfectly so you do 10 swings and end in time for a big swing + public float pullFx = 1; // Scaling on the effects of the blade when it's buffed + public bool pressedRight = false; + // Spawns a hitbox to do damage, rather than dealing damage itself + // Theres many reasons this is better, but at the very least it prevents bloating this single projectile's code + public override bool? CanDamage() => false; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 100; + Projectile.friendly = true; + Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.timeLeft = 5; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public void Positioning(Vector2 toMouse) // Hand and holdout positioning + { + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Owner.direction).ToRotation(); + + Owner.ChangeDir(Math.Sign(toMouse.X)); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, (toMouse.ToRotation() + bladeRot * Owner.direction + MathHelper.PiOver2 * -Owner.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Vector2 handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.None, Owner.compositeFrontArm.rotation) + (Owner.compositeFrontArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 9; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, armRotation); + Projectile.velocity = toMouse.RotatedBy(bladeRot * Owner.direction); + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.Center = handPos; + } + public void OnSpawn() + { + if (time == 0) + { + scaleFx = Owner.Calamity().buffedAuger ? 1.5f : 1; + attackTimer = cooldown; + if (Owner.Calamity().buffedAuger) + { + swingCount = 1; + } + } + } + public override void AI() + { + if (!Owner.CantUseHoldout(false)) + Projectile.timeLeft = 5; + + Vector2 toMouse = Utils.DirectionTo(Owner.Center, Owner.ClampedMouseWorld()); + + Positioning(toMouse); + + if (Owner.Calamity().mouseRight) + pressedRight = true; + + #region Right Click + if (Projectile.ai[2] > 0) // Right click "gravity well" and buff + { + if (Projectile.ai[2] == 5) + { + time = 0; + attackTimer = 0; + swingCount = -1; + makeHitbox = true; + Projectile.ai[2]--; + pullFx = 5; + } + if (bladefx > 0) + bladefx = 0; + bladeRot = 0; + pullFx = MathHelper.Lerp(pullFx, 1, 0.12f); + + if (attackTimer > fireRate && makeHitbox) + { + Projectile magnetZone = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.ClampedMouseWorld(), Vector2.Zero, ModContent.ProjectileType(), 0, 0, Projectile.owner, 0, 0, 0); + + SoundStyle pull = new("CalamityMod/Sounds/Item/AugerPull"); + SoundEngine.PlaySound(pull with { Volume = 0.9f, Pitch = 0 }, Owner.ClampedMouseWorld()); + Owner.Calamity().buffedAuger = true; + Owner.Calamity().arsenalCooldown = cooldownGiven; + Owner.AddCooldown(ArsenalPower.ID, cooldownGiven); + makeHitbox = false; + } + if (attackTimer >= fireRate * 2) + { + Projectile.Kill(); + return; + } + time++; + attackTimer++; + return; + } + #endregion + + OnSpawn(); + + if (scaleFx > 1 && !Owner.Calamity().buffedAuger) // Fade out the extra size from the big blade + scaleFx = MathHelper.Lerp(scaleFx, 1, 0.15f * Owner.GetAttackSpeed()); + + #region Not Swinging + if (attackTimer < 0) // When the sword isn't swinging + { + if ((pressedRight || Owner.Calamity().mouseRight) && !Owner.Calamity().buffedAuger && Owner.Calamity().arsenalCooldown <= 0) + Projectile.ai[2] = 5; + else + pressedRight = false; + if (longSwing && attackTimer == -1) + { + swingCount = 0; + } + attackTimer++; + time++; + + if (longSwing && attackTimer <= cooldown * 0.35f) + { + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + bladefx = MathHelper.Lerp(bladefx, 0, lerp); + } + else + { + if (!Main.mouseLeft && longSwing && !Owner.Calamity().buffedAuger) + { + Projectile.Kill(); + return; + } + + float lerp = Utils.GetLerpValue((longSwing ? cooldown * 0.35f : cooldown), -1, attackTimer, true); + bladefx = MathHelper.Lerp(bladefx, 1.5f, lerp); + } + if (attackTimer >= cooldown * 0.3f) + { + if (makeSound && Owner.Calamity().buffedAuger) // Windup Sound + { + SoundStyle windup = new("CalamityMod/Sounds/Item/AugerWindup"); + SoundEngine.PlaySound(windup with { Volume = 0.9f, Pitch = 0 }, Projectile.Center); + makeSound = false; + } + } + if (attackTimer == 0) // Reset a few things in prep for the next swing + { + pressedRight = false; + swingCount++; + makeSound = true; + makeHitbox = true; + } + else // Wind up animation in prep for the next swing + { + int swingDir = (swingCount % 2 != 0 ? 1 : -1); + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + bladeRot = MathHelper.Lerp(-MathHelper.Pi * swingDir, -MathHelper.PiOver4 * 3 * swingDir, CalamityUtils.EaseInOutExp(lerp, 2f, 2f)); + } + return; + } + #endregion + + if (attackTimer >= fireRate) // Once the swing is done, put it on cooldown + { + attackTimer = cooldown * (Owner.Calamity().buffedAuger ? 3 : 1); + if (Owner.Calamity().buffedAuger) + { + Owner.Calamity().buffedAuger = false; + } + } + else // Do the swing + { + #region Swinging + int swingDir = (swingCount % 2 != 0 ? -1 : 1); + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + bladeRot = MathHelper.Lerp(-MathHelper.PiOver4 * 3 * swingDir, MathHelper.Pi * swingDir, CalamityUtils.EaseInOutExp(lerp, 5f, 3f)); + + if (lerp > 0.5f) // Halfway through make the hitbox and sound + { + if (makeHitbox) + { + SoundStyle swing = Owner.Calamity().buffedAuger ? new("CalamityMod/Sounds/Item/AugerBigSlash") : swingCount % 2 != 0 ? new("CalamityMod/Sounds/Item/AugerSlash1") : new("CalamityMod/Sounds/Item/AugerSlash2"); + SoundEngine.PlaySound(swing with { Volume = Owner.Calamity().buffedAuger ? 1f : 0.7f, Pitch = -0.1f, MaxInstances = 2 }, Projectile.Center); + + int damage = Projectile.damage; + if (Owner.Calamity().buffedAuger) + { + Owner.Calamity().GeneralScreenShakePower = 5f; + damage = (int)(damage * 2.5f); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + toMouse * 20 * (float)Math.Pow(scaleFx, 4), toMouse * 25, ModContent.ProjectileType(), damage, 0, Projectile.owner, 0, swingCount, Owner.Calamity().buffedAuger ? 5 : 0); + makeHitbox = false; + } + } + #endregion + } + time++; + attackTimer++; + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 3) + return false; + + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AugerHoldout").Value; + Texture2D glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AugerHoldoutGlow").Value; + Texture2D blade = ModContent.Request("CalamityMod/Particles/GlowBlade").Value; + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + float randSize = Main.rand.NextFloat(0.8f, 1f); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Owner.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Owner.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + float length = MathHelper.Lerp(0f, 0.1f, CalamityUtils.EaseInOutExp(lerp, 1f, 1f)); + float bladeRotation = drawRotation + MathHelper.PiOver2 * Owner.direction; + Vector2 bladePlaceAdjust = (bladeRotation - MathHelper.PiOver2).ToRotationVector2(); + for (int i = 0; i < 2; i++) // The actual energy blade + Main.EntitySpriteDraw(blade, drawPosition + bladePlaceAdjust * 20, null, (i == 0 ? Effects.ArsenalEffects.ArsenalGaussColor : Color.White) with { A = 0 }, bladeRotation, new Vector2(blade.Width / 2, blade.Height), new Vector2((i == 0 ? 0.2f : 0.1f) * randSize, 0.2f * bladefx) * Projectile.scale * 0.07f * bladefx * scaleFx, SpriteEffects.None); + for (int i = 0; i < 2; i++) // The glow at the "hilt" + Main.EntitySpriteDraw(bloom, drawPosition + bladePlaceAdjust * 20, null, (i == 0 ? Effects.ArsenalEffects.ArsenalGaussColor : Color.White) with { A = 0 }, bladeRotation, bloom.Size() / 2, (Projectile.ai[2] > 0 ? new Vector2(randSize, randSize * (i == 0 ? 1f : 0.9f)) * 0.1f : new Vector2(0.15f * bladefx * randSize, (i == 0 ? 0.1f : 0.05f))) * Projectile.scale * 0.9f * (Projectile.ai[2] > 0 ? pullFx : bladefx) * scaleFx, SpriteEffects.None); + + if (scaleFx > 1) // Extra blade tips for the improved slash + { + for (int b = -2; b <= 2; b++) + { + if (b == 0) b++; + for (int i = 0; i < 2; i++) + { + Main.EntitySpriteDraw(blade, drawPosition + bladePlaceAdjust * 20, null, (i == 0 ? Effects.ArsenalEffects.ArsenalGaussColor : Color.White) with { A = 0 }, bladeRotation + (MathHelper.PiOver4 * 0.55f * b), new Vector2(blade.Width / 2, blade.Height), new Vector2(0.65f * (i == 0 ? 0.1f : 0.05f), 0.09f * (i == 0 ? 1f : 0.9f) * (2 - Math.Abs(b * 0.5f))) * randSize * Projectile.scale * 0.2f * bladefx * (scaleFx - 1), SpriteEffects.None); + } + } + } + Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f; + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The holdout + + Main.EntitySpriteDraw(glow, drawPosition + placeAdjust, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The glow + + 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/DraedonsArsenal/AugerHoldout.png b/Projectiles/DraedonsArsenal/AugerHoldout.png new file mode 100644 index 0000000000..ec5c4b477a Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerHoldout.png differ diff --git a/Projectiles/DraedonsArsenal/AugerHoldoutGlow.png b/Projectiles/DraedonsArsenal/AugerHoldoutGlow.png new file mode 100644 index 0000000000..63a21f6979 Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerHoldoutGlow.png differ diff --git a/Projectiles/DraedonsArsenal/AugerPull.cs b/Projectiles/DraedonsArsenal/AugerPull.cs new file mode 100644 index 0000000000..4362c1686c --- /dev/null +++ b/Projectiles/DraedonsArsenal/AugerPull.cs @@ -0,0 +1,109 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AugerPull : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public int time = 0; + public float sine = 0; + public float shrink = 1; + public int strongTimer = 0; + public bool strong => strongTimer < 10; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 250; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.tileCollide = false; + Projectile.timeLeft = 90; + Projectile.penetrate = -1; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + + public override void AI() + { + if (strongTimer == 0) + { + Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalGaussColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, 0, 1.1f, 0.7f, 30); + GeneralParticleHandler.SpawnParticle(bolt2); + for (int i = 0; i < 20; i++) + { + Vector2 dustVel2 = (Vector2.UnitX).RotatedByRandom(100) * Main.rand.NextFloat(10f, 15.5f); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + dustVel2.SafeNormalize(Vector2.UnitX) * 360, ModContent.DustType(), -dustVel2 * 1.5f, 0, default, Main.rand.NextFloat(1.2f, 1.8f)); + dust2.noGravity = true; + dust2.fadeIn = 0.3f; + dust2.color = Effects.ArsenalEffects.ArsenalGaussColor; + } + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC target = Main.npc[i]; + if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < 650) + { + Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX); + target.velocity = moveDir * 20; + target.Center += moveDir * 3f; + } + } + } + + Vector2 dustVel = (Vector2.UnitX).RotatedByRandom(100) * Main.rand.NextFloat(3f, 8.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + dustVel.SafeNormalize(Vector2.UnitX) * 120, Effects.ArsenalEffects.ArsenalGaussDust, -dustVel, 0, default, Main.rand.NextFloat(0.5f, 1f)); + dust.noGravity = true; + dust.fadeIn = 0.05f; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + + if (Projectile.timeLeft > 2) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC target = Main.npc[i]; + if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1)) + { + if (Vector2.Distance(target.Center, Projectile.Center) > 15 && Vector2.Distance(target.Center, Projectile.Center) < 300) + { + Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX); + target.velocity = Vector2.Lerp(target.velocity, moveDir * 18, 0.12f); + target.Center += moveDir * 2f; + } + } + } + } + + Projectile.rotation += 0.05f; + if (shrink > 0) + shrink -= 0.05f; + else + shrink = 1; + + if (!strong) + time++; + strongTimer++; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => false; + public override bool PreDraw(ref Color lightColor) + { + float shrinkFade = Math.Min(Utils.GetLerpValue(1, 0.7f, shrink, true), Utils.GetLerpValue(0f, 0.3f, shrink, true)); + float sine = Math.Abs(MathHelper.Lerp((float)Math.Sin(time * 0.1f / MathHelper.Pi), 0.4f, 0.8f)); + float sine2 = Math.Abs(MathHelper.Lerp((float)Math.Sin(time * 0.3f / MathHelper.Pi), 0.4f, 0.8f)); + float fade = (float)Math.Pow(Utils.GetLerpValue(0, 10, Projectile.timeLeft, true), 3); + float areaScale = (strong ? 1f : 1) * fade; + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/GlowSquareParticleBig").Value; + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * (strong ? 0.5f : 0.3f) * shrinkFade; + + Main.EntitySpriteDraw(tex2, Projectile.Center - Main.screenPosition, null, drawColor, MathHelper.PiOver4 - MathHelper.PiOver2 * sine * 3, tex2.Size() / 2f, (areaScale + sine * 0.5f) * shrink, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex2, Projectile.Center - Main.screenPosition, null, drawColor, MathHelper.PiOver2 * sine2 * 3, tex2.Size() / 2f, (areaScale - sine2 * 0.5f) * (float)Math.Pow(shrink, 2), SpriteEffects.None, 0); + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/AugerSlash.cs b/Projectiles/DraedonsArsenal/AugerSlash.cs new file mode 100644 index 0000000000..6ead6c5d0c --- /dev/null +++ b/Projectiles/DraedonsArsenal/AugerSlash.cs @@ -0,0 +1,155 @@ +using System; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AugerSlash : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float time => ref Projectile.ai[0]; + public float fade = 1; + public int lifetime = 25; + public Player Owner => Main.player[Projectile.owner]; + public float scaleFx => Projectile.ai[2] == 5 ? 2 : 1; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 120; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.timeLeft = lifetime; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + fade = (float)Math.Pow(Utils.GetLerpValue(lifetime * 0.1f, lifetime * 0.5f, Projectile.timeLeft, true), 4); + if (Projectile.velocity.Length() > 0.1f) + Projectile.velocity *= 0.45f; + int dusts = (int)(30 * scaleFx); + if (time == 1) + { + for (int i = 0; i < dusts; i++) + { + float variance = Utils.GetLerpValue(0, dusts, i, true) * Main.rand.NextFloat(0.9f, 1f); + float rot = MathHelper.Lerp(-0.7f * scaleFx, 0.7f * scaleFx, variance) * Projectile.direction; + float swingDirScale = Projectile.ai[1] == 1 ? (1 - variance) : variance; + float scale = 0.4f + swingDirScale * 2f; + float rotScaling = 1 - Math.Abs(rot); + Vector2 vel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(rot) * (70 / scaleFx + 80 * (float)Math.Pow(rotScaling, 1.5f) * Main.rand.NextFloat(0.85f, 1f)) * scaleFx; + Vector2 finalDustVel = (vel * (float)Math.Pow(rotScaling, 1.5f) + (vel.RotatedBy(-MathHelper.PiOver2 * rot) * 1.5f)) * 0.03f; + Dust s = Dust.NewDustPerfect(Projectile.Center + vel - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 45 * scaleFx, ModContent.DustType(), finalDustVel / scaleFx); + s.scale = scale * scaleFx; + s.noGravity = true; + s.color = Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor, Color.White, Math.Max(0, swingDirScale - 0.35f)); + s.fadeIn = 0.1f + swingDirScale; + } + } + + Lighting.AddLight(Projectile.Center, Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor, Color.White, 0.3f).ToVector3() * 0.7f); + time++; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Projectile.numHits > 0) + { + Projectile.numHits -= 1; + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.ai[2] == 5) + { + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() && p.owner == Projectile.owner) + { + if (p.timeLeft > 2) + p.timeLeft = 2; + } + } + } + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = (Projectile.ai[2] == 5 ? 35 : 14); + target.MoveNPC(launchVel, launchPower, true); + + if (Projectile.ai[2] == 5) + modifiers.SetCrit(); + + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + float minMult = 0.3f; + int hitsToMinMult = 7; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= (Projectile.ai[2] == 5 ? (1f + critDamage) : 1) * damageMult; + + if (Projectile.numHits == 0) + { + SoundStyle hit = new("CalamityMod/Sounds/Item/AugerHit"); + SoundEngine.PlaySound(hit with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = 2 }, target.Center); + } + if (Projectile.numHits < 4) + { + for (int i = 0; i < (14 - Projectile.numHits * 2); i++) + { + float rot = Main.rand.NextFloat(-0.3f, 0.3f); + Dust s = Dust.NewDustPerfect(target.Center, ModContent.DustType(), Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(rot) * (float)Math.Pow(scaleFx, 1.5f) * Main.rand.NextFloat(8, 12) * (1 - Math.Abs(rot))); + s.scale = Main.rand.NextFloat(1.6f, 1.9f) * (1 - Math.Abs(rot)); + s.noGravity = true; + s.color = Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor, Color.White, Main.rand.NextFloat(0, 0.4f)); + s.fadeIn = -0.5f; + if (i % 3 != 0) + { + Dust s2 = Dust.NewDustPerfect(target.Center, Effects.ArsenalEffects.ArsenalGaussDust, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.6f) * (float)Math.Pow(scaleFx, 1.5f) * Main.rand.NextFloat(5, 10)); + s2.scale = Main.rand.NextFloat(0.9f, 1.4f); + s2.noGravity = true; + s2.color = Effects.ArsenalEffects.ArsenalGaussColor; + } + } + } + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (Projectile.timeLeft <= 10) + return false; + Player Owner = Main.player[Projectile.owner]; + Vector2 start = (time < 2 ? Owner.Center : Projectile.Center); + float scale = (scaleFx > 1 ? 1.5f : 1); + float length = 135 * scale; + float size = 135 * scale; + float _ = float.NaN; + bool hit = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, start + Projectile.velocity.SafeNormalize(Vector2.UnitX) * length, size, ref _); + return (hit); + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D proj = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AugerSlash").Value; + + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }; + float drawRotation = Projectile.velocity.ToRotation(); + + float lerp = 1 - (float)Math.Pow((Utils.GetLerpValue(lifetime, 0, time, true)), 2f); + float sizeLerp = (float)Math.Pow((Utils.GetLerpValue(lifetime, lifetime * 0.2f, time, true)), 5f); + Vector2 squash = new Vector2(1 + lerp * 0.5f, 1.25f - lerp * 1.1f) * 0.08f * sizeLerp; + Vector2 rotationPoint = new Vector2(proj.Width * 0.85f, proj.Height / 2); + Vector2 drawPosition = Projectile.Center - Main.screenPosition + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 105; + + SpriteEffects spfx = (Projectile.ai[1] != 1 ? SpriteEffects.None : SpriteEffects.FlipVertically); + if (Projectile.direction == -1) + spfx = (Projectile.ai[1] == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically); + Main.EntitySpriteDraw(proj, drawPosition, null, Color.White with { A = 0 } * sizeLerp, drawRotation, rotationPoint, squash * Projectile.scale * scaleFx, spfx); + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/AugerSlash.png b/Projectiles/DraedonsArsenal/AugerSlash.png new file mode 100644 index 0000000000..c2643dcb63 Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerSlash.png differ diff --git a/Projectiles/DraedonsArsenal/AugerSlashAlt.png b/Projectiles/DraedonsArsenal/AugerSlashAlt.png new file mode 100644 index 0000000000..38d9b158cb Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerSlashAlt.png differ 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/Enemy/SulphuricAcidMist.cs b/Projectiles/Enemy/SulphuricAcidMist.cs index f1f5d6b825..2ad2cea566 100644 --- a/Projectiles/Enemy/SulphuricAcidMist.cs +++ b/Projectiles/Enemy/SulphuricAcidMist.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Enemy return; if (Projectile.Opacity >= 0.9f) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/Projectiles/Enemy/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs index ed74fd0215..002c255f37 100644 --- a/Projectiles/Enemy/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetDefaults() { + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 10; Projectile.height = 10; Projectile.hostile = true; 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/PrimordialAncientProjectile.cs b/Projectiles/Magic/PrimordialAncientProjectile.cs index aa9db9e1f2..b8d71258ae 100644 --- a/Projectiles/Magic/PrimordialAncientProjectile.cs +++ b/Projectiles/Magic/PrimordialAncientProjectile.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Magic if (buffList[playerIndex] == false) { buffList[playerIndex] = true; - player.AddBuff(ModContent.BuffType(), 900); + player.AddBuff(ModContent.BuffType(), 1080); int Dusts = 8; float radians = MathHelper.TwoPi / Dusts; diff --git a/Projectiles/Magic/SHPV.cs b/Projectiles/Magic/SHPV.cs index 8a9f05313e..454e42905e 100644 --- a/Projectiles/Magic/SHPV.cs +++ b/Projectiles/Magic/SHPV.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, Owner.Center); Vector2 laserPos = TipPosition + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-7f, 7f); Vector2 laserVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 20f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserPos, laserVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25f), 3f, Projectile.owner, SoulColors[0]); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserPos, laserVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.35f), 3f, Projectile.owner, SoulColors[0]); if (ConsumeSoul) { 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/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 29a8413530..5286f392d9 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Melee { CalamityPlayer modPlayer = Main.player[Projectile.owner].Calamity(); modPlayer.dragonRageHits++; - if (modPlayer.dragonRageHits > 10 && modPlayer.dragonRageCooldown <= 0) + if (modPlayer.dragonRageHits >= 10 && modPlayer.dragonRageCooldown <= 0) { SpawnFireballs(); modPlayer.dragonRageHits = 0; 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/MendedBiomeBlade_DecaysRetortDash.cs b/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs index fb19dc0660..cc6e39ef9c 100644 --- a/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs +++ b/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs @@ -24,15 +24,13 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; - Projectile.width = Projectile.height = 8; + Projectile.width = Projectile.height = 80; Projectile.tileCollide = false; Projectile.friendly = true; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 60; Projectile.timeLeft = 20; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index 7a7fc8cb16..68bc6ca463 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLength = 100 * Projectile.scale; + float bladeLength = 105 * Projectile.scale; float bladeWidth = 20 * Projectile.scale; return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Melee //Manage position and rotation - Projectile.scale = 1 + Empowerment / maxEmpowerment * 1.5f; + Projectile.scale = 1 + Empowerment / maxEmpowerment * 1.85f; oldDirection = direction; direction = direction.RotatedBy(MathHelper.Clamp(Empowerment * 1.1f / maxEmpowerment, 0.45f, 1f) * MathHelper.PiOver4 * 0.20f); @@ -222,6 +222,8 @@ namespace CalamityMod.Projectiles.Melee modifiers.SourceDamage *= MathHelper.Lerp(1f, TrueBiomeBlade.HolyAttunement_ThrowDamageBoost, Empowerment / maxEmpowerment); else modifiers.SourceDamage *= MathHelper.Lerp(TrueBiomeBlade.HolyAttunement_BaseSwingDamageMult, TrueBiomeBlade.HolyAttunement_FullSwingDamageMult, Empowerment / maxEmpowerment); + + modifiers.HitDirectionOverride = (Owner.Center.X > target.Center.X).ToDirectionInt(); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs index d2ada56839..a9e9b8c3b8 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 102; Projectile.scale = Scale; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.idStaticNPCHitCooldown = 20; Projectile.hide = true; } diff --git a/Projectiles/Melee/MonstrousKnife.cs b/Projectiles/Melee/MonstrousKnife.cs index 435b102ffb..26a473b776 100644 --- a/Projectiles/Melee/MonstrousKnife.cs +++ b/Projectiles/Melee/MonstrousKnife.cs @@ -47,6 +47,6 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 2f); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 3f); } } 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/SeekingScorcherProj.cs b/Projectiles/Melee/SeekingScorcherProj.cs index 8b7f83e462..2d5274a83c 100644 --- a/Projectiles/Melee/SeekingScorcherProj.cs +++ b/Projectiles/Melee/SeekingScorcherProj.cs @@ -28,8 +28,9 @@ namespace CalamityMod.Projectiles.Melee public static float CrystalBounceDamageMult = 2f; // Exponential scaling for multiple bounces but capped at max bounces public static float CrystalBounceSpeedMult = 1.25f; public static int MaxBounces = 3; - public const float MaxNPCHomingRange = 1200f; // 75 tiles - public const float MaxAxeHomingRange = 800f; // 50 tiles + public const float MaxNPCHomingRange = 960f; // 60 tiles + up to 3x empowerment boosts + public const float MaxAxeHomingRange = 640f; // 40 tiles + up to 2x empowerment boosts + public const float BonusRangePerEmpowerment = 80f; // 5 tiles private List PreviousNPCs = new List() { -1 }; public Player Owner => Main.player[Projectile.owner]; @@ -126,6 +127,9 @@ namespace CalamityMod.Projectiles.Melee // Cause the axe that just hit to be empowered and counts as a bounce proj.damage = Math.Clamp((int)(proj.damage * CrystalBounceDamageMult), 0, (int)(proj.originalDamage * MathF.Pow(CrystalBounceDamageMult, MaxBounces))); proj.velocity = proj.velocity.RotatedBy(Main.rand.NextBool() ? MathHelper.ToRadians(Main.rand.NextFloat(108f, 162f)) : MathHelper.ToRadians(Main.rand.NextFloat(-162f, -108f))) * CrystalBounceSpeedMult; + if (proj.MaxUpdates < 5) + proj.MaxUpdates++; + proj.ai[1] -= 30f; proj.ai[2] = -1f; proj.netUpdate = true; @@ -270,7 +274,7 @@ namespace CalamityMod.Projectiles.Melee return; } - float range = MaxNPCHomingRange; + float range = MaxNPCHomingRange + BonusRangePerEmpowerment * (Projectile.MaxUpdates - 2); int targetNPC = -1; foreach (NPC target in Main.ActiveNPCs) { @@ -289,7 +293,7 @@ namespace CalamityMod.Projectiles.Melee { // Will only try to bounce towards nearby axes if there are nearby enemies as to not waste axe hits // The last usable pierce will never be spent on an axe since it would then just return to the player - float range2 = MaxAxeHomingRange; + float range2 = MaxAxeHomingRange + BonusRangePerEmpowerment * (Projectile.MaxUpdates - 2); int targetAxe = -1; foreach (Projectile proj in Main.ActiveProjectiles) { @@ -326,6 +330,7 @@ namespace CalamityMod.Projectiles.Melee { // Swiftly move back towards the player; also make it avoid naturally despawning Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * Projectile.velocity.Length(); + Projectile.MaxUpdates = 2; Projectile.timeLeft = 2; // Delete the Projectile if it touches its owner or too far away. 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/StellarStrikerHoldout.cs b/Projectiles/Melee/StellarStrikerHoldout.cs index fbe8a21069..55223e03c3 100644 --- a/Projectiles/Melee/StellarStrikerHoldout.cs +++ b/Projectiles/Melee/StellarStrikerHoldout.cs @@ -220,7 +220,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(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner, 0, 0, 7); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner, 0, 0, 7); spawnBoom = false; } 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/TriactisHammerExplosion.cs b/Projectiles/Melee/TriactisHammerExplosion.cs index af160569b0..bafc5da605 100644 --- a/Projectiles/Melee/TriactisHammerExplosion.cs +++ b/Projectiles/Melee/TriactisHammerExplosion.cs @@ -84,7 +84,11 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 640f, targetHitbox); - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + 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); + } internal float WidthFunction(float completionRatio) => MathHelper.Clamp(CalamityUtils.Convert01To010(completionRatio * 2), 0.2f, 1f) * 4f; internal Color ColorFunction(float completionRatio) => Color.White; 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/M1GarandBulletCasing.cs b/Projectiles/Ranged/M1GarandBulletCasing.cs new file mode 100644 index 0000000000..50acf6549c --- /dev/null +++ b/Projectiles/Ranged/M1GarandBulletCasing.cs @@ -0,0 +1,66 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class M1GarandBulletCasing : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Ranged/M1GarandBulletCasing"; + public int Time = 0; + public bool TouchedGrass = false; + + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 12; + Projectile.friendly = true; + Projectile.ignoreWater = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = -1; + Projectile.timeLeft = 300; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Projectile.scale = 1f; + Projectile.extraUpdates = 1; + Time++; + Player Owner = Main.player[Projectile.owner]; + if (!TouchedGrass) + { + if (Projectile.timeLeft <= 240) + Projectile.rotation += 0.04f * Projectile.direction; + else + Projectile.rotation = (new Vector2(0, -5 * Projectile.direction) + Projectile.velocity * -1.2f).ToRotation(); + + Projectile.velocity.Y += 0.087f; + Projectile.velocity.X *= 0.99f; + + if (Main.rand.NextBool(3)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, 303, -Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.2f, 1f), 140, default, Main.rand.NextFloat(0.35f, 0.5f)); + dust.noGravity = false; + dust.color = Color.White; + } + } + else + { + Projectile.velocity = Vector2.Zero; + } + Projectile.alpha = (int)(255 * Utils.GetLerpValue(60, 0, Projectile.timeLeft, true)); + if (Collision.SolidCollision(Projectile.Center - Projectile.velocity * 1.5f, 2, 2)) + Projectile.tileCollide = true; + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + Projectile.damage = 0; + TouchedGrass = true; + Projectile.velocity = Vector2.Zero; + return false; + } + } +} diff --git a/Projectiles/Ranged/M1GarandBulletCasing.png b/Projectiles/Ranged/M1GarandBulletCasing.png new file mode 100644 index 0000000000..2e3aeeab4f Binary files /dev/null and b/Projectiles/Ranged/M1GarandBulletCasing.png differ diff --git a/Projectiles/Ranged/M1GarandEmptyClip.cs b/Projectiles/Ranged/M1GarandEmptyClip.cs new file mode 100644 index 0000000000..e04b8068b6 --- /dev/null +++ b/Projectiles/Ranged/M1GarandEmptyClip.cs @@ -0,0 +1,146 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class M1GarandEmptyClip : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + internal static readonly SoundStyle BlingSound = new("CalamityMod/Sounds/Custom/Ultrabling") { PitchVariance = 0.5f }; + internal static readonly SoundStyle BlingHitSound = new("CalamityMod/Sounds/Custom/UltrablingHit") { PitchVariance = 0.5f }; + private static Asset sheenAsset; + private static Asset bloomAsset; + + public static float UsedCoinGrabRangeMultiplier = 5f; + public static float ClipTossForce = 7.33f; + + public static float MaxIntraClipRicoshotDistance = 1000f; + + public static readonly float RicoshotSearchDistance = 2000f; + + public static float SuperpredictionRatio = 0.1f; + + public static float ClipBonus = 2.5f; + public static float ClipMulticlipBonus = 0.9f; // lmar + + internal static readonly int UpdateCount = 4; + internal static readonly int ClipLifetime = UpdateCount * CalamityUtils.SecondsToFrames(7); + + // Clips fade out for the last 30 frames of their existence. + private static readonly int FadeoutTime = UpdateCount * 30; + private static readonly float ForceFadeDistance = 2000f; + public static int CritDelayFrames = 22; + internal static int CritDelayTime => UpdateCount * CritDelayFrames; + internal ref float ShotFreezeTimer => ref Projectile.ai[1]; + internal static int RicochetPause = UpdateCount * 22; + public bool HasBeenShot => Projectile.localAI[0] > 0f; + + public Player Owner => Main.player[Projectile.owner]; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 60; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 1; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 12; + Projectile.height = 14; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Ranged; + Projectile.MaxUpdates = UpdateCount; + Projectile.timeLeft = ClipLifetime; + // Draws very small otherwise + Projectile.scale = 1.5f; + } + + public override bool? CanDamage() => false; + + public override bool ShouldUpdatePosition() => ShotFreezeTimer <= 0; + + public override void AI() + { + if (ShotFreezeTimer > 0f) + { + --ShotFreezeTimer; + if (ShotFreezeTimer <= 0) + { + Projectile.Kill(); + return; + } + } + + Lighting.AddLight(Projectile.Center, Color.LightGray.ToVector3() * 0.2f); + + if (Main.rand.NextBool(10)) + { + Dust d = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke); + d.noGravity = true; + } + + Projectile.rotation = Projectile.velocity.X * 0.5f; + + if (Projectile.FinalExtraUpdate()) + { + float clipGravity = Player.defaultGravity / Projectile.MaxUpdates; + Projectile.velocity.Y += clipGravity / 1.75f; + } + + if (Projectile.timeLeft > FadeoutTime && Projectile.Center.Distance(Owner.MountedCenter) > ForceFadeDistance) + Projectile.timeLeft = FadeoutTime; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); + return base.OnTileCollide(oldVelocity); + } + // Pretty much all from ricoshot coins from here. + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, 1); + float fadingOpacity = Math.Clamp(Projectile.timeLeft / (float)FadeoutTime, 0f, 1f); + Color alphaColor = Projectile.GetAlpha(lightColor) * fadingOpacity; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, alphaColor, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + + int numUpdatesPassed = ClipLifetime - Projectile.timeLeft; + float x = Math.Clamp((float)numUpdatesPassed / CritDelayTime, 0f, 2f); + float sheenFunction = Math.Min(MathF.Pow(x + 0.1f, 10f), MathF.Pow(x - 2.1f, 10f)); + float sheenOpacity = Math.Clamp(sheenFunction, 0f, 2f); + + if (sheenOpacity > 0f) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + sheenAsset ??= ModContent.Request("CalamityMod/Particles/HalfStar"); + Texture2D shineTex = sheenAsset.Value; + + bloomAsset ??= ModContent.Request("CalamityMod/Particles/BloomCircle"); + Texture2D bloomTex = bloomAsset.Value; + + Vector2 shineScale = new Vector2(1f, 3f - sheenOpacity * 2f); + Color shineColor = Color.LightGray; + + Main.EntitySpriteDraw(bloomTex, Projectile.Center - Main.screenPosition, null, shineColor * sheenOpacity * 0.3f, MathHelper.PiOver2, bloomTex.Size() / 2f, shineScale * Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTex, Projectile.Center - Main.screenPosition, null, shineColor * sheenOpacity, MathHelper.PiOver2, shineTex.Size() / 2f, shineScale * Projectile.scale, SpriteEffects.None, 0); + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } + + return false; + } + } +} diff --git a/Projectiles/Ranged/M1GarandEmptyClip.png b/Projectiles/Ranged/M1GarandEmptyClip.png new file mode 100644 index 0000000000..c08f6def56 Binary files /dev/null and b/Projectiles/Ranged/M1GarandEmptyClip.png differ diff --git a/Projectiles/Ranged/M1GarandHoldout.cs b/Projectiles/Ranged/M1GarandHoldout.cs new file mode 100644 index 0000000000..6beff9770c --- /dev/null +++ b/Projectiles/Ranged/M1GarandHoldout.cs @@ -0,0 +1,357 @@ +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ModLoader; +using System; + +namespace CalamityMod.Projectiles.Ranged +{ + public class M1GarandHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + + public ref float CurrentState => ref Projectile.ai[0]; + public ref float Timer => ref Projectile.ai[1]; + + private float muzzleFlashTimer; + private float flashVariant; + + private int pingAnimationTimer = 0; + private const int PingAnimationDuration = 120; + private bool shouldPing = false; + + public override float RecoilResolveSpeed => 0.13f; + public override float MaxOffsetLengthFromArm => 28f; + public override float BaseOffsetY => -4f; + public override float OffsetXUpwards => -6f; + public override float OffsetXDownwards => 0f; + public override float OffsetYUpwards => 0f; + public override float OffsetYDownwards => 0f; + + public override Vector2 GunTipPosition => (Projectile.Center + new Vector2(1.5f, -2.5f)) + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.425f; + public override string Texture => "CalamityMod/Projectiles/Ranged/M1GarandHoldout"; + + // Muzzle flash textures + public static Asset MuzzleFlash; + public static Asset GlowTexture; + + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/WulfrumBlunderbussFire") { PitchVariance = 0.1f }; + public static readonly SoundStyle PingSound = new("CalamityMod/Sounds/Item/M1GarandPing"); + public static readonly SoundStyle ReloadSound = new("CalamityMod/Sounds/Item/M1GarandReload"); + + public override void Load() + { + MuzzleFlash = ModContent.Request("CalamityMod/Projectiles/Ranged/M1GarandMuzzleFlash", AssetRequestMode.ImmediateLoad); + GlowTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/M1GarandHoldoutGlow", AssetRequestMode.ImmediateLoad); + } + + public override void SetStaticDefaults() => Main.projFrames[Type] = 6; + + public override void KillHoldoutLogic() + { + // Only allow the projectile to kill if we're not reloading + if (CurrentState == 0 && HeldItem.type != Owner.ActiveItem().type) + { + Projectile.Kill(); + Projectile.netUpdate = true; + } + } + + public override void HoldoutAI() + { + // Decrements the timer which controls the duration of the flash + if (muzzleFlashTimer > 0f) + muzzleFlashTimer -= 1f; + + switch (CurrentState) + { + // Normal Firing State + case 0: + // Time between firing (as the player continues to hold) + if (Projectile.frame == 5) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= MathHelper.Clamp(Owner.ActiveItem().useAnimation - 18, 0f, Owner.ActiveItem().useAnimation)) + { + if (Owner.CantUseHoldout()) + Projectile.Kill(); + + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + } + // Begin firing + else if (Projectile.frame == 0) + { + if (Projectile.frameCounter != 1) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + return; + } + + Projectile.frameCounter++; + + // Check if the player has any shots left + if (Owner.Calamity().garandShots > 0) + { + // -- Firing Logic & FX -- + muzzleFlashTimer = 2f; + flashVariant = Main.rand.Next(3); + SoundEngine.PlaySound(FireSound, GunTipPosition); + + if (Owner.Calamity().garandShots == 1) + { + SoundEngine.PlaySound(PingSound, GunTipPosition); + shouldPing = true; + } + + OffsetLengthFromArm -= 3f; + + // Consume a shot + Owner.Calamity().garandShots--; + + Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * HeldItem.shootSpeed; + + // Eject bullet casing + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity.RotatedBy(Main.rand.NextFloat(2.5f, 2.65f) * -Projectile.direction) * 0.5f, ModContent.ProjectileType(), 0, 0, Projectile.owner); + + if (Owner.Calamity().garandShots == 0) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity.RotatedBy(Main.rand.NextFloat(1.175f, 1.25f) * -Projectile.direction) * 0.285f, ModContent.ProjectileType(), 0, 0, Projectile.owner); + + GenericSparkle sparker = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.PaleGoldenrod, Color.Gold * 0.25f, 1.25f, 5, Projectile.velocity.ToRotation() + Main.rand.NextFloat(-0.15f, 0.15f), 1f); + GeneralParticleHandler.SpawnParticle(sparker); + } + + // Direct smoke + for (int i = 0; i < 8; i++) + { + Particle smoke = new HeavySmokeParticle(GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * 7f * Main.rand.NextFloat(0.4f, 1.5f), Color.Gray, Main.rand.Next(30, 50), Main.rand.NextFloat(0.22f, 0.44f), 0.35f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + + // "Smoke" ring + Particle shootPulse = new DirectionalPulseRing(GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * 4f, Color.Gray * 0.5f, new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.1f, 0.475f, 18); + GeneralParticleHandler.SpawnParticle(shootPulse); + + // Shot starts from slightly behind the tip + Vector2 offsetPos = GunTipPosition - Projectile.velocity.SafeNormalize(Vector2.UnitY) * 18f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), offsetPos, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + else + { + OffsetLengthFromArm -= 1f; + CurrentState = 1; // Change state to reloading + Timer = 120; + } + } + // The firing animation + else if (Projectile.frame > 0) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + + } + } + break; + + // Reloading + case 1: + + Timer--; + + // Keep the player from switching weapons + Owner.channel = true; + + // The gun points slightly downwards during the first part + if (Timer <= 120 && Timer > 75) + { + Projectile.rotation += 0.15f * Projectile.spriteDirection; + } + // Lerp back to the normal pos + else if (Timer < 75 && Timer >= 64) + { + float progress = (75f - Timer) / (75f - 64f); + float lerpedOffset = MathHelper.Lerp(0.15f, 0f, progress); + Projectile.rotation += lerpedOffset * Projectile.spriteDirection; + } + else if (Timer == 39) + { + OffsetLengthFromArm -= 2f; + } + + // Hold frame 3 until this point + if (Timer > 40) + { + Projectile.frame = 3; + Projectile.frameCounter = 0; + } + + else if (Projectile.frame < Main.projFrames[Type] - 1) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + } + + else + { + // Hold + Projectile.frame = Main.projFrames[Type] - 1; + } + + if (Timer == 110) + { + SoundEngine.PlaySound(ReloadSound, Projectile.Center); + } + + // Reload and cull the projectile + if (Timer <= 0) + { + Owner.Calamity().garandShots += 8; + Projectile.Kill(); + Projectile.netUpdate = true; + } + + break; + } + } + + // Can damage when firing. + public override bool? CanDamage() => muzzleFlashTimer > 0f; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(GunTipPosition + Vector2.UnitX.RotatedBy(Projectile.rotation) * MuzzleFlash.Width() * 0.5f, 64f, targetHitbox); + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Math.Clamp(Projectile.frame, 0, Main.projFrames[Type] - 1)); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + float scale = Projectile.scale * Owner.gravDir; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), drawRotation, frame.Size() * 0.5f, scale, flipSprite); + + // Flash + if (muzzleFlashTimer > 0f) + { + Texture2D flashTex = MuzzleFlash.Value; + int flashFrameY = (int)flashVariant; + Vector2 flashPos = GunTipPosition + Vector2.UnitX.RotatedBy(Projectile.rotation) * MuzzleFlash.Width() * 0.5f - Main.screenPosition; + Rectangle flashFrame = flashTex.Frame(verticalFrames: 3, frameY: flashFrameY); + Main.EntitySpriteDraw(flashTex, flashPos, flashFrame, Color.White, drawRotation, flashFrame.Size() * 0.5f, scale * 0.8f, flipSprite); + } + + // PING! + if (shouldPing) + { + pingAnimationTimer++; + + if (pingAnimationTimer <= PingAnimationDuration) + { + Texture2D pingTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/M1GarandPingText").Value; + Vector2 origin = pingTexture.Size() * 0.5f; + Vector2 pingDrawPosition; + + Vector2 finalPosition = Owner.Center + new Vector2(40f * -Owner.direction, -40f); + float progress = (float)pingAnimationTimer / PingAnimationDuration; + + if (pingAnimationTimer < 15) + { + float popOutProgress = (float)pingAnimationTimer / 15; + pingDrawPosition = Vector2.Lerp(Owner.Center, finalPosition, popOutProgress); + } + else + { + pingDrawPosition = finalPosition; + } + + pingDrawPosition -= Main.screenPosition; + + float stretchFactorY = 0f; + + if (progress < 0.25f) // Stretch Up + { + float stretchProgress = progress / 0.25f; + stretchFactorY = MathHelper.Lerp(-1.4f, 0.5f, (float)Math.Sin(stretchProgress * MathHelper.PiOver2)); + } + else if (progress < 0.5f) // Squash Down and overadjust + { + float squashProgress = (progress - 0.25f) / 0.3f; + stretchFactorY = MathHelper.Lerp(0.5f, -0.25f, squashProgress * squashProgress); + } + else if (progress < 0.8f) // Stretch up again at a slower pace to a bit above the normal scale + { + float stretchProgress = (progress - 0.6f) / 0.2f; + stretchFactorY = MathHelper.Lerp(-0.25f, 0f, stretchProgress * stretchProgress); + } + else // Return to normal + { + stretchFactorY = 0f; + } + + // Draw without any additions + Color drawColor = Color.White; + int fadeDuration = 30; + int fadeStartFrame = PingAnimationDuration - fadeDuration; + + // Fade out over 30 frames + if (pingAnimationTimer >= fadeStartFrame) + { + float fadeProgress = (float)(pingAnimationTimer - fadeStartFrame) / fadeDuration; + drawColor = Color.White * MathHelper.Lerp(1f, 0f, fadeProgress); + } + + float basePingDrawScale = 1f; + float stretchScaleY = 1f + stretchFactorY; + float stretchScaleX = 1f - (stretchFactorY * 0.5f); + + // Calculate scale to display with all factors combined + Vector2 finalPingScale = new Vector2(basePingDrawScale * stretchScaleX, basePingDrawScale * stretchScaleY); + Main.EntitySpriteDraw(pingTexture, pingDrawPosition, null, drawColor, Owner.direction == 1 ? -0.25f : 0.25f, origin, finalPingScale, SpriteEffects.None, 0f); + } + else + { + // Reset the flag and timer once the animation is complete. + shouldPing = false; + pingAnimationTimer = 0; + } + } + + return false; + } + + // Glowmask. + public override void PostDraw(Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Math.Clamp(Projectile.frame, 0, Main.projFrames[Type] - 1)); + Texture2D glowTexture = GlowTexture.Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 origin = frame.Size() * 0.5f; + float scale = Projectile.scale * Owner.gravDir; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(glowTexture, drawPosition, frame, Color.White, drawRotation, origin, scale, flipSprite); + } + } +} diff --git a/Projectiles/Ranged/M1GarandHoldout.png b/Projectiles/Ranged/M1GarandHoldout.png new file mode 100644 index 0000000000..59767b1acd Binary files /dev/null and b/Projectiles/Ranged/M1GarandHoldout.png differ diff --git a/Projectiles/Ranged/M1GarandHoldoutGlow.png b/Projectiles/Ranged/M1GarandHoldoutGlow.png new file mode 100644 index 0000000000..fff673165b Binary files /dev/null and b/Projectiles/Ranged/M1GarandHoldoutGlow.png differ diff --git a/Projectiles/Ranged/M1GarandMuzzleFlash.png b/Projectiles/Ranged/M1GarandMuzzleFlash.png new file mode 100644 index 0000000000..30764d9ece Binary files /dev/null and b/Projectiles/Ranged/M1GarandMuzzleFlash.png differ diff --git a/Projectiles/Ranged/M1GarandPingText.png b/Projectiles/Ranged/M1GarandPingText.png new file mode 100644 index 0000000000..2d49dc5f35 Binary files /dev/null and b/Projectiles/Ranged/M1GarandPingText.png differ 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/MarksmanShot.cs b/Projectiles/Ranged/MarksmanShot.cs index f0ed4e0c90..38ff47a336 100644 --- a/Projectiles/Ranged/MarksmanShot.cs +++ b/Projectiles/Ranged/MarksmanShot.cs @@ -110,18 +110,25 @@ namespace CalamityMod.Projectiles.Ranged { // Assemble an array of the remaining coins. Projectile[] otherCoins = validCoins.Where((proj) => proj.whoAmI != struckCoin.whoAmI).ToArray(); - + RicoshotTarget nextCoin = Projectile.FindRicochetTarget(Projectile.Center, otherCoins, true); + RicochetOffCoin(nextCoin, struckCoin); // Ricochet off of this coin to the next target. // This coin (and potential further coins) may have already been recursively frozen. // As long as those coins have not yet been struck, they are valid targets. - RicoshotTarget nextTarget = Projectile.FindRicochetTarget(Projectile.Center, otherCoins, true); - RicochetOffCoin(nextTarget, struckCoin); - - // If the next target is another coin, freeze it to (almost) guarantee it will be hit. - if (nextTarget.type == RicoshotTargetType.Coin) + // If the next target is another coin/clip, freeze it. + if (nextCoin.type == RicoshotTargetType.Coin) { - Projectile nextCoin = Main.projectile[nextTarget.entityID]; - nextCoin.ai[1] = RicoshotCoin.RicochetPause; + Projectile nextCoinProj = Main.projectile[nextCoin.entityID]; + + // Use the correct RicochetPause value based on the projectile type + if (nextCoinProj.type == ModContent.ProjectileType()) + { + nextCoinProj.ai[1] = M1GarandEmptyClip.RicochetPause; + } + else + { + nextCoinProj.ai[1] = RicoshotCoin.RicochetPause; + } } } } @@ -142,18 +149,42 @@ namespace CalamityMod.Projectiles.Ranged if (NumRicochets == 0 && CalamityUtils.CanRicoshotCoinForceCrit(struckCoin)) cgp.forcedCrit = true; - // Apply bonus damage to the projectile. This is an additive multiplier between multiple coins. - float bonusDamageRatio = struckCoin.ai[0] switch + // Apply bonus damage to the projectile based on the projectile type. This is an additive multiplier between multiple coins/clips. + float bonusDamageRatio = 0f; + if (struckCoin.type == ModContent.ProjectileType()) { - 1f => NumRicochets > 0 ? RicoshotCoin.SilverMulticoinBonus : RicoshotCoin.SilverBonus, - 2f => NumRicochets > 0 ? RicoshotCoin.GoldMulticoinBonus : RicoshotCoin.GoldBonus, - _ => NumRicochets > 0 ? RicoshotCoin.CopperMulticoinBonus : RicoshotCoin.CopperBonus, - }; + bonusDamageRatio = struckCoin.ai[0] switch + { + 1f => NumRicochets > 0 ? RicoshotCoin.SilverMulticoinBonus : RicoshotCoin.SilverBonus, + 2f => NumRicochets > 0 ? RicoshotCoin.GoldMulticoinBonus : RicoshotCoin.GoldBonus, + _ => NumRicochets > 0 ? RicoshotCoin.CopperMulticoinBonus : RicoshotCoin.CopperBonus, + }; + } + else if (struckCoin.type == ModContent.ProjectileType()) + { + bonusDamageRatio = NumRicochets > 0 ? M1GarandEmptyClip.ClipMulticlipBonus : M1GarandEmptyClip.ClipBonus; + } + cgp.totalRicoshotDamageBonus += bonusDamageRatio; // Increment the ricochet count, relegating further coins to only give the multicoin bonus damage. NumRicochets++; + // If the target was valid, freeze the shot in place for a brief moment. + if (target.IsValid) + { + if (struckCoin.type == ModContent.ProjectileType()) + { + RicochetFreezeTimer = M1GarandEmptyClip.RicochetPause; + } + else + { + RicochetFreezeTimer = RicoshotCoin.RicochetPause; + } + } + + SoundEngine.PlaySound(RicoshotCoin.BlingHitSound, struckCoin.Center); + // If the target was valid, freeze the shot in place for a brief moment. if (target.IsValid) RicochetFreezeTimer = RicochetPause; 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/NullShot.cs b/Projectiles/Ranged/NullShot.cs index 8decdde947..3410ecfb79 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -179,27 +179,34 @@ namespace CalamityMod.Projectiles.Ranged if (Utils.Distance(Main.player[Projectile.owner].Center, target.Center) > 1000) target.velocity = Utils.DirectionTo(target.Center, Main.player[Projectile.owner].Center); - int nullCorrupt = Main.rand.Next(4); - switch (nullCorrupt) + if (Main.rand.NextBool(4)) { - case 0: - target.ai[0] = Main.rand.Next(0, 100 + 1); - target.localAI[0] = Main.rand.Next(0, 100 + 1); - break; - case 1: - target.ai[1] = Main.rand.Next(0, 100 + 1); - target.localAI[1] = Main.rand.Next(0, 100 + 1); - break; - case 2: - target.ai[2] = Main.rand.Next(0, 100 + 1); - target.localAI[2] = Main.rand.Next(0, 100 + 1); - break; - case 3: - target.ai[3] = Main.rand.Next(0, 100 + 1); - target.localAI[3] = Main.rand.Next(0, 100 + 1); - break; - default: - break; + target.aiStyle = Main.rand.Next(2, 140 + 1); + } + else + { + int nullCorrupt = Main.rand.Next(4); + switch (nullCorrupt) + { + case 0: + target.ai[0] = Main.rand.Next(0, 100 + 1); + target.localAI[0] = Main.rand.Next(0, 100 + 1); + break; + case 1: + target.ai[1] = Main.rand.Next(0, 100 + 1); + target.localAI[1] = Main.rand.Next(0, 100 + 1); + break; + case 2: + target.ai[2] = Main.rand.Next(0, 100 + 1); + target.localAI[2] = Main.rand.Next(0, 100 + 1); + break; + case 3: + target.ai[3] = Main.rand.Next(0, 100 + 1); + target.localAI[3] = Main.rand.Next(0, 100 + 1); + break; + default: + break; + } } } else 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/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index c9daab4596..2ffa5f2ab5 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged // 15NOV2024: Ozzatron: clamped mouse position unnecessary. All uses are direction only. public Vector2 MousePosition => Owner.Calamity().mouseWorld - Owner.MountedCenter; - public const float WeaponLength = 52f; + public const float WeaponLength = 62f; public const float MaxSightAngle = MathHelper.Pi * (2f / 3f); public Color ScopeColor => Color.White; 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/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index fee710f9ef..c08c51506d 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -23,18 +23,13 @@ namespace CalamityMod.Projectiles.Rogue public bool canDamage = true; public bool canStick = true; public Vector2 vibrate = Vector2.Zero; - public int stuckTimer = 120; + public int stuckTimer = 180; public Vector2 placementCenter; float placementDistance; Vector2 placementVelocity; public Vector2 storedVelocity; public bool collideWithTiles = true; - - public bool jawline = true; // Tooth direction for the stealthstrike - public Vector2 startingVel; public bool toothDirection = false; - public Vector2 chomp = Vector2.Zero; - public bool chomping = true; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 8; @@ -48,39 +43,42 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = -1; - Projectile.extraUpdates = 2; + Projectile.extraUpdates = 3; Projectile.tileCollide = false; Projectile.timeLeft = 600; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; + Projectile.noEnchantmentVisuals = true; } public override void AI() { + Lighting.AddLight(Projectile.Center, Color.Lerp(Color.Red, Color.White, 0.85f).ToVector3() * 0.5f * Utils.GetLerpValue(255, 0, Projectile.alpha, true)); if (time == 0) { stuckTimer = Main.rand.Next(100, 120 + 1); - startingVel = Projectile.velocity; if (Projectile.ai[1] < 4) toothDirection = Main.rand.NextBool(); } if (!stuckInTarget && !stuckInGround) { - if (!Projectile.Calamity().stealthStrike) + if (Projectile.velocity.Length() > 5 && time > 30 && Projectile.numHits == 0) + Projectile.velocity *= 0.97f; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + if ((time % 2 == 0 || !canStick) && time > 5) { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if ((time % 2 == 0 || !canStick) && time > 15) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3 + Main.rand.NextVector2Circular(6, 6), 5, (-Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.4f)); - dust.noGravity = true; - } - if (time > 90 && canStick) - { - Projectile.velocity.Y += 0.03f; - if (Projectile.velocity.Y > 0) - Projectile.velocity.X *= 0.99f; - } + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3 + Main.rand.NextVector2Circular(6, 6), 5, (-Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.4f) * (canStick ? 1 : 1.3f)); + dust.noGravity = true; + Particle blood = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(canStick ? 0.3f : 0.1f) * Main.rand.NextFloat(5f, 8f), "CalamityMod/Particles/LargeBloom", + false, 8, Main.rand.NextFloat(0.055f, 0.07f), Color.Lerp(Color.DarkRed, Color.Black, Main.rand.NextFloat(0, 0.5f)) * 0.7f, new Vector2(0.7f, 1f), false, shrinkSpeed: 0.8f); + GeneralParticleHandler.SpawnParticle(blood); + } + if (time > 90 && canStick) + { + Projectile.velocity.Y += 0.03f; + if (Projectile.velocity.Y > 0) + Projectile.velocity.X *= 0.99f; } } else if (stuckInTarget) @@ -107,7 +105,8 @@ namespace CalamityMod.Projectiles.Rogue vibrate = Vector2.Zero; canStick = false; collideWithTiles = true; - Projectile.velocity = storedVelocity * 1.3f; + Projectile.velocity = storedVelocity; + Projectile.extraUpdates = 4; stuckInTarget = false; for (int i = 0; i <= 7; i++) @@ -130,117 +129,33 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = storedVelocity.ToRotation() + MathHelper.PiOver2; } - if (Projectile.Calamity().stealthStrike) - { - collideWithTiles = false; - if (time > 15 && (Projectile.ai[1] == 4 ? Projectile.timeLeft > 60 : time < 40)) - { - for (int i = 0; i < (Projectile.ai[1] == 4 ? 2 : 1); i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3 + Main.rand.NextVector2Circular(6, 6), 5, (-Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.6f)); - dust.noGravity = true; - } - } - if (Projectile.ai[1] == 4) - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - int jawDir = jawline ? 1 : -1; - Vector2 spawnPos = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.ToRadians(90f * jawDir)) * 170; - Vector2 jawVel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.ToRadians(90f * jawDir)) * 17; - if (time > 10 && Projectile.timeLeft >= 60) - { - if (time % 3 == 0) - { - if (Main.myPlayer == Projectile.owner) - { - Projectile tooth = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnPos, jawVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack / 12, Projectile.owner, 0, Main.rand.Next(1, 3 + 1), Projectile.velocity.X > 0 ? 1 : -1); - tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 120; - tooth.extraUpdates = 0; - tooth.usesLocalNPCImmunity = false; - tooth.usesIDStaticNPCImmunity = true; - tooth.idStaticNPCHitCooldown = 8; - } - jawline = !jawline; - } - if (time % 2 == 0) - { - Particle spark = new AltSparkParticle(Projectile.Center - Projectile.velocity * 0.5f, Projectile.velocity * 0.01f, false, 15, 1f, Color.DarkRed * 0.4f); - GeneralParticleHandler.SpawnParticle(spark); - } - if (Projectile.timeLeft == 60) - Projectile.velocity *= 0.5f; - } - else if (Projectile.timeLeft <= 60) - { - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 60, 255, 0)); - Projectile.velocity *= 0.95f; - } - } - else - { - Projectile.rotation = startingVel.ToRotation() + MathHelper.ToRadians(270f); - if (Projectile.timeLeft > 90) - { - Projectile.velocity.X = MathHelper.Lerp(Projectile.velocity.X, -startingVel.X * 1.3f, 0.045f); - Projectile.velocity.Y = MathHelper.Lerp(Projectile.velocity.Y, -startingVel.Y * 1.3f, 0.045f); - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 120, 90, 255, 0)); - } - else - { - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 30, 255, 0)); - Projectile.velocity *= 0.9f; - } - if (time > 40) - { - if (!chomping) - { - chomp.X = MathHelper.Lerp(chomp.X, startingVel.X * 3, 0.2f); - chomp.Y = MathHelper.Lerp(chomp.Y, startingVel.Y * 3, 0.2f); - } - else - { - chomp.X = MathHelper.Lerp(chomp.X, 0, 0.2f); - chomp.Y = MathHelper.Lerp(chomp.Y, 0, 0.2f); - } - if (time % 18 == 0) - chomping = !chomping; - } - - } - } - time++; - if (collideWithTiles && Collision.SolidCollision(Projectile.Center, 4, 4)) // Vanilla tile collision messes with velocity so we use this instead { canDamage = false; - if (Projectile.timeLeft > 180) - Projectile.timeLeft = 180; + Projectile.timeLeft = 180; stuckInGround = true; storedVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX); Projectile.velocity = Vector2.Zero; SoundStyle sound = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit1"); SoundEngine.PlaySound(sound with { Volume = 0.25f, Pitch = Main.rand.NextFloat(-0.3f, -0.6f) }, Projectile.Center); collideWithTiles = false; - } - if (!Projectile.Calamity().stealthStrike) - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 60, 255, 0)); + Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 60, 255, 0)); + time++; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (!Projectile.Calamity().stealthStrike) - modifiers.SourceDamage *= target == chosenTarget ? 1 : (canStick ? 0.2f : 0.5f); + modifiers.SourceDamage *= target == chosenTarget ? 1 : (canStick ? 0.2f : 0.5f); } public override bool? CanDamage() => canDamage ? null : false; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target == chosenTarget || Projectile.Calamity().stealthStrike) + if (target == chosenTarget) target.AddBuff(ModContent.BuffType(), 180); - if (!stuckInTarget && canStick && !Projectile.Calamity().stealthStrike) + if (!stuckInTarget && canStick) { if (Projectile.timeLeft < 400) Projectile.timeLeft = 400; @@ -266,10 +181,10 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[1] == 4) tex = ModContent.Request("CalamityMod/Projectiles/Melee/GreenWater").Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + vibrate + chomp, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, toothDirection ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + vibrate, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, toothDirection ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); return false; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Calamity().stealthStrike ? 50 : 18, targetHitbox); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 18, targetHitbox); } } diff --git a/Projectiles/Rogue/LeviathanToothStealth.cs b/Projectiles/Rogue/LeviathanToothStealth.cs new file mode 100644 index 0000000000..d727b1a8a8 --- /dev/null +++ b/Projectiles/Rogue/LeviathanToothStealth.cs @@ -0,0 +1,201 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.Player; + +namespace CalamityMod.Projectiles.Rogue +{ + [PierceResistException] + public class LeviathanToothStealth : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/Rogue/LeviathanTooth"; + public new string LocalizationCategory => "Projectiles.Rogue"; + public ref float time => ref Projectile.ai[0]; + + public bool canDamage = false; + public bool isTopJaw = false; + public float topJawRot = 0; + public float bottomJawRot = 0; + public int jawSlamTime = 25; + public bool spawnedDust = false; + public int jawLength = 750; + public int hitTimer = 0; + 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 = 2; + Projectile.height = 2; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.extraUpdates = 0; + Projectile.tileCollide = false; + Projectile.timeLeft = 180; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 8; + Projectile.ArmorPenetration = 25; + Projectile.noEnchantmentVisuals = true; + } + + public override void AI() + { + if (hitTimer > 0) + hitTimer--; + if (time == 0) + { + topJawRot = -MathHelper.PiOver4; + bottomJawRot = MathHelper.PiOver4; + } + topJawRot *= 0.95f; + bottomJawRot *= 0.95f; + float openingRot = 0.5f; + if (time <= 10) + { + float lerpValue = 1 - (float)Math.Pow(Utils.GetLerpValue(10, 0, time, true), 2); + topJawRot = MathHelper.Lerp(-MathHelper.PiOver4, -MathHelper.PiOver4 - openingRot, lerpValue); + bottomJawRot = MathHelper.Lerp(MathHelper.PiOver4, MathHelper.PiOver4 + openingRot, lerpValue); + } + else + { + float lerpValue = (float)Math.Pow(Utils.GetLerpValue(11, jawSlamTime, time, true), 4); + topJawRot = MathHelper.Lerp(-MathHelper.PiOver4 - openingRot, 0, lerpValue); + bottomJawRot = MathHelper.Lerp(MathHelper.PiOver4 + openingRot, 0, lerpValue); + } + + if (time < jawSlamTime * 1.5f) + { + Owner.direction = Projectile.direction; + if (time < jawSlamTime) + { + Projectile.Center = Owner.Center; + Projectile.velocity = Owner.Center.DirectionTo(Owner.Calamity().mouseWorld) * 0.01f; + } + Owner.itemTime = Owner.itemAnimation = 2; + Vector2 toMouse = Owner.Center.DirectionTo(Owner.Calamity().mouseWorld); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, toMouse.ToRotation() + topJawRot * Owner.direction + MathHelper.PiOver2 * -Owner.direction + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, toMouse.ToRotation() + bottomJawRot * Owner.direction + MathHelper.PiOver2 * -Owner.direction + (Owner.direction == -1 ? MathHelper.Pi : 0)); + } + if (time == jawSlamTime) + { + Owner.Calamity().GeneralScreenShakePower = 5f; + Owner.Calamity().ConsumeStealthByAttacking(); + SoundStyle crunch = new("CalamityMod/Sounds/NPCKilled/PerfSmallDeath"); + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound(crunch with { Volume = 0.4f, Pitch = -0.1f * i, MaxInstances = 3 }, Projectile.Center); + SoundStyle crunch2 = new("CalamityMod/Sounds/NPCHit/RavagerHurt3"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(crunch2 with { Volume = 0.8f, Pitch = -0.4f * i, MaxInstances = 2 }, Projectile.Center); + canDamage = true; + } + + Projectile.Opacity = (float)Math.Pow(Utils.GetLerpValue(0, 40, Projectile.timeLeft, true), 4); + if (Projectile.Opacity <= 0.4f) + canDamage = false; + time++; + spawnedDust = false; + } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float damageMult = 1; + if (hitTimer != 0) + damageMult = 0.2f; + bool jawsJustSlammed = (time >= jawSlamTime && time <= jawSlamTime + 8); + modifiers.SourceDamage *= (jawsJustSlammed ? 12 : 1) * damageMult; + if (hitTimer == 0) + hitTimer = Projectile.localNPCHitCooldown; + + if (target.CanBeMoved(true)) + target.velocity *= 0.05f; + } + public override bool? CanDamage() => canDamage ? null : false; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 300); + } + + public override bool PreDraw(ref Color lightColor) + { + if (time == 0) + return false; + + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 startPoint = Projectile.Center; + int distance = jawLength; + int travelLength = 35; + Vector2 endPoint = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * distance; + Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.UnitX); + + for (int t = -1; t <= 1; t += 2) + { + SpriteEffects spriteFx = (!isTopJaw) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Color drawColor = Projectile.GetAlpha(lightColor); + int toothNum = 0; + for (int i = 0; i < distance; i += travelLength) + { + if (((isTopJaw && Projectile.direction == -1) || (!isTopJaw && Projectile.direction == 1)) && i == 0) + i += (int)(travelLength * 0.5f); + + float jawRot = (isTopJaw ? topJawRot : bottomJawRot); + float scale = (Projectile.scale + 0.35f - 0.02f * toothNum); + float slamLerp = (float)Math.Pow(Utils.GetLerpValue(0, jawSlamTime * 1.5f, time, true), 4); + float sine = ((float)Math.Pow((float)Math.Sin((time + toothNum * 3) / 10), 4)) * slamLerp; + Vector2 drawPos = (startPoint + i * direction.RotatedBy(jawRot)) + direction.RotatedBy(MathHelper.PiOver2 * (isTopJaw ? 1 : -1)) * (-25 * scale - 65 * sine * scale); + Vector2 toMouse = Projectile.velocity.SafeNormalize(Vector2.UnitX); + Vector2 finalDrawPos = drawPos + toMouse.RotatedBy(jawRot) * 5 * (1 - slamLerp) + Main.rand.NextVector2Circular(14, 14) * (time >= jawSlamTime ? Utils.GetLerpValue(jawSlamTime + 30, jawSlamTime, time, true) : 0); + float rotation = Projectile.velocity.ToRotation() + (jawRot) + (isTopJaw ? MathHelper.Pi : 0); + float toothOpacity = Math.Min((float)Math.Pow(Utils.GetLerpValue(0, toothNum, time, true), 3), Projectile.Opacity); + Main.EntitySpriteDraw(tex, finalDrawPos - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, toothOpacity) * toothOpacity, rotation, new Vector2(tex.Width / 2, tex.Height), new Vector2(1f, 1) * scale, spriteFx, 0); + toothNum++; + + if (!spawnedDust && toothNum > 1) + { + Dust dust = Dust.NewDustPerfect(finalDrawPos, 5, (rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2)).RotatedByRandom(0.5f).RotatedBy(1.2f * (isTopJaw ? -1 : 1)) * Main.rand.NextFloat(5f, 8f), 100, default, Main.rand.NextFloat(1.1f, 1.9f) * scale); + dust.noGravity = true; + dust.alpha = (int)(255 * (1 - toothOpacity)); + Particle blood = new CustomSpark(finalDrawPos, (rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2)).RotatedByRandom(0.4f).RotatedBy(1.2f * (isTopJaw ? -1 : 1)) * Main.rand.NextFloat(5f, 8f), "CalamityMod/Particles/LargeBloom", + false, 8, Main.rand.NextFloat(0.065f, 0.08f) * scale, Color.Lerp(Color.DarkRed, Color.Black, Main.rand.NextFloat(0, 0.5f)) * 0.7f * toothOpacity, new Vector2(1f, 1f), false, shrinkSpeed: 0.9f); + GeneralParticleHandler.SpawnParticle(blood); + + Lighting.AddLight(finalDrawPos, Color.Lerp(Color.Red, Color.White, 0.85f).ToVector3() * 1.2f * toothOpacity); + } + } + isTopJaw = (t == -1); + } + spawnedDust = true; // Make sure effect spawning isn't happening based on frame rate + + return false; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (!canDamage) + return false; + + Player Owner = Main.player[Projectile.owner]; + Vector2 start = Projectile.Center; + float length = jawLength; + float size = 165; + float _ = float.NaN; + bool hit = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, start + Projectile.velocity.SafeNormalize(Vector2.UnitX) * length, size, ref _); + return (hit); + + return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Calamity().stealthStrike ? 50 : 18, targetHitbox); + } + } +} 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/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 4f6a26f038..8265a8eec9 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -25,10 +25,26 @@ namespace CalamityMod.Projectiles.Rogue ProjectileID.Sets.TrailingMode[Type] = 0; } - public static int Lifetime = 950; + public static int Lifetime = 1200; public float LifetimeCompletion => MathHelper.Clamp((Lifetime - Projectile.timeLeft) / (float)Lifetime, 0f, 1f); public float StealthEffectOpacity => MathHelper.Clamp(1 - LifetimeCompletion, 0f, 1f); + public float StuckEnemyID + { + get { return Projectile.ai[0]; } + set { Projectile.ai[0] = value; } + } + public float StuckEnemyDistance + { + get { return Projectile.ai[1]; } + set { Projectile.ai[1] = value; } + } + public float StuckEnemyRotation + { + get { return Projectile.ai[2]; } + set { Projectile.ai[2] = value; } + } + public override void SetDefaults() { Projectile.width = 12; @@ -41,11 +57,42 @@ namespace CalamityMod.Projectiles.Rogue Projectile.extraUpdates = 5; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 1; + Projectile.stopsDealingDamageAfterPenetrateHits = true; } public override void AI() { + if (StuckEnemyID > 0) + { + Projectile.tileCollide = false; + if (!Main.npc[(int)StuckEnemyID-1].active) + { + Projectile.Kill(); + return; + } + Projectile.Center = Main.npc[(int)StuckEnemyID-1].Center + Vector2.UnitX.RotatedBy(StuckEnemyRotation) * StuckEnemyDistance; + return; + } + if (StuckEnemyID == -1) + { + var player = Main.player[Projectile.owner]; + Projectile.velocity = Projectile.DirectionTo(player.Center) * 10f; + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + if (Main.rand.NextBool(3)) + { + Vector2 dustCenter = Projectile.Center + Main.rand.NextVector2Circular(4f, 4f); + + Dust chust = Dust.NewDustPerfect(dustCenter, 15, -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.1f), Scale: Main.rand.NextFloat(1.2f, 1.8f)); + chust.noGravity = true; + } + if (Projectile.Distance(player.Center) < 16) + { + player.Calamity().rogueStealth += player.Calamity().rogueStealthMax * 0.067f; + Projectile.Kill(); + } + return; + } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; Projectile.velocity *= 0.998f; @@ -92,6 +139,10 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { SoundEngine.PlaySound(WulfrumKnife.TileHitSound, Projectile.Center); + Projectile.timeLeft = Lifetime; + StuckEnemyID = target.whoAmI+1; + StuckEnemyDistance = Projectile.Distance(target.Center); + StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); } public override bool OnTileCollide(Vector2 oldVelocity) @@ -118,7 +169,7 @@ namespace CalamityMod.Projectiles.Rogue Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float opacitey = StealthEffectOpacity; - if (Projectile.Calamity().stealthStrike) + if (Projectile.Calamity().stealthStrike && StuckEnemyID == 0) { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index 3377e232ea..62857a92d2 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -73,6 +73,12 @@ namespace CalamityMod.Projectiles.Summon public override bool MinionContactDamage() => true; + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + fallThrough = true; // Should always be able to fly through platforms + return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); + } + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } 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/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 0afb24e4e3..4322dbb52a 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Summon public Vector2 storedPos; public override void SetStaticDefaults() { - Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = false; // To prevent blade type desync ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -305,7 +304,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override bool MinionContactDamage() => attackCooldown == 0; + public override bool? CanDamage() => (attackCooldown == 0 ? base.CanDamage() : false); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Summon/EXPLODINGFROG.cs b/Projectiles/Summon/EXPLODINGFROG.cs index a54e7caea0..dc5e5ecb1f 100644 --- a/Projectiles/Summon/EXPLODINGFROG.cs +++ b/Projectiles/Summon/EXPLODINGFROG.cs @@ -1,6 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -11,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public class EXPLODINGFROG : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public const float MinExplodeDistance = 120f; - public const float ExplodeWaitTime = 45f; + public const float MinExplodeDistance = 96f; + public const float ExplodeWaitTime = 120f; public const float ExplosionAngleVariance = 0.8f; public override void SetStaticDefaults() { @@ -35,6 +39,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + if (Projectile.ai[1] == 0) + { + Projectile.ai[0] = 75; + Projectile.ai[1] = 1; + } if (Projectile.frameCounter++ > 5) { Projectile.frame++; @@ -46,39 +55,56 @@ namespace CalamityMod.Projectiles.Summon } Player player = Main.player[Projectile.owner]; bool canExplode = Projectile.Center.ClosestNPCAt(MinExplodeDistance) != null; - if (player.HasMinionAttackTargetNPC) + if (player.HasMinionAttackTargetNPC && !canExplode) { canExplode = Main.npc[player.MinionAttackTargetNPC].Distance(Projectile.Center) < MinExplodeDistance; } - if (canExplode) + if (Projectile.ai[0] < ExplodeWaitTime) Projectile.ai[0]++; if (Projectile.ai[0] >= ExplodeWaitTime) { - if (Main.myPlayer == Projectile.owner) + if (canExplode) { - // Goop projectiles - for (int i = 0; i < 3; i++) + if (Main.myPlayer == Projectile.owner) { + Vector2 rotOffset = -Vector2.UnitY; + if (player.HasMinionAttackTargetNPC && Main.npc[player.MinionAttackTargetNPC].Distance(Projectile.Center) < MinExplodeDistance + Math.Max(Main.npc[player.MinionAttackTargetNPC].width * 0.5f, Main.npc[player.MinionAttackTargetNPC].height * 0.5f)) + rotOffset = (Projectile.DirectionTo(Main.npc[player.MinionAttackTargetNPC].Center)); + else + { + var tar = Projectile.Center.ClosestNPCAt(MinExplodeDistance); + if (tar != null) + rotOffset = (Projectile.DirectionTo(tar.Center)); + } + // Goop projectiles + Vector2 direction = Vector2.Lerp(-Vector2.UnitY, rotOffset, 0.25f).SafeNormalize(-Vector2.UnitY); + for (int i = 0; i < 3; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + // WoF vomit sound. + SoundEngine.PlaySound(SoundID.NPCDeath13, Projectile.Center); + Projectile.ai[0] = 0; + + //do a little hop + if (Projectile.velocity.Length() < 0.1f) + Projectile.velocity.Y -= 5; } - // WoF vomit sound. - SoundEngine.PlaySound(SoundID.NPCDeath13, Projectile.Center); - Projectile.Kill(); } Projectile.velocity.Y += 0.5f; @@ -91,12 +117,55 @@ namespace CalamityMod.Projectiles.Summon public override bool? CanDamage() => false; // Don't die on tile collision - public override bool OnTileCollide(Vector2 oldVelocity) => false; + public override bool OnTileCollide(Vector2 oldVelocity) + { + Projectile.velocity *= 0.8f; + return false; + } public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) { fallThrough = false; return true; } + private static Texture2D GlowOutline = null; + public static Texture2D GetGlowOutline() + { + if (GlowOutline == null) + { + var texture = ModContent.Request("CalamityMod/Projectiles/Summon/EXPLODINGFROG").Value; + GlowOutline = new Texture2D(Main.graphics.GraphicsDevice, texture.Width, texture.Height); + + var BaseArray = new Color[GlowOutline.Width * GlowOutline.Height]; + var ColorArray = new Color[GlowOutline.Width * GlowOutline.Height]; + texture.GetData(BaseArray); + for (var i = 0; i < BaseArray.Length; i++) + { + ColorArray[i] = new Color(255, 255, 255) * (((float)BaseArray[i].A) / 255f); + } + GlowOutline.SetData(ColorArray); + } + return GlowOutline; + } + + public void ApplyGlowOutline(Texture2D tex, Rectangle? frame = null, float rotationOffset = 0, float borderPixels = 1, float opacity = 1) + { + Color color = Color.GreenYellow; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(2, 0) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width,frame.Value.Height) *0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(0, 2) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width, frame.Value.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(-2, 0) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width, frame.Value.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(0, -2) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width, frame.Value.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + } + public override bool PreDraw(ref Color lightColor) + { + var tex = GetGlowOutline(); + var frame = tex.Frame(1, 5, 0, Projectile.frame); + ApplyGlowOutline(tex, frame, 0, MathF.Pow(Math.Clamp((Projectile.ai[0]-90)/(ExplodeWaitTime-90), 0, 1), 2),1); + + Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3()*(MathF.Pow(Math.Clamp((Projectile.ai[0] - 90) / (ExplodeWaitTime - 90), 0, 1), 2))); + tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor * Projectile.Opacity, Projectile.rotation, new Vector2(frame.Width, frame.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + return false; + } } } 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/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index 86f0f94bc8..cb17cbe72a 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -1,111 +1,194 @@ -using System.IO; +using System; +using System.IO; using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Graphics; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { + //Based off Virid Vanguard projectile code for circling and drawing logic public class IgneousBlade : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public bool Firing = false; + public enum AIState + { + CircleOwner, + TransitionToLaunch, + LaunchAtPos + } + + public int BladeIndex; + + public VertexStrip TrailDrawer; + + public Vector2 ChargeStartingPosition; + + public float BladeHoverOffsetAngle + { + get + { + float projectileCounts = Owner.ownedProjectileCounts[Type]; + if (projectileCounts <= 1f) + projectileCounts = 1f; + + return MathHelper.TwoPi * BladeIndex / projectileCounts + AITimer / 10f; + } + } + + public AIState CurrentState + { + get => (AIState)Projectile.ai[0]; + set => Projectile.ai[0] = (int)value; + } + + public Player Owner => Main.player[Projectile.owner]; + + public ref float AITimer => ref Projectile.ai[1]; + + public ref float BladeGleamInterpolant => ref Projectile.localAI[0]; + + public Vector2 ChargeTargetPos = Vector2.Zero; + public Vector2 ChargeStartPos = Vector2.Zero; + public override void SetStaticDefaults() { - Main.projPet[Type] = true; - ProjectileID.Sets.TrailingMode[Type] = 0; - ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 45; } public override void SetDefaults() { - Projectile.width = 52; - Projectile.height = 86; + + Projectile.width = 84; + Projectile.height = 84; Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.minionSlots = 1f; - Projectile.timeLeft = 18000; + Projectile.timeLeft = 90000; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 7; Projectile.tileCollide = false; - Projectile.timeLeft *= 5; Projectile.minion = true; + Projectile.minionSlots = 1f; Projectile.DamageType = DamageClass.Summon; + Projectile.stopsDealingDamageAfterPenetrateHits = true; } + public override void SendExtraAI(BinaryWriter writer) { - writer.Write(Firing); + writer.Write(BladeIndex); + writer.WriteVector2(ChargeStartingPosition); } + public override void ReceiveExtraAI(BinaryReader reader) { - Firing = reader.ReadBoolean(); + BladeIndex = reader.ReadInt32(); + ChargeStartingPosition = reader.ReadVector2(); } + + public override void AI() { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - bool isProperProjectile = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isProperProjectile) + // Decide whether the minion should still exist. + HandleMinionBools(); + + // Reset extra updates. + Projectile.MaxUpdates = 1; + + // Have the gleam interpolant dissipate. + BladeGleamInterpolant = MathHelper.Lerp(BladeGleamInterpolant, 0f, 0.1f); + if (BladeGleamInterpolant <= 0.02f) + BladeGleamInterpolant = 0f; + + NPC potentialTarget = Projectile.Center.MinionHoming(ViridVanguard.MaxTargetingDistance, Owner); + switch (CurrentState) { - if (player.dead) - { - modPlayer.igneousExaltation = false; - } - if (modPlayer.igneousExaltation) - { - Projectile.timeLeft = 2; - } + case AIState.CircleOwner: + CircleOwner(); + break; + case AIState.TransitionToLaunch: + ChargeTargetPos = Owner.Calamity().mouseWorld; + ChargeStartPos = Owner.Center; + CurrentState = AIState.LaunchAtPos; + AITimer = 0; + Projectile.penetrate = 50; + LaunchAtTargetPos(); + break; + case AIState.LaunchAtPos: + LaunchAtTargetPos(); + break; } - // Orbiting. 1 = Shooting - if (!Firing) + AITimer++; + } + + public void CircleOwner() + { + Vector2 hoverDestination = Owner.Center + BladeHoverOffsetAngle.ToRotationVector2() * (AITimer < 0 ? MathHelper.Lerp(200, 100, 1 - (-AITimer) / IgneousExaltation.ChargeCooldown) : 100f); + Projectile.Center = Vector2.Lerp(Projectile.Center, hoverDestination, 0.04f).MoveTowards(hoverDestination, 20f); + Projectile.velocity *= 0.8f; + + // Teleport to the owner if sufficiently far away. + if (!Projectile.WithinRange(Owner.Center, 3200f)) { - const float outwardPosition = 180f; - Projectile.Center = player.Center + Projectile.ai[0].ToRotationVector2() * outwardPosition + Vector2.UnitY * player.gfxOffY; - Projectile.rotation = Projectile.ai[0] + MathHelper.PiOver2 + MathHelper.PiOver4; - Projectile.ai[0] -= MathHelper.ToRadians(4f); + Projectile.Center = hoverDestination; + Projectile.netUpdate = true; } - else + + // Aim away from the target. + Projectile.rotation = Projectile.AngleFrom(Owner.Center) + MathHelper.PiOver2; + } + + public void LaunchAtTargetPos() + { + Projectile.damage = Projectile.originalDamage; + if (Projectile.penetrate > 40) //First 10 hits do 2x damage + Projectile.damage *= 2; + int chargeTime = IgneousExaltation.ChargeDuration * 2; + int chargeLength = 2000; + float circleWidth = Math.Min(75, Owner.ownedProjectileCounts[Type] * 4); + var CurrentPlace = Vector2.Lerp(ChargeStartPos, ChargeStartPos + ChargeStartPos.DirectionTo(ChargeTargetPos) * chargeLength, MathF.Pow(AITimer / chargeTime, 3)); + Projectile.Center = CurrentPlace + BladeHoverOffsetAngle.ToRotationVector2() * Math.Max(MathHelper.Lerp(100f, 25f, AITimer / 10f), circleWidth); + Projectile.rotation = Projectile.AngleFrom(CurrentPlace) + MathHelper.PiOver2; + if (AITimer >= chargeTime) { - if (Projectile.penetrate == -1) //limit penetration for worm memes - Projectile.penetrate = 3; - - Projectile.ai[0]--; - if (Projectile.ai[0] == 1) - Projectile.Kill(); - - if (Projectile.ai[0] % 10f == 9f) - { - for (int i = 0; i < 20; i++) - { - float angle = MathHelper.TwoPi / 20f * i; - Dust dust = Dust.NewDustPerfect(Projectile.position + angle.ToRotationVector2().RotatedBy(Projectile.rotation) * new Vector2(14f, 21f), 6); - dust.velocity = angle.ToRotationVector2().RotatedBy(Projectile.rotation) * 2f; - dust.noGravity = true; - } - } + Projectile.damage = Projectile.originalDamage; + AITimer = -IgneousExaltation.ChargeCooldown; + CurrentState = AIState.CircleOwner; + Projectile.penetrate = -1; } } - public override bool MinionContactDamage() => true; + public void HandleMinionBools() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + if (Projectile.type == ModContent.ProjectileType()) + { + if (Owner.dead) + Owner.Calamity().igneousExaltation = false; + + if (Owner.Calamity().igneousExaltation) + Projectile.timeLeft = 2; + } + } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Firing) - { + if (Projectile.penetrate >= 40 && CurrentState != AIState.CircleOwner) //The first 10 hits per launch can spawn blades if (Main.myPlayer == Projectile.owner) { - Projectile.ai[0] = 50; - for (int i = 0; i < 3; i++) + for (int i = 0; i < 1; i++) { - Vector2 spawnPosition = target.Center - new Vector2(0f, 550f).RotatedByRandom(MathHelper.ToRadians(8f)); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, Vector2.Normalize(target.Center - spawnPosition) * 24f, ModContent.ProjectileType(), + Vector2 spawnPosition = Projectile.Center - new Vector2(0f, 550f).RotatedByRandom(MathHelper.TwoPi); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, Vector2.Normalize(Projectile.Center - spawnPosition) * 24f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } for (int i = 0; i < Main.rand.Next(28, 41); i++) @@ -117,44 +200,65 @@ namespace CalamityMod.Projectiles.Summon } Projectile.netUpdate = true; } - } + base.OnHitNPC(target, hit, damageDone); } - public override void OnKill(int timeLeft) + public Color TrailColorFunction(float completionRatio) { - for (int j = 0; j < 40; j++) - { - Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Torch); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); - dust.noGravity = true; - } + float opacity = (float)Math.Pow(Utils.GetLerpValue(1f, 0.45f, completionRatio, true), 4D) * Projectile.Opacity * 0.48f; + var redColor = new Color(166, 46, 61); + return Color.Lerp(redColor, new(64, 51, 66), MathHelper.Clamp(completionRatio * 1.4f, 0f, 1f)) * opacity; } + + public float TrailWidthFunction(float completionRatio) => Projectile.height * (1f - completionRatio) * 0.3f; + public override bool PreDraw(ref Color lightColor) { - if (Firing) + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + + // Draw the afterimage trail. + TrailDrawer ??= new(); + GameShaders.Misc["EmpressBlade"].UseImage0("Images/Extra_201"); + GameShaders.Misc["EmpressBlade"].UseImage1("Images/Extra_193"); + GameShaders.Misc["EmpressBlade"].UseShaderSpecificData(new Vector4(1f, 0f, 0f, 0.6f)); + GameShaders.Misc["EmpressBlade"].Apply(null); + TrailDrawer.PrepareStrip(Projectile.oldPos, Projectile.oldRot, TrailColorFunction, TrailWidthFunction, Projectile.Size * 0.5f - Main.screenPosition, Projectile.oldPos.Length, true); + TrailDrawer.DrawTrail(); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + + // Draw the blade. + float outlineOpacity = 1; + float outlineWidth = 1; + if ((CurrentState == AIState.CircleOwner && AITimer < 0)) { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/IgneousBlade").Value; - - Rectangle rectangle = new Rectangle(0, 0, texture.Width, texture.Height); - - if (Lighting.NotRetro) - { - for (int i = 0; i < Projectile.oldPos.Length; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color = Color.Lerp(Color.White, Color.Red, i / (float)Projectile.oldPos.Length) * - ((Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); - float scale = MathHelper.Lerp(Projectile.scale * 1.35f, Projectile.scale * 0.6f, i / (float)Projectile.oldPos.Length); - Main.EntitySpriteDraw(texture, drawPos, new Rectangle?(rectangle), color, - Projectile.rotation, - rectangle.Size() / 2f, scale, SpriteEffects.None, 0); - } - } - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle?(rectangle), Color.White, - Projectile.rotation, - rectangle.Size() / 2f, 1.35f, SpriteEffects.None, 0); - return false; + outlineWidth = Math.Clamp(MathF.Pow(1 - (AITimer) / -IgneousExaltation.ChargeCooldown, 3), 0, 100); + outlineOpacity = 0.75f; } - return true; + var outlineTex = IgneousExaltation.GetBladeOutlineTex(); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(2, 0) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(0, 2) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(-2, 0) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(0, -2) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + + // Draw the gleam at the tip of the blade. + Texture2D shineTex = ModContent.Request("CalamityMod/Particles/HalfStar").Value; + Vector2 shineScale = new Vector2(1.67f, 3f) * Projectile.scale; + shineScale *= MathHelper.Lerp(0.9f, 1.1f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 7.4f + Projectile.identity) * 0.5f + 0.5f); + + Vector2 lensFlareWorldPosition = Projectile.Center + (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * Projectile.width * Projectile.scale * 0.88f; + Color lensFlareColor = Color.Lerp(Color.LimeGreen, Color.Yellow, 0.23f) with { A = 0 } * BladeGleamInterpolant; + Main.EntitySpriteDraw(shineTex, lensFlareWorldPosition - Main.screenPosition, null, lensFlareColor, 0f, shineTex.Size() * 0.5f, shineScale * 0.6f, 0, 0); + Main.EntitySpriteDraw(shineTex, lensFlareWorldPosition - Main.screenPosition, null, lensFlareColor, MathHelper.PiOver2, shineTex.Size() * 0.5f, shineScale, 0, 0); + + // Reset textures for shaders, since they're only defined once at load-time in vanilla. + GameShaders.Misc["EmpressBlade"].UseImage0("Images/Extra_209"); + GameShaders.Misc["EmpressBlade"].UseImage1("Images/Extra_210"); + return false; } } } diff --git a/Projectiles/Summon/IgneousBladeStrike.cs b/Projectiles/Summon/IgneousBladeStrike.cs index 6762bec590..56459f6c93 100644 --- a/Projectiles/Summon/IgneousBladeStrike.cs +++ b/Projectiles/Summon/IgneousBladeStrike.cs @@ -1,6 +1,10 @@ -using Microsoft.Xna.Framework; +using System; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -18,8 +22,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { Projectile.friendly = true; - Projectile.width = 86; - Projectile.height = 36; + Projectile.width = 50; + Projectile.height = 50; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; @@ -27,6 +31,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft = 360; Projectile.alpha = 127; Projectile.DamageType = DamageClass.Summon; + Projectile.penetrate = 1; + Projectile.extraUpdates = 1; } public override void AI() @@ -44,5 +50,18 @@ namespace CalamityMod.Projectiles.Summon } SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); } + + public override bool PreDraw(ref Color lightColor) + { + + var AllWhiteTexture = IgneousExaltation.GetBladeOutlineTex(); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(0,2) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size()*0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(2, 0) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(0, -2) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(-2, 0) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + var tex = TextureAssets.Projectile[Type].Value; + Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + return false; + } } } 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/SeashineSwordProj.cs b/Projectiles/Summon/SeashineSwordProj.cs index b225d398cb..d8e21def52 100644 --- a/Projectiles/Summon/SeashineSwordProj.cs +++ b/Projectiles/Summon/SeashineSwordProj.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; // Minion targeting feature is not active here since this isn't a normal summon weapon } @@ -317,6 +316,6 @@ namespace CalamityMod.Projectiles.Summon float _ = float.NaN; return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, tipPosition, 30 * Projectile.scale, ref _); } - public override bool MinionContactDamage() => isAttacking && attackTimer > bladeValue && Projectile.ai[0] != 0; + public override bool? CanDamage() => isAttacking && attackTimer > bladeValue && Projectile.ai[0] != 0; } } 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/ChlorophyteLifePulse.cs b/Projectiles/Typeless/ChlorophyteLifePulse.cs deleted file mode 100644 index 98e98e702e..0000000000 --- a/Projectiles/Typeless/ChlorophyteLifePulse.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using CalamityMod.Items.VanillaArmorChanges; -using CalamityMod.Projectiles.VanillaProjectileOverrides; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class ChlorophyteLifePulse : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - - public const int Lifetime = 60; - - public float LifetimeCompletion => 1f - Projectile.timeLeft / (float)Lifetime; - - public override void SetDefaults() - { - Projectile.width = 96; - Projectile.height = 96; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 30; - Projectile.timeLeft = Lifetime; - } - - public override bool? CanHitNPC(NPC target) => !target.CountsAsACritter && !target.friendly && target.chaseable; - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.damage = (int)(Projectile.damage * 0.8f); - - public override void AI() - { - Projectile.Opacity = 1f - (float)Math.Pow(LifetimeCompletion, 1.56); - Projectile.scale = MathHelper.Lerp(0.5f, 6f, LifetimeCompletion); - - // Heal all members of the same team. - if (Projectile.timeLeft == (int)(Lifetime * 0.925f)) - { - Player owner = Main.player[Projectile.owner]; - List membersOfSameTeam = new List() - { - owner - }; - if (owner.team != 0) - membersOfSameTeam.AddRange(Main.player.Where(p => p.team == owner.team && p.active && !p.dead)); - - foreach (Player player in membersOfSameTeam) - { - if (player.Calamity().ChlorophyteHealDelay > 0) - continue; - - int healQuantity = (int)owner.GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.AmountToHealPerPulse); - player.HealPlayer(healQuantity); - player.Calamity().ChlorophyteHealDelay = ChlorophyteArmorSetChange.DelayBetweenHeals; - } - } - } - - public override Color? GetAlpha(Color lightColor) - { - Color c1 = new Color(142, 255, 155, 0); - Color c2 = new Color(0, 142, 113, 92); - return Color.Lerp(c1, c2, 1f - Projectile.Opacity) * Projectile.Opacity * 0.67f; - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Color drawColor = Projectile.GetAlpha(lightColor) * 0.4f; - for (int i = 0; i < 8; i++) - { - Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 4f; - Vector2 drawPosition = Projectile.Center - Main.screenPosition + drawOffset; - Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, 0f, texture.Size() * 0.5f, Projectile.scale, 0, 0); - } - return false; - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.scale * 48f, targetHitbox); - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Typeless/ChlorophyteLifePulse.png b/Projectiles/Typeless/ChlorophyteLifePulse.png deleted file mode 100644 index f51029ba21..0000000000 Binary files a/Projectiles/Typeless/ChlorophyteLifePulse.png and /dev/null differ 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/FlashBolt.cs b/Projectiles/Typeless/FlashBolt.cs index 2fd8cb3778..dedd6b3d94 100644 --- a/Projectiles/Typeless/FlashBolt.cs +++ b/Projectiles/Typeless/FlashBolt.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Typeless setAltPlace = true; } - if (simplify || Projectile.ai[0] == -1 || !Owner.Calamity().arcFlashRingVisual) + if (simplify || !Owner.Calamity().arcFlashRingVisual) return false; Texture2D tex = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; 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/SandCloakVeil.cs b/Projectiles/Typeless/SandCloakVeil.cs index f31fb59353..53efb8d979 100644 --- a/Projectiles/Typeless/SandCloakVeil.cs +++ b/Projectiles/Typeless/SandCloakVeil.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Typeless if (posDiff.Length() <= Radius) { BuffedPlayer.Calamity().getSandCloakAccelBoost = true; - BuffedPlayer.statDefense += 10; + BuffedPlayer.statDefense += SandCloak.SandVeilDefenseBoost; } else BuffedPlayer.Calamity().getSandCloakAccelBoost = false; 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..7ee97c9e22 --- /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 % VictideHeadBarrier.BarrierFramesPerHeal == VictideHeadBarrier.BarrierFramesPerHeal - 1) + { + 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/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs index 616ca734da..03f8a7927e 100644 --- a/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs +++ b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Typeless public static int Lifetime = 400; public static int DigTime = 350; public static float DigSpeed = 1.5f; - public static int MaxPickPower = 160; + public static int MaxPickPower = 1000; public static float ClearSpaceDiagonal = 50; public override void SetDefaults() diff --git a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs deleted file mode 100644 index dcc0ff7262..0000000000 --- a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using CalamityMod.Items.VanillaArmorChanges; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.VanillaProjectileOverrides -{ - public static class ChlorophyteCrystalAI - { - public static bool DoChlorophyteCrystalAI(Projectile projectile) - { - Player owner = Main.player[projectile.owner]; - ref float timer = ref projectile.ai[1]; - - timer++; - projectile.aiStyle = -1; - if (!owner.crystalLeaf) - { - projectile.Kill(); - return false; - } - - // Stay above the player. - projectile.Center = owner.Center + Vector2.UnitY * (owner.gfxOffY - 60f); - if (Main.player[projectile.owner].gravDir == -1f) - { - projectile.position.Y += 120f; - projectile.rotation = MathHelper.Pi; - } - else - projectile.rotation = 0f; - projectile.Center = projectile.Center.Floor(); - - // Disable hardcoded spaghetti that fires crystal shots in vanilla code. - owner.petalTimer = 2; - - // Have a periodically pulsing scale. - projectile.scale = MathHelper.Lerp(0.9f, 1.15f, (float)Math.Sin(timer / 27f) * 0.5f + 0.5f); - - // Emit life pulses periodically. - NPC potentialTarget = projectile.Center.ClosestNPCAt(560f, true, true); - bool ownerNotFullHealth = owner.statLife < owner.statLifeMax2; - bool willFirePulses = (potentialTarget is not null) || ownerNotFullHealth; - if (timer % ChlorophyteArmorSetChange.PulseReleaseRate == ChlorophyteArmorSetChange.PulseReleaseRate - 1f && willFirePulses) - { - if (Main.myPlayer == projectile.owner) - { - int pulseDamage = (int)owner.GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.BaseDamageToEnemies); - - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ModContent.ProjectileType(), pulseDamage, 0f, projectile.owner); - } - } - - return false; - } - - public static void DoChlorophyteCrystalDrawing(Projectile projectile) - { - // Why doesn't this work? How does one access the texture path of a vanilla projectile? Left bugged for someone else to figure out :) - // It's me. I was that someone - Dominic - // TextureAssets is the answer, along with Main.instance.LoadProjectile(projID), to ensure that the texture is loaded into memory. - // In this instance, however, that should happen already on vanilla's end. - Texture2D texture = TextureAssets.Projectile[projectile.type].Value; - Vector2 drawPosition = projectile.Center - Main.screenPosition; - Vector2 origin = texture.Size() * 0.5f; - - float backglowColorInterpolant = MathHelper.Lerp(0.44f, 0.88f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 1.1f) * 0.5f + 0.5f); - Color backglowColor = Color.Lerp(Color.Cyan, Color.Lime, backglowColorInterpolant) * 0.37f; - backglowColor.A = 0; - for (int i = 0; i < 8; i++) - { - Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 3f; - Main.EntitySpriteDraw(texture, drawPosition + drawOffset, null, projectile.GetAlpha(backglowColor), projectile.rotation, origin, projectile.scale, 0, 0); - } - - Main.EntitySpriteDraw(texture, drawPosition, null, projectile.GetAlpha(Color.White * 0.75f), projectile.rotation, origin, projectile.scale, 0, 0); - } - } -} 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/Rarities/ColorTool.cs b/Rarities/ColorTool.cs index f226186c9a..ca16bd0a20 100644 --- a/Rarities/ColorTool.cs +++ b/Rarities/ColorTool.cs @@ -1,9 +1,8 @@ -using CalamityMod.Rarities; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Items +namespace CalamityMod.Rarities { public sealed class ColorTool : GlobalItem { @@ -41,7 +40,7 @@ namespace CalamityMod.Items } public static Color Rainbowing(float position) => colorLerps( - new Color[] { new Color(255, 50, 50, 255), new Color(255, 128, 50, 255), new Color(230, 255, 50, 255), new Color(80, 255, 60, 255), - new Color(50, 80, 250, 255), new Color(200, 50, 250, 255),new Color(255, 50, 230, 255), }, position); + [ new Color(255, 50, 50, 255), new Color(255, 128, 50, 255), new Color(230, 255, 50, 255), new Color(80, 255, 60, 255), + new Color(50, 80, 250, 255), new Color(200, 50, 250, 255), new Color(255, 50, 230, 255), ], position); } } diff --git a/Rarities/PureGreen.cs b/Rarities/PureGreen.cs index 8d859b9226..5752ae8335 100644 --- a/Rarities/PureGreen.cs +++ b/Rarities/PureGreen.cs @@ -13,9 +13,7 @@ namespace CalamityMod.Rarities { -2 => ItemRarityID.Purple, -1 => ModContent.RarityType(), - 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), - _ => Type, + _ => Type, // Cannot reach Cosmic Purple or Burnished Auric }; } } diff --git a/Rarities/Turquoise.cs b/Rarities/Turquoise.cs index 254fa196ab..27428d0c1a 100644 --- a/Rarities/Turquoise.cs +++ b/Rarities/Turquoise.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Rarities -2 => ItemRarityID.Red, -1 => ItemRarityID.Purple, 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), + 2 => ModContent.RarityType(), // Cannot reach Cosmic Purple _ => Type, }; } 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/AugerBigSlash.ogg b/Sounds/Item/AugerBigSlash.ogg new file mode 100644 index 0000000000..d068625bfd Binary files /dev/null and b/Sounds/Item/AugerBigSlash.ogg differ diff --git a/Sounds/Item/AugerHit.ogg b/Sounds/Item/AugerHit.ogg new file mode 100644 index 0000000000..26b099ea3b Binary files /dev/null and b/Sounds/Item/AugerHit.ogg differ diff --git a/Sounds/Item/AugerPull.ogg b/Sounds/Item/AugerPull.ogg new file mode 100644 index 0000000000..24db60a049 Binary files /dev/null and b/Sounds/Item/AugerPull.ogg differ diff --git a/Sounds/Item/AugerSlash1.ogg b/Sounds/Item/AugerSlash1.ogg new file mode 100644 index 0000000000..511f3dbee1 Binary files /dev/null and b/Sounds/Item/AugerSlash1.ogg differ diff --git a/Sounds/Item/AugerSlash2.ogg b/Sounds/Item/AugerSlash2.ogg new file mode 100644 index 0000000000..d533e89a27 Binary files /dev/null and b/Sounds/Item/AugerSlash2.ogg differ diff --git a/Sounds/Item/AugerWindup.ogg b/Sounds/Item/AugerWindup.ogg new file mode 100644 index 0000000000..1264dee1c5 Binary files /dev/null and b/Sounds/Item/AugerWindup.ogg 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/M1GarandPing.ogg b/Sounds/Item/M1GarandPing.ogg new file mode 100644 index 0000000000..f05bb8a0da Binary files /dev/null and b/Sounds/Item/M1GarandPing.ogg differ diff --git a/Sounds/Item/M1GarandReload.ogg b/Sounds/Item/M1GarandReload.ogg new file mode 100644 index 0000000000..d43965eff8 Binary files /dev/null and b/Sounds/Item/M1GarandReload.ogg 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/DonatorsNameList.cs b/Systems/Collections/DonatorsNameList.cs index 9ae253c576..258a4fbd64 100644 --- a/Systems/Collections/DonatorsNameList.cs +++ b/Systems/Collections/DonatorsNameList.cs @@ -615,6 +615,7 @@ namespace CalamityMod.Systems.Collections "Scribbles", "Scrumlet", "Seanツ", + "Sevenfold", // previously "Woah" "Shadoku", "SharZz", "Shaun", @@ -719,7 +720,6 @@ namespace CalamityMod.Systems.Collections "William", "WillyDilly", "WinterTire", - "Woah", "Wodernet", "Wolfmaw", "WrathOfOlympus", 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/BossValueDict.cs b/Systems/Collections/NPCs/BossValueDict.cs deleted file mode 100644 index 43b450ad80..0000000000 --- a/Systems/Collections/NPCs/BossValueDict.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections.Generic; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Systems.Collections -{ - public sealed class BossValueDict : ModSystem - { - public static IDictionary Dict { get; private set; } - - public override void OnModLoad() - { - // NOTE: This does not account for Calamity's base value increases - Dict = new SortedDictionary - { - { NPCID.KingSlime, Item.buyPrice(0, 2) }, - { NPCID.EyeofCthulhu, Item.buyPrice(0, 2) }, - // Evil bosses drop 5 gold in vanilla; unmodified - { NPCID.QueenBee, Item.buyPrice(0, 8) }, - { NPCID.Deerclops, Item.buyPrice(0, 8) }, - { NPCID.SkeletronHead, Item.buyPrice(0, 12) }, - { NPCID.WallofFlesh, Item.buyPrice(0, 12) }, - { NPCID.QueenSlimeBoss, Item.buyPrice(0, 16) }, - { NPCID.Spazmatism, Item.buyPrice(0, 16) }, - { NPCID.Retinazer, Item.buyPrice(0, 16) }, - { NPCID.TheDestroyer, Item.buyPrice(0, 16) }, - { NPCID.SkeletronPrime, Item.buyPrice(0, 16) }, - { NPCID.Plantera, Item.buyPrice(0, 20) }, - { NPCID.Golem, Item.buyPrice(0, 25) }, - { NPCID.HallowBoss, Item.buyPrice(0, 30) }, - { NPCID.DukeFishron, Item.buyPrice(0, 30) }, - { NPCID.CultistBoss, Item.buyPrice(0, 50) } - // Moon Lord drops 1 plat in vanilla; unmodified - }; - } - - public override void Unload() - { - Dict?.Clear(); - Dict = null; - } - - public static bool TryGet(int npcType, out int value) - { - return Dict.TryGetValue(npcType, out value); - } - } -} diff --git a/Systems/Collections/NPCs/BuffedDungeonEnemiesList.cs b/Systems/Collections/NPCs/BuffedDungeonEnemiesList.cs 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 dbc3aa6ffd..0000000000 --- a/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs +++ /dev/null @@ -1,154 +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.DevourerBody, - NPCID.DevourerTail, - NPCID.DiggerBody, - NPCID.DiggerTail, - NPCID.TombCrawlerBody, - NPCID.TombCrawlerTail, - NPCID.DuneSplicerBody, - NPCID.DuneSplicerTail, - NPCID.GiantWormBody, - NPCID.GiantWormTail, - NPCID.LeechBody, - NPCID.LeechTail, - NPCID.StardustWormBody, - NPCID.StardustWormTail, - NPCID.SeekerBody, - NPCID.SeekerTail, - NPCID.BoneSerpentBody, - NPCID.BoneSerpentTail, - NPCID.WyvernBody, - NPCID.WyvernTail, - NPCID.WyvernBody2, - NPCID.WyvernBody3, - NPCID.WyvernLegs, - NPCID.CultistDragonBody1, - NPCID.CultistDragonBody2, - NPCID.CultistDragonBody3, - NPCID.CultistDragonBody4, - NPCID.CultistDragonTail, - NPCID.BloodEelBody, - NPCID.BloodEelTail, - NPCID.AncientDoom - ]; - } - - public override void Unload() => List = null; - - public static bool Includes(int npcType) => List.Contains(npcType); - } -} diff --git a/Systems/Collections/NeedsDebuffIconDisplayList.cs b/Systems/Collections/NeedsDebuffIconDisplayList.cs 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 c3e9ad4195..98906a763f 100644 --- a/Systems/Mechanic/DifficultyModeSystem.cs +++ b/Systems/Mechanic/DifficultyModeSystem.cs @@ -1,14 +1,17 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using CalamityMod.Items.Armor.Demonshade; 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; +using Terraria.GameContent.Creative; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -20,21 +23,32 @@ 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 public static int MostAlternateDifficulties; //The most alternate difficulties at any tier that exists. Used to know the widest space to take in the ui - public override void Load() + 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 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); + journeyDifficultyUpdateMethod = typeof(CreativePowers.DifficultySliderPower).GetMethod("UpdateInfoFromSliderValueCache", BindingFlags.Instance | BindingFlags.NonPublic); CalculateDifficultyData(); } - public override void Unload() + public override void OnModUnload() { Difficulties = null; } @@ -42,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.expertMode && !Main.masterMode && GetCurrentDifficulty == DeathDifficulty.Instance) - ModeIndicatorUI.SwitchToDifficulty(RevengeanceDifficulty.Instance); - if (Main.masterMode && 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 { @@ -95,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) { @@ -127,26 +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 SoundStyle ActivationSound; - - public Color ChatTextColor; - - 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. @@ -161,141 +281,120 @@ namespace CalamityMod.Systems public override bool Enabled { get => true; - set => Main.GameMode = value == true ? GameModeID.Normal : GameModeID.Expert; - } - - private Asset _texture; - public override Asset Texture - { - get + set { - 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; + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Normal : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } } } - public NoDifficulty() - { - DifficultyScale = 0; - Name = GetText("UI.Classic"); - ShortDescription = GetText("UI.ClassicInfo"); + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic"); - ActivationSound = SoundID.MenuTick with { Volume = 1f }; + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Off"); - ChatTextColor = Color.White; - Instance = this; - } + public override SoundStyle ActivationSound => _activationSound ??= SoundID.MenuTick with { Volume = 1f }; - public static NoDifficulty Instance { get; private set; } = null; + public override int BackBoneGameModeID => GameModeID.Normal; + + 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 { public override bool Enabled { - get => Main.expertMode; - set => Main.GameMode = value == true ? GameModeID.Expert : GameModeID.Normal; - } - - private Asset _texture; - public override Asset Texture - { - get + get => Main.getGoodWorld ? Main.masterMode : Main.expertMode; + set { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert"); - - return _texture; + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Expert : GameModeID.Normal; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } } } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Off"); - return _textureDisabled; - } - } + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert"); + + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Off"); + + 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 = GetText("UI.Expert"); - ShortDescription = GetText("UI.ExpertShortInfo"); + public override LocalizedText FTWName => Language.GetText("UI.Master"); - ActivationSound = SoundID.ForceRoarPitched; - - ChatTextColor = new Color(255, 186, 117); - 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 { public override bool Enabled { - get => Main.masterMode; - set => Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; - } - - private Asset _texture; - public override Asset Texture - { - get + get => Main.getGoodWorld ? CalamityWorld.LegendaryMode : Main.masterMode; + set { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master"); - - return _texture; + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } } } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Off"); - return _textureDisabled; - } - } + 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"); + + public override SoundStyle ActivationSound => _activationSound ??= SoundID.NPCDeath10; + + 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 = GetText("UI.Master"); - ShortDescription = GetText("UI.MasterShortInfo"); + public override LocalizedText FTWName => Language.GetText("UI.Legendary"); - ActivationSound = SoundID.NPCDeath10; + public override Color FTWTextColor => Main.legendaryModeColor; - ChatTextColor = new Color(28, 255, 170); - Instance = this; - } - - public static MasterDifficulty Instance { get; private set; } = null; } public class RevengeanceDifficulty : DifficultyMode @@ -303,31 +402,33 @@ namespace CalamityMod.Systems public override bool Enabled { get => CalamityWorld.revenge; - set => CalamityWorld.revenge = value; - } - - private Asset _texture; - public override Asset Texture - { - get + set { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev"); - - return _texture; + if (Main.getGoodWorld) + { + CalamityWorld.revenge = value; + CalamityWorld.death = value; + } + else + CalamityWorld.revenge = value; } } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Off"); - return _textureDisabled; - } - } + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev"); + + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Off"); + + 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 { @@ -339,65 +440,57 @@ namespace CalamityMod.Systems } } - public RevengeanceDifficulty() - { - DifficultyScale = 0.25f; - Name = GetText("UI.Revengeance"); - ShortDescription = GetText("UI.RevengeanceShortInfo"); + public override LocalizedText FTWName => GetText("UI.Death"); - ActivationSound = SoundID.Item119; - - ChatTextColor = new Color(211, 42, 42); - Instance = this; - } - - public static RevengeanceDifficulty Instance { get; private set; } = null; + public override Color FTWTextColor => new Color(192, 64, 219); } public class DeathDifficulty : DifficultyMode { public override bool Enabled { - get => CalamityWorld.death; - set => CalamityWorld.death = value; - } - - private Asset _texture; - public override Asset Texture - { - get + get => Main.getGoodWorld ? CalamityWorld.death && CalamityWorld.LegendaryMode : CalamityWorld.death; + set { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death"); - - return _texture; + if (Main.getGoodWorld) + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } + CalamityWorld.death = value; + } + else + CalamityWorld.death = value; } } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off"); - return _textureDisabled; - } - } + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death"); + + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off"); + + 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"); - ActivationSound = DemonshadeHelm.ActivationSound; + public override LocalizedText FTWName => GetText("UI.Malice"); - ChatTextColor = new Color(192, 64, 219); - Instance = this; - } + public override Color FTWTextColor => new Color(240, 128, 128); public override int[] FavoredDifficultyAtTier(int tier) { @@ -407,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); } @@ -416,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 079d1cd2ad..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; @@ -956,14 +958,6 @@ namespace CalamityMod.Systems convert[ItemID.LifeformAnalyzer] = ItemID.Stopwatch; convert[ItemID.Stopwatch] = ItemID.DPSMeter; - // Pyramid loot edits. There's no good way to have this not be hardcoded. - convert[ItemID.PharaohsMask] = ItemID.PharaohsRobe; - convert[ItemID.PharaohsRobe] = ItemID.PharaohsMask; - - convert[ItemID.AmberHook] = ItemID.SandstorminaBottle; - convert[ItemID.SandstorminaBottle] = ItemID.FlyingCarpet; - convert[ItemID.FlyingCarpet] = ItemID.AmberHook; - // Enchanted Sword and Terragrim shimmer into each other convert[ItemID.EnchantedSword] = ItemID.Terragrim; convert[ItemID.Terragrim] = ItemID.EnchantedSword; @@ -1608,19 +1602,6 @@ namespace CalamityMod.Systems r.AddTile(TileID.Loom); r.Register(); r.DisableDecraft(); - - // Pharaoh set (replaced Chest items) - r = Recipe.Create(ItemID.PharaohsMask); - r.AddIngredient(ItemID.AncientCloth, 3); - r.AddTile(TileID.Loom); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.PharaohsRobe); - r.AddIngredient(ItemID.AncientCloth, 4); - r.AddTile(TileID.Loom); - r.Register(); - r.DisableDecraft(); } #endregion @@ -1651,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/Mechanic/TilePingerSystem.cs b/Systems/Mechanic/TilePingerSystem.cs index f28c9cb3b1..e33c7ad470 100644 --- a/Systems/Mechanic/TilePingerSystem.cs +++ b/Systems/Mechanic/TilePingerSystem.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.Graphics.Effects; using Terraria.Graphics.Light; using Terraria.ID; @@ -83,6 +84,8 @@ namespace CalamityMod.Systems pingedTiles = new Dictionary>(); pingedNonSolidTiles = new Dictionary>(); tileEffects = new Dictionary(); + + On_TileDrawing.DrawTiles_GetLightOverride += ForceSufficientLight; } public override void Unload() @@ -93,6 +96,42 @@ namespace CalamityMod.Systems tileEffects = null; } + private static Color ForceSufficientLight(On_TileDrawing.orig_DrawTiles_GetLightOverride orig, TileDrawing self, int j, int i, Tile tileCache, ushort typeCache, short tileFrameX, short tileFrameY, Color tileLight) + { + Color returnColor = orig(self, j, i, tileCache, typeCache, tileFrameX, tileFrameY, tileLight); + foreach (IPingedTileEffect effect in tileEffects.Values) + { + // Nothing else uses this so like should be okay + if (effect is WulfrumPingTileEffect w && effect.Active && effect.ShouldRegisterTile(i, j)) + { + float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - WulfrumPingTileEffect.PingCenter).Length(); + float currentExpansion = MathHelper.Clamp(WulfrumPingTileEffect.PingProgress * WulfrumPingTileEffect.MaxPingLife / (float)WulfrumPingTileEffect.MaxPingTravelTime, 0f, 1f) * WulfrumPingTileEffect.MaxPingRadius; + + if (distanceFromCenter - 8 > currentExpansion) + return returnColor; + + float brightness = 1f; + Tile tile = Framing.GetTileSafely(i, j); + //Counteracts slopes and half tiles being too bright + if (tile.Slope != SlopeType.Solid || tile.IsHalfBlock) + brightness = 0.64f; + + //Fade on the edges + if (distanceFromCenter + 8 > currentExpansion) + brightness *= 1 - (distanceFromCenter - currentExpansion + 8f) / 16f; + + //Fade away with the effect + brightness *= 1 - Math.Max(WulfrumPingTileEffect.PingProgress - 0.9f, 0) / (0.1f); + + if (tileLight.R < 200 * brightness) tileLight.R = (byte)(200 * brightness); + if (tileLight.G < 200 * brightness) tileLight.G = (byte)(200 * brightness); + if (tileLight.B < 200 * brightness) tileLight.B = (byte)(200 * brightness); + returnColor = tileLight; + } + } + return returnColor; + } + public static bool AddPing(string effectName, Vector2 position, Player pinger) { if (!Main.dedServ) @@ -231,11 +270,11 @@ namespace CalamityMod.Systems public class WulfrumPingTileEffect : IPingedTileEffect, ILoadable { internal static Texture2D emptyFrame; - const int MaxPingLife = 350; - const int MaxPingTravelTime = 60; + public const int MaxPingLife = 350; + public const int MaxPingTravelTime = 60; const float PingWaveThickness = 50f; - const float MaxPingRadius = 1700f; + public const float MaxPingRadius = 1700f; public static Vector2 PingCenter = Vector2.Zero; public static int PingTimer = 0; public static float PingProgress => (MaxPingLife - PingTimer) / (float)MaxPingLife; @@ -316,7 +355,8 @@ namespace CalamityMod.Systems Main.spriteBatch.Draw(emptyFrame, pos.ToWorldCoordinates() - Main.screenPosition, null, Color.White, 0, new Vector2(emptyFrame.Width / 2f, emptyFrame.Height / 2f), 16f, 0, 0); } - public void EditDrawData(int i, int j, ref TileDrawInfo drawData) + // CIT 16JUL2025: Tile lighting override is now applied via an On edit; this code is duplicated there, and thus is no longer needed here. + /*public void EditDrawData(int i, int j, ref TileDrawInfo drawData) { float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - PingCenter).Length(); float currentExpansion = MathHelper.Clamp(PingProgress * MaxPingLife / (float)MaxPingTravelTime, 0f, 1f) * MaxPingRadius; @@ -333,14 +373,14 @@ namespace CalamityMod.Systems //Fade on the edges if (distanceFromCenter + 8 > currentExpansion) brightness *= 1 - (distanceFromCenter - currentExpansion + 8f) / 16f; - + //Fade away with the effect brightness *= 1 - Math.Max(PingProgress - 0.9f, 0) / (0.1f); if (drawData.tileLight.R < 200 * brightness) drawData.tileLight.R = (byte)(200 * brightness); if (drawData.tileLight.G < 200 * brightness) drawData.tileLight.G = (byte)(200 * brightness); if (drawData.tileLight.B < 200 * brightness) drawData.tileLight.B = (byte)(200 * brightness); - } + }*/ public void UpdateEffect() { diff --git a/Systems/Mechanic/WorldSelectionDifficultySystem.cs b/Systems/Mechanic/WorldSelectionDifficultySystem.cs index 18d7107050..677911be0c 100644 --- a/Systems/Mechanic/WorldSelectionDifficultySystem.cs +++ b/Systems/Mechanic/WorldSelectionDifficultySystem.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Systems { WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Revengeance"), GetRevengeance, new(211, 42, 42))); WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Death"), GetDeath, new(192, 64, 219))); - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathLegend"), GetLegendDeath, new(220, 255, 132))); // Defiled color + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Malice"), GetMalice, new(240, 128, 128))); } } @@ -51,17 +51,25 @@ namespace CalamityMod.Systems public static bool GetDeath(AWorldListItem item) { + // Grab data from the listed world + FieldInfo worldDataField = typeof(UIWorldListItem).GetField("_data", BindingFlags.NonPublic | BindingFlags.Instance); + WorldFileData worldData = (WorldFileData)worldDataField.GetValue(item); + if (item.Data.TryGetHeaderData(out TagCompound tag)) { if (tag.ContainsKey("DeathMode") && tag.GetBool("DeathMode")) { return true; } + else if (tag.ContainsKey("RevengeanceMode") && tag.GetBool("RevengeanceMode")) + { + return worldData.ForTheWorthy; + } } return false; } - public static bool GetLegendDeath(AWorldListItem item) + public static bool GetMalice(AWorldListItem item) { // Grab data from the listed world FieldInfo worldDataField = typeof(UIWorldListItem).GetField("_data", BindingFlags.NonPublic | BindingFlags.Instance); 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/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index be629644b2..4afdf26048 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -224,13 +224,6 @@ namespace CalamityMod.Systems int sunkenSeaX = (GenVars.UndergroundDesertLocation.Left + GenVars.UndergroundDesertLocation.Right) / 2; int sunkenSeaY = Main.maxTilesY / 2; - SunkenSea.ForLoop = CalamityClientConfig.Instance.SunkenSeaMultiThreading switch - { - 2 => SunkenSea.CSharpParallelFor, - 1 => SunkenSea.ReLogicParallelFor, - _ => SunkenSea.NormalForLoop, - }; - // place each piece of the sunken sea based on the above positons // messages intentionally in the "incorrect" order for the player's experience. diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 78fcd95db6..4e1dd4117b 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -1,7 +1,7 @@ using System.IO; using CalamityMod.CustomRecipes; using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.Packets; using CalamityMod.Systems.Collections; using CalamityMod.Tiles.DraedonSummoner; @@ -65,7 +65,7 @@ namespace CalamityMod.TileEntities public bool ContainsVoltageRegulationSystem; public bool ContainsCoolingCell; - public bool ContainsBloodSample; + public bool ContainsBloodyVein; public bool CanDecryptHeldSchematic { @@ -163,7 +163,7 @@ namespace CalamityMod.TileEntities totalCellsToDrop = 999; InputtedCellCount -= totalCellsToDrop; - int itemType = ContainsBloodSample ? ModContent.ItemType() : ModContent.ItemType(); + int itemType = ContainsBloodyVein ? ModContent.ItemType() : ModContent.ItemType(); Item.NewItem(new EntitySource_TileEntity(this), x * 16, y * 16, 32, 32, itemType, totalCellsToDrop); } } @@ -270,7 +270,7 @@ namespace CalamityMod.TileEntities tag["HeldSchematicID"] = HeldSchematicID; tag["DecryptionCountdown"] = DecryptionCountdown; tag["InitialCellCountBeforeDecrypting"] = InitialCellCountBeforeDecrypting; - tag["ContainsBloodSample"] = ContainsBloodSample; + tag["ContainsBloodyVein"] = ContainsBloodyVein; } public override void LoadData(TagCompound tag) @@ -284,7 +284,7 @@ namespace CalamityMod.TileEntities HeldSchematicID = tag.GetInt("HeldSchematicID"); DecryptionCountdown = tag.GetInt("DecryptionCountdown"); InitialCellCountBeforeDecrypting = tag.GetInt("InitialCellCountBeforeDecrypting"); - ContainsBloodSample = tag.GetBool("ContainsBloodSample"); + ContainsBloodyVein = tag.GetBool("ContainsBloodyVein"); } public override void NetSend(BinaryWriter writer) @@ -298,7 +298,7 @@ namespace CalamityMod.TileEntities writer.Write(HeldSchematicID); writer.Write(DecryptionCountdown); writer.Write(InitialCellCountBeforeDecrypting); - writer.Write(ContainsBloodSample); + writer.Write(ContainsBloodyVein); } public override void NetReceive(BinaryReader reader) @@ -312,7 +312,7 @@ namespace CalamityMod.TileEntities HeldSchematicID = reader.ReadInt32(); DecryptionCountdown = reader.ReadInt32(); InitialCellCountBeforeDecrypting = reader.ReadInt32(); - ContainsBloodSample = reader.ReadBoolean(); + ContainsBloodyVein = reader.ReadBoolean(); } } } diff --git a/Tiles/Abyss/AbyssAmbient/PirateCrate.cs b/Tiles/Abyss/AbyssAmbient/PirateCrate.cs index 4aa4856eb8..935afa9232 100644 --- a/Tiles/Abyss/AbyssAmbient/PirateCrate.cs +++ b/Tiles/Abyss/AbyssAmbient/PirateCrate.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient //explode when broken (troll!) //also instakill players in for the worthy Vector2 spawnPosition = new(i * 16f + 24f, j * 16f - 4f); - // NOTE: The damage of ProjectileID.Explosives is reduced in CalamityPlayerHitHurt, this actually deals 52 / 67 / 101 damage. + // NOTE: The damage of ProjectileID.Explosives is reduced in CalamityPlayerHitHurt, this actually deals 105 / 210 / 315 damage. int blastDamage = (Main.getGoodWorld ? 99999 : 150) * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1); Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition.X, spawnPosition.Y, 0, 0, ProjectileID.Explosives, blastDamage, 0f); 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/Abyss/VoidTorch.cs b/Tiles/Abyss/VoidTorch.cs index d3074ce982..df6d9c0339 100644 --- a/Tiles/Abyss/VoidTorch.cs +++ b/Tiles/Abyss/VoidTorch.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { + [LegacyName("AbyssTorch")] public class VoidTorch : ModTile { public override void SetStaticDefaults() => this.SetUpTorch(ModContent.ItemType(), true, true); 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/Furniture/CraftingStations/AncientAltar.cs b/Tiles/FurnitureAncient/AncientAltar.cs similarity index 89% rename from Tiles/Furniture/CraftingStations/AncientAltar.cs rename to Tiles/FurnitureAncient/AncientAltar.cs index fb2008520f..99eb9e3e74 100644 --- a/Tiles/Furniture/CraftingStations/AncientAltar.cs +++ b/Tiles/FurnitureAncient/AncientAltar.cs @@ -7,7 +7,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureAncient { public class AncientAltar : ModTile { @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.newTile.LavaDeath = false; TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } @@ -58,7 +58,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/AncientAltarFlame").Value, i, j, offsetY: animationFrame * AnimationFrameHeight); + CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAncient/AncientAltarFlame").Value, i, j, offsetY: animationFrame * AnimationFrameHeight); } public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) diff --git a/Tiles/Furniture/CraftingStations/AncientAltar.png b/Tiles/FurnitureAncient/AncientAltar.png similarity index 100% rename from Tiles/Furniture/CraftingStations/AncientAltar.png rename to Tiles/FurnitureAncient/AncientAltar.png diff --git a/Tiles/Furniture/CraftingStations/AncientAltarFlame.png b/Tiles/FurnitureAncient/AncientAltarFlame.png similarity index 100% rename from Tiles/Furniture/CraftingStations/AncientAltarFlame.png rename to Tiles/FurnitureAncient/AncientAltarFlame.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/Furniture/CraftingStations/BotanicPlanter.cs b/Tiles/FurnitureBotanic/BotanicPlanter.cs similarity index 93% rename from Tiles/Furniture/CraftingStations/BotanicPlanter.cs rename to Tiles/FurnitureBotanic/BotanicPlanter.cs index 1d620f9c18..f1ab9e9ee2 100644 --- a/Tiles/Furniture/CraftingStations/BotanicPlanter.cs +++ b/Tiles/FurnitureBotanic/BotanicPlanter.cs @@ -7,7 +7,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureBotanic { public class BotanicPlanter : ModTile { @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.StyleLineSkip = 2; TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } diff --git a/Tiles/Furniture/CraftingStations/BotanicPlanter.png b/Tiles/FurnitureBotanic/BotanicPlanter.png similarity index 100% rename from Tiles/Furniture/CraftingStations/BotanicPlanter.png rename to Tiles/FurnitureBotanic/BotanicPlanter.png 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/FurnitureDriftwood/DriftwoodBaroqueCello.cs b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.cs new file mode 100644 index 0000000000..d2474ec746 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBaroqueCello : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); //This Cello has bookcase dimensions + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetText("Tiles.BaroqueCello")); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.png b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.png new file mode 100644 index 0000000000..d8de02541c Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBathtub.cs b/Tiles/FurnitureDriftwood/DriftwoodBathtub.cs new file mode 100644 index 0000000000..e4119a2b31 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBathtub.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBathtub : ModTile + { + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBathtub.png b/Tiles/FurnitureDriftwood/DriftwoodBathtub.png new file mode 100644 index 0000000000..f38650ae70 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBathtub.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBed.cs b/Tiles/FurnitureDriftwood/DriftwoodBed.cs new file mode 100644 index 0000000000..ffe489ed40 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBed.cs @@ -0,0 +1,30 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBed : ModTile + { + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBed.png b/Tiles/FurnitureDriftwood/DriftwoodBed.png new file mode 100644 index 0000000000..c4e1380f12 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBed.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBed_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodBed_Highlight.png new file mode 100644 index 0000000000..5974b70765 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBed_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBookcase.cs b/Tiles/FurnitureDriftwood/DriftwoodBookcase.cs new file mode 100644 index 0000000000..69d45e8b87 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBookcase.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBookcase : ModTile + { + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBookcase.png b/Tiles/FurnitureDriftwood/DriftwoodBookcase.png new file mode 100644 index 0000000000..8bd062dc7e Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBookcase.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandelabra.cs b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.cs new file mode 100644 index 0000000000..8bad131ba0 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.cs @@ -0,0 +1,44 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodCandelabra : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandelabra.png b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.png new file mode 100644 index 0000000000..a80821e5a7 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandle.cs b/Tiles/FurnitureDriftwood/DriftwoodCandle.cs new file mode 100644 index 0000000000..4d42b720bc --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodCandle.cs @@ -0,0 +1,58 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodCandle : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, 1, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandle.png b/Tiles/FurnitureDriftwood/DriftwoodCandle.png new file mode 100644 index 0000000000..a89e4a3b12 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodCandle.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChair.cs b/Tiles/FurnitureDriftwood/DriftwoodChair.cs new file mode 100644 index 0000000000..de72102d2f --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodChair.cs @@ -0,0 +1,37 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodChair : ModTile + { + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodChair.png b/Tiles/FurnitureDriftwood/DriftwoodChair.png new file mode 100644 index 0000000000..f540f21d51 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChair.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChair_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodChair_Highlight.png new file mode 100644 index 0000000000..6c8693094f Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChair_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChandelier.cs b/Tiles/FurnitureDriftwood/DriftwoodChandelier.cs new file mode 100644 index 0000000000..e520931848 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodChandelier.cs @@ -0,0 +1,47 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodChandelier : ModTile + { + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodChandelier.png b/Tiles/FurnitureDriftwood/DriftwoodChandelier.png new file mode 100644 index 0000000000..2f7510c14d Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChandelier.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChest.cs b/Tiles/FurnitureDriftwood/DriftwoodChest.cs new file mode 100644 index 0000000000..2672cb6c9e --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodChest.cs @@ -0,0 +1,32 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodChest : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChest(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodChest.png b/Tiles/FurnitureDriftwood/DriftwoodChest.png new file mode 100644 index 0000000000..63df766217 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChest.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChest_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodChest_Highlight.png new file mode 100644 index 0000000000..61e5b0044f Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChest_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.cs b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.cs new file mode 100644 index 0000000000..ef8946da38 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodDoorClosed : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorClosed(ModContent.ItemType(), true); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.png b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.png new file mode 100644 index 0000000000..5884fc811f Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorClosed_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed_Highlight.png new file mode 100644 index 0000000000..c923098653 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.cs b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.cs new file mode 100644 index 0000000000..b0561247ab --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodDoorOpen : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorOpen(ModContent.ItemType(), true); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.png b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.png new file mode 100644 index 0000000000..c57116c347 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorOpen_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen_Highlight.png new file mode 100644 index 0000000000..8121934574 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDresser.cs b/Tiles/FurnitureDriftwood/DriftwoodDresser.cs new file mode 100644 index 0000000000..2c0d90f00d --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodDresser.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodDresser : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Firework_Blue, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Firework_Pink, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodDresser.png b/Tiles/FurnitureDriftwood/DriftwoodDresser.png new file mode 100644 index 0000000000..b942c92ed3 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDresser.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDresser_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodDresser_Highlight.png new file mode 100644 index 0000000000..726973d772 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDresser_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodLamp.cs b/Tiles/FurnitureDriftwood/DriftwoodLamp.cs new file mode 100644 index 0000000000..dcc3a7131d --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodLamp.cs @@ -0,0 +1,44 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodLamp : ModTile + { + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodLamp.png b/Tiles/FurnitureDriftwood/DriftwoodLamp.png new file mode 100644 index 0000000000..2669926efb Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodLamp.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodLantern.cs b/Tiles/FurnitureDriftwood/DriftwoodLantern.cs new file mode 100644 index 0000000000..f56e3c9a62 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodLantern.cs @@ -0,0 +1,46 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodLantern : ModTile + { + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodLantern.png b/Tiles/FurnitureDriftwood/DriftwoodLantern.png new file mode 100644 index 0000000000..fb3e61ddc8 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodLantern.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodPlatform.cs b/Tiles/FurnitureDriftwood/DriftwoodPlatform.cs new file mode 100644 index 0000000000..2ea14a89b7 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodPlatform.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodPlatform : ModTile + { + public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodPlatform.png b/Tiles/FurnitureDriftwood/DriftwoodPlatform.png new file mode 100644 index 0000000000..339f2394e9 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodPlatform.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSink.cs b/Tiles/FurnitureDriftwood/DriftwoodSink.cs new file mode 100644 index 0000000000..abfdaf46f1 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodSink.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodSink : ModTile + { + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodSink.png b/Tiles/FurnitureDriftwood/DriftwoodSink.png new file mode 100644 index 0000000000..ba278cfee0 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSink.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSofa.cs b/Tiles/FurnitureDriftwood/DriftwoodSofa.cs new file mode 100644 index 0000000000..da22040621 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodSofa.cs @@ -0,0 +1,37 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodSofa : ModTile + { + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodSofa.png b/Tiles/FurnitureDriftwood/DriftwoodSofa.png new file mode 100644 index 0000000000..d9043d2231 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSofa.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSofa_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodSofa_Highlight.png new file mode 100644 index 0000000000..8b6a408e46 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSofa_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSundial.cs b/Tiles/FurnitureDriftwood/DriftwoodSundial.cs new file mode 100644 index 0000000000..2dacba82d0 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodSundial.cs @@ -0,0 +1,41 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodSundial : ModTile + { + public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType(), true); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool RightClick(int x, int y) + { + return CalamityUtils.ClockRightClick(); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.SceneMetrics.HasClock = true; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodSundial.png b/Tiles/FurnitureDriftwood/DriftwoodSundial.png new file mode 100644 index 0000000000..5601159701 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSundial.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSundial_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodSundial_Highlight.png new file mode 100644 index 0000000000..6c3469902b Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSundial_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodTable.cs b/Tiles/FurnitureDriftwood/DriftwoodTable.cs new file mode 100644 index 0000000000..3a233fa6e2 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodTable.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodTable : ModTile + { + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodTable.png b/Tiles/FurnitureDriftwood/DriftwoodTable.png new file mode 100644 index 0000000000..24259b2899 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodTable.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodToilet.cs b/Tiles/FurnitureDriftwood/DriftwoodToilet.cs new file mode 100644 index 0000000000..d92e67baee --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodToilet.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodToilet : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + // Toilets count as Chairs + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Toilet")); + TileID.Sets.CanBeSatOnForNPCs[Type] = true; + TileID.Sets.CanBeSatOnForPlayers[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + AdjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Granite, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, shitter: true); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + + public override void HitWire(int i, int j) // I hate this please make it stop. - Merkalto + { + Tile tile = Main.tile[i, j]; + + int spawnX = i; + int spawnY = j - tile.TileFrameY / 18; + + Wiring.SkipWire(spawnX, spawnY); + Wiring.SkipWire(spawnX, spawnY + 1); + + if (Wiring.CheckMech(spawnX, spawnY, 60)) + { + Projectile.NewProjectile(Wiring.GetProjectileSource(spawnX, spawnY), spawnX * 16 + 8, spawnY * 16 + 12, 0f, 0f, ProjectileID.ToiletEffect, 0, 0f, Main.myPlayer); + } + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodToilet.png b/Tiles/FurnitureDriftwood/DriftwoodToilet.png new file mode 100644 index 0000000000..cb478a2214 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodToilet.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodToilet_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodToilet_Highlight.png new file mode 100644 index 0000000000..784cd7f73c Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodToilet_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodWorkBench.cs b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.cs new file mode 100644 index 0000000000..eec1af1d56 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodWorkBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodWorkBench.png b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.png new file mode 100644 index 0000000000..47a279ce7b Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.png differ 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/Furniture/CraftingStations/MonolithAmalgam.cs b/Tiles/FurnitureMonolith/MonolithAmalgam.cs similarity index 85% rename from Tiles/Furniture/CraftingStations/MonolithAmalgam.cs rename to Tiles/FurnitureMonolith/MonolithAmalgam.cs index 8d19243ab9..7f1ef8c29d 100644 --- a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Tiles/FurnitureMonolith/MonolithAmalgam.cs @@ -4,15 +4,15 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureMonolith { [LegacyName("MonolithCrafting")] public class MonolithAmalgam : ModTile { public override void SetStaticDefaults() { - this.SetUpBookcase(ModContent.ItemType(), true, false, false); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + this.SetUpBookcase(ModContent.ItemType(), true, false, false); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); } public override bool CreateDust(int i, int j, ref int type) @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/MonolithAmalgamGlow").Value; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithAmalgamGlow").Value; Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgam.png b/Tiles/FurnitureMonolith/MonolithAmalgam.png similarity index 100% rename from Tiles/Furniture/CraftingStations/MonolithAmalgam.png rename to Tiles/FurnitureMonolith/MonolithAmalgam.png diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgamGlow.png b/Tiles/FurnitureMonolith/MonolithAmalgamGlow.png similarity index 100% rename from Tiles/Furniture/CraftingStations/MonolithAmalgamGlow.png rename to Tiles/FurnitureMonolith/MonolithAmalgamGlow.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs new file mode 100644 index 0000000000..7fa416acca --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBathtub")] + public class AncientNavystoneBathtub : ModTile + { + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBathtub.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBathtub.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs new file mode 100644 index 0000000000..a8d3e2b403 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs @@ -0,0 +1,31 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBed")] + public class AncientNavystoneBed : ModTile + { + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBed.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png diff --git a/Tiles/FurnitureEutrophic/EutrophicBed_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBed_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs new file mode 100644 index 0000000000..10e7e3fe2b --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBench")] + public class AncientNavystoneBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), false, true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBench.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBench.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png diff --git a/Tiles/FurnitureEutrophic/EutrophicBench_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBench_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs new file mode 100644 index 0000000000..d4411a6561 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBookcase")] + public class AncientNavystoneBookcase : ModTile + { + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBookcase.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBookcase.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs new file mode 100644 index 0000000000..c98491aaa5 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandelabra")] + public class AncientNavystoneCandelabra : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicCandelabra.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicCandelabra.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs new file mode 100644 index 0000000000..c5ec992870 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs @@ -0,0 +1,59 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandle")] + public class AncientNavystoneCandle : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicCandle.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicCandle.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs new file mode 100644 index 0000000000..7baefbb973 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChair")] + public class AncientNavystoneChair : ModTile + { + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicChair.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChair.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png diff --git a/Tiles/FurnitureEutrophic/EutrophicChair_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChair_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs new file mode 100644 index 0000000000..4ca18e0ca4 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChandelier")] + public class AncientNavystoneChandelier : ModTile + { + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicChandelier.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChandelier.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs new file mode 100644 index 0000000000..3677bff276 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChest")] + public class AncientNavystoneChest : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChest(ModContent.ItemType(), true); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChest.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png diff --git a/Tiles/FurnitureEutrophic/EutrophicChest_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChest_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs new file mode 100644 index 0000000000..a4b73e2700 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs @@ -0,0 +1,58 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicClock")] + public class AncientNavystoneClock : ModTile + { + public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool RightClick(int x, int y) + { + return CalamityUtils.ClockRightClick(); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.SceneMetrics.HasClock = true; + } + } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicClock.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicClock.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png diff --git a/Tiles/FurnitureEutrophic/EutrophicClock_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicClock_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.cs new file mode 100644 index 0000000000..eac29d4996 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.cs @@ -0,0 +1,39 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDoorClosed")] + public class AncientNavystoneDoorClosed : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorClosed(ModContent.ItemType()); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorClosed.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.png diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorClosed_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.cs new file mode 100644 index 0000000000..d9ca902825 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Placeables.FurnitureNavystone; +using CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDoorOpen")] + public class AncientNavystoneDoorOpen : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorOpen(ModContent.ItemType()); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorOpen.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.png diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorOpen_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs new file mode 100644 index 0000000000..be8cbe7258 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDresser")] + public class AncientNavystoneDresser : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDresser.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDresser_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs new file mode 100644 index 0000000000..ad6db914c5 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLamp")] + public class AncientNavystoneLamp : ModTile + { + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicLamp.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicLamp.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs new file mode 100644 index 0000000000..68c39d9298 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs @@ -0,0 +1,47 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLantern")] + public class AncientNavystoneLantern : ModTile + { + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicLantern.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs new file mode 100644 index 0000000000..a085e8e67f --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPiano")] + public class AncientNavystonePiano : ModTile + { + public override void SetStaticDefaults() => this.SetUpPiano(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicPiano.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicPiano.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs new file mode 100644 index 0000000000..94b3503972 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs @@ -0,0 +1,29 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPlatform")] + public class AncientNavystonePlatform : ModTile + { + public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicPlatform.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicPlatform.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs new file mode 100644 index 0000000000..4f7ab93d33 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicSink")] + public class AncientNavystoneSink : ModTile + { + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicSink.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicSink.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs new file mode 100644 index 0000000000..46cf5a9a78 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicTable")] + public class AncientNavystoneTable : ModTile + { + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicTable.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicTable.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs new file mode 100644 index 0000000000..2f52f6e75b --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicWorkBench")] + public class AncientNavystoneWorkBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicWorkBench.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicWorkBench.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png diff --git a/Tiles/FurnitureEutrophic/AncientSmoothNavystone.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs similarity index 92% rename from Tiles/FurnitureEutrophic/AncientSmoothNavystone.cs rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs index 18ae30d146..bee411f11d 100644 --- a/Tiles/FurnitureEutrophic/AncientSmoothNavystone.cs +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone { public class AncientSmoothNavystone : ModTile { diff --git a/Tiles/FurnitureEutrophic/AncientSmoothNavystone.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png similarity index 100% rename from Tiles/FurnitureEutrophic/AncientSmoothNavystone.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png diff --git a/Tiles/Furniture/CraftingStations/EutrophicShelf.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs similarity index 94% rename from Tiles/Furniture/CraftingStations/EutrophicShelf.cs rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs index dca632f30e..010779aa70 100644 --- a/Tiles/Furniture/CraftingStations/EutrophicShelf.cs +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone { [LegacyName("EutrophicCrafting")] public class EutrophicShelf : ModTile @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } diff --git a/Tiles/Furniture/CraftingStations/EutrophicShelf.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png similarity index 100% rename from Tiles/Furniture/CraftingStations/EutrophicShelf.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png diff --git a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs b/Tiles/FurnitureNavystone/NavystoneBathtub.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicBathtub.cs rename to Tiles/FurnitureNavystone/NavystoneBathtub.cs index 85dcf8c046..67b72afb56 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Tiles/FurnitureNavystone/NavystoneBathtub.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBathtub : ModTile + public class NavystoneBathtub : ModTile { - public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneBathtub.png b/Tiles/FurnitureNavystone/NavystoneBathtub.png new file mode 100644 index 0000000000..60f3952cb5 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBathtub.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.cs b/Tiles/FurnitureNavystone/NavystoneBed.cs similarity index 82% rename from Tiles/FurnitureEutrophic/EutrophicBed.cs rename to Tiles/FurnitureNavystone/NavystoneBed.cs index 5dd7734de4..31c8888783 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBed.cs +++ b/Tiles/FurnitureNavystone/NavystoneBed.cs @@ -4,11 +4,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBed : ModTile + public class NavystoneBed : ModTile { - public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { @@ -25,6 +25,6 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureNavystone/NavystoneBed.png b/Tiles/FurnitureNavystone/NavystoneBed.png new file mode 100644 index 0000000000..001728bd9a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBed.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneBed_Highlight.png b/Tiles/FurnitureNavystone/NavystoneBed_Highlight.png new file mode 100644 index 0000000000..b11dd25886 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBed_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs b/Tiles/FurnitureNavystone/NavystoneBookcase.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicBookcase.cs rename to Tiles/FurnitureNavystone/NavystoneBookcase.cs index cadb22b791..0ac994ccfa 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Tiles/FurnitureNavystone/NavystoneBookcase.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBookcase : ModTile + public class NavystoneBookcase : ModTile { - public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneBookcase.png b/Tiles/FurnitureNavystone/NavystoneBookcase.png new file mode 100644 index 0000000000..85c12525fb Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBookcase.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs b/Tiles/FurnitureNavystone/NavystoneCandelabra.cs similarity index 85% rename from Tiles/FurnitureEutrophic/EutrophicCandelabra.cs rename to Tiles/FurnitureNavystone/NavystoneCandelabra.cs index 524b5da0cf..61b6bcc3d8 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Tiles/FurnitureNavystone/NavystoneCandelabra.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicCandelabra : ModTile + public class NavystoneCandelabra : ModTile { - public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneCandelabra.png b/Tiles/FurnitureNavystone/NavystoneCandelabra.png new file mode 100644 index 0000000000..09672ac1cb Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneCandelabra.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicCandle.cs b/Tiles/FurnitureNavystone/NavystoneCandle.cs similarity index 86% rename from Tiles/FurnitureEutrophic/EutrophicCandle.cs rename to Tiles/FurnitureNavystone/NavystoneCandle.cs index 1b4f0db715..895adafb2b 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandle.cs +++ b/Tiles/FurnitureNavystone/NavystoneCandle.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicCandle : ModTile + public class NavystoneCandle : ModTile { - public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { @@ -46,7 +46,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Player player = Main.LocalPlayer; player.noThrow = 2; player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureNavystone/NavystoneCandle.png b/Tiles/FurnitureNavystone/NavystoneCandle.png new file mode 100644 index 0000000000..e1fe5f8507 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneCandle.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicChair.cs b/Tiles/FurnitureNavystone/NavystoneChair.cs similarity index 85% rename from Tiles/FurnitureEutrophic/EutrophicChair.cs rename to Tiles/FurnitureNavystone/NavystoneChair.cs index 2028c2a9c3..d06a33c753 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChair.cs +++ b/Tiles/FurnitureNavystone/NavystoneChair.cs @@ -6,11 +6,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicChair : ModTile + public class NavystoneChair : ModTile { - public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); - public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) { diff --git a/Tiles/FurnitureNavystone/NavystoneChair.png b/Tiles/FurnitureNavystone/NavystoneChair.png new file mode 100644 index 0000000000..30c65cd137 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChair.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png b/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png new file mode 100644 index 0000000000..fca0c61d27 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs b/Tiles/FurnitureNavystone/NavystoneChandelier.cs similarity index 86% rename from Tiles/FurnitureEutrophic/EutrophicChandelier.cs rename to Tiles/FurnitureNavystone/NavystoneChandelier.cs index c98b6590b7..0c681e1693 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Tiles/FurnitureNavystone/NavystoneChandelier.cs @@ -4,11 +4,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicChandelier : ModTile + public class NavystoneChandelier : ModTile { - public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); diff --git a/Tiles/FurnitureNavystone/NavystoneChandelier.png b/Tiles/FurnitureNavystone/NavystoneChandelier.png new file mode 100644 index 0000000000..9cc4db1d1c Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChandelier.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.cs b/Tiles/FurnitureNavystone/NavystoneChest.cs similarity index 76% rename from Tiles/FurnitureEutrophic/EutrophicChest.cs rename to Tiles/FurnitureNavystone/NavystoneChest.cs index 21053e81c1..232e559bea 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChest.cs +++ b/Tiles/FurnitureNavystone/NavystoneChest.cs @@ -5,14 +5,14 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicChest : ModTile + public class NavystoneChest : ModTile { public override void SetStaticDefaults() { - this.SetUpChest(ModContent.ItemType(), true); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + this.SetUpChest(ModContent.ItemType(), true); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); } public override bool CreateDust(int i, int j, ref int type) @@ -23,9 +23,9 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); - public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); - public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); } diff --git a/Tiles/FurnitureNavystone/NavystoneChest.png b/Tiles/FurnitureNavystone/NavystoneChest.png new file mode 100644 index 0000000000..b77c5ad9e5 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChest.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png b/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png new file mode 100644 index 0000000000..721846627a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicClock.cs b/Tiles/FurnitureNavystone/NavystoneClock.cs similarity index 88% rename from Tiles/FurnitureEutrophic/EutrophicClock.cs rename to Tiles/FurnitureNavystone/NavystoneClock.cs index c58bfde6cd..98806da830 100644 --- a/Tiles/FurnitureEutrophic/EutrophicClock.cs +++ b/Tiles/FurnitureNavystone/NavystoneClock.cs @@ -4,11 +4,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicClock : ModTile + public class NavystoneClock : ModTile { - public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType()); public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; @@ -52,6 +52,6 @@ namespace CalamityMod.Tiles.FurnitureEutrophic } } - public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureNavystone/NavystoneClock.png b/Tiles/FurnitureNavystone/NavystoneClock.png new file mode 100644 index 0000000000..ee92788132 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneClock.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png b/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png new file mode 100644 index 0000000000..813835a873 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs b/Tiles/FurnitureNavystone/NavystoneDoorClosed.cs similarity index 79% rename from Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs rename to Tiles/FurnitureNavystone/NavystoneDoorClosed.cs index 3fe3f15c77..1d65b6c141 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs +++ b/Tiles/FurnitureNavystone/NavystoneDoorClosed.cs @@ -4,14 +4,14 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicDoorClosed : ModTile + public class NavystoneDoorClosed : ModTile { public override void SetStaticDefaults() { - this.SetUpDoorClosed(ModContent.ItemType()); - TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + this.SetUpDoorClosed(ModContent.ItemType()); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); } public override bool CreateDust(int i, int j, ref int type) @@ -32,7 +32,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Player player = Main.LocalPlayer; player.noThrow = 2; player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureNavystone/NavystoneDoorClosed.png b/Tiles/FurnitureNavystone/NavystoneDoorClosed.png new file mode 100644 index 0000000000..f54be56f60 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorClosed.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png new file mode 100644 index 0000000000..e212eaa1db Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs b/Tiles/FurnitureNavystone/NavystoneDoorOpen.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs rename to Tiles/FurnitureNavystone/NavystoneDoorOpen.cs index 3a2e51ab7e..9a319a1f1e 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs +++ b/Tiles/FurnitureNavystone/NavystoneDoorOpen.cs @@ -1,18 +1,18 @@ -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicDoorOpen : ModTile + public class NavystoneDoorOpen : ModTile { public override void SetStaticDefaults() { - this.SetUpDoorOpen(ModContent.ItemType()); - TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + this.SetUpDoorOpen(ModContent.ItemType()); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); } public override bool CreateDust(int i, int j, ref int type) @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Player player = Main.LocalPlayer; player.noThrow = 2; player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureNavystone/NavystoneDoorOpen.png b/Tiles/FurnitureNavystone/NavystoneDoorOpen.png new file mode 100644 index 0000000000..409dfbc48d Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorOpen.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png new file mode 100644 index 0000000000..6b2214683a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser.cs b/Tiles/FurnitureNavystone/NavystoneDresser.cs similarity index 76% rename from Tiles/FurnitureEutrophic/EutrophicDresser.cs rename to Tiles/FurnitureNavystone/NavystoneDresser.cs index 8456bd20f4..1084bee069 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDresser.cs +++ b/Tiles/FurnitureNavystone/NavystoneDresser.cs @@ -5,14 +5,14 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicDresser : ModTile + public class NavystoneDresser : ModTile { public override void SetStaticDefaults() { - this.SetUpDresser(ModContent.ItemType()); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); } public override bool CreateDust(int i, int j, ref int type) @@ -23,9 +23,9 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); - public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); - public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); } diff --git a/Tiles/FurnitureNavystone/NavystoneDresser.png b/Tiles/FurnitureNavystone/NavystoneDresser.png new file mode 100644 index 0000000000..b720409b99 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDresser.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png new file mode 100644 index 0000000000..4caa037707 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicLamp.cs b/Tiles/FurnitureNavystone/NavystoneLamp.cs similarity index 86% rename from Tiles/FurnitureEutrophic/EutrophicLamp.cs rename to Tiles/FurnitureNavystone/NavystoneLamp.cs index 72a09fd1a8..bd7f000af4 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLamp.cs +++ b/Tiles/FurnitureNavystone/NavystoneLamp.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicLamp : ModTile + public class NavystoneLamp : ModTile { - public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneLamp.png b/Tiles/FurnitureNavystone/NavystoneLamp.png new file mode 100644 index 0000000000..8b639f35dc Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneLamp.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.cs b/Tiles/FurnitureNavystone/NavystoneLantern.cs similarity index 87% rename from Tiles/FurnitureEutrophic/EutrophicLantern.cs rename to Tiles/FurnitureNavystone/NavystoneLantern.cs index a238668f28..b7ef1ce6cc 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLantern.cs +++ b/Tiles/FurnitureNavystone/NavystoneLantern.cs @@ -4,11 +4,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicLantern : ModTile + public class NavystoneLantern : ModTile { - public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureNavystone/NavystoneLantern.png b/Tiles/FurnitureNavystone/NavystoneLantern.png new file mode 100644 index 0000000000..85eea88754 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneLantern.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicPiano.cs b/Tiles/FurnitureNavystone/NavystoneLyre.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicPiano.cs rename to Tiles/FurnitureNavystone/NavystoneLyre.cs index 7a52e16db4..5880f7e163 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPiano.cs +++ b/Tiles/FurnitureNavystone/NavystoneLyre.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicPiano : ModTile + public class NavystoneLyre : ModTile { - public override void SetStaticDefaults() => this.SetUpPiano(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpPiano(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneLyre.png b/Tiles/FurnitureNavystone/NavystoneLyre.png new file mode 100644 index 0000000000..e797fd1cb9 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneLyre.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs b/Tiles/FurnitureNavystone/NavystonePlatform.cs similarity index 78% rename from Tiles/FurnitureEutrophic/EutrophicPlatform.cs rename to Tiles/FurnitureNavystone/NavystonePlatform.cs index d4162d7113..953bc547c3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Tiles/FurnitureNavystone/NavystonePlatform.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicPlatform : ModTile + public class NavystonePlatform : ModTile { - public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystonePlatform.png b/Tiles/FurnitureNavystone/NavystonePlatform.png new file mode 100644 index 0000000000..3f97fc569b Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystonePlatform.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicSink.cs b/Tiles/FurnitureNavystone/NavystoneSink.cs similarity index 76% rename from Tiles/FurnitureEutrophic/EutrophicSink.cs rename to Tiles/FurnitureNavystone/NavystoneSink.cs index d95b05aef6..c276114d43 100644 --- a/Tiles/FurnitureEutrophic/EutrophicSink.cs +++ b/Tiles/FurnitureNavystone/NavystoneSink.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicSink : ModTile + public class NavystoneSink : ModTile { - public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneSink.png b/Tiles/FurnitureNavystone/NavystoneSink.png new file mode 100644 index 0000000000..1410a1a3db Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneSink.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicTable.cs b/Tiles/FurnitureNavystone/NavystoneTable.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicTable.cs rename to Tiles/FurnitureNavystone/NavystoneTable.cs index e55e216aa7..e9997d1652 100644 --- a/Tiles/FurnitureEutrophic/EutrophicTable.cs +++ b/Tiles/FurnitureNavystone/NavystoneTable.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicTable : ModTile + public class NavystoneTable : ModTile { - public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneTable.png b/Tiles/FurnitureNavystone/NavystoneTable.png new file mode 100644 index 0000000000..fbcdd63309 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneTable.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneToilet.cs b/Tiles/FurnitureNavystone/NavystoneToilet.cs new file mode 100644 index 0000000000..1205e40ff3 --- /dev/null +++ b/Tiles/FurnitureNavystone/NavystoneToilet.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureNavystone +{ + public class NavystoneToilet : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + // Toilets count as Chairs + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Toilet")); + TileID.Sets.CanBeSatOnForNPCs[Type] = true; + TileID.Sets.CanBeSatOnForPlayers[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + AdjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Granite, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, shitter: true); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + + public override void HitWire(int i, int j) // I hate this please make it stop. - Merkalto + { + Tile tile = Main.tile[i, j]; + + int spawnX = i; + int spawnY = j - tile.TileFrameY / 18; + + Wiring.SkipWire(spawnX, spawnY); + Wiring.SkipWire(spawnX, spawnY + 1); + + if (Wiring.CheckMech(spawnX, spawnY, 60)) + { + Projectile.NewProjectile(Wiring.GetProjectileSource(spawnX, spawnY), spawnX * 16 + 8, spawnY * 16 + 12, 0f, 0f, ProjectileID.ToiletEffect, 0, 0f, Main.myPlayer); + } + } + } +} diff --git a/Tiles/FurnitureNavystone/NavystoneToilet.png b/Tiles/FurnitureNavystone/NavystoneToilet.png new file mode 100644 index 0000000000..470aaf68a0 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneToilet.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png b/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png new file mode 100644 index 0000000000..5d2772081a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicBench.cs b/Tiles/FurnitureNavystone/NavystoneTriclinium.cs similarity index 84% rename from Tiles/FurnitureEutrophic/EutrophicBench.cs rename to Tiles/FurnitureNavystone/NavystoneTriclinium.cs index 876e7ec38c..41251b0b2d 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBench.cs +++ b/Tiles/FurnitureNavystone/NavystoneTriclinium.cs @@ -6,11 +6,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBench : ModTile + public class NavystoneTriclinium : ModTile { - public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), false, true); + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), false, true); public override bool CreateDust(int i, int j, ref int type) { @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); - public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) { diff --git a/Tiles/FurnitureNavystone/NavystoneTriclinium.png b/Tiles/FurnitureNavystone/NavystoneTriclinium.png new file mode 100644 index 0000000000..68cdff63d5 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneTriclinium.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png b/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png new file mode 100644 index 0000000000..8376806503 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs b/Tiles/FurnitureNavystone/NavystoneWorkBench.cs similarity index 74% rename from Tiles/FurnitureEutrophic/EutrophicWorkBench.cs rename to Tiles/FurnitureNavystone/NavystoneWorkBench.cs index 07679537ef..162a074600 100644 --- a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Tiles/FurnitureNavystone/NavystoneWorkBench.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicWorkBench : ModTile + public class NavystoneWorkBench : ModTile { - public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneWorkBench.png b/Tiles/FurnitureNavystone/NavystoneWorkBench.png new file mode 100644 index 0000000000..5cf0c4842b Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneWorkBench.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/FurnitureEutrophic/SmoothNavystone.cs b/Tiles/FurnitureNavystone/SmoothNavystone.cs similarity index 96% rename from Tiles/FurnitureEutrophic/SmoothNavystone.cs rename to Tiles/FurnitureNavystone/SmoothNavystone.cs index ce85324b05..ff73a7d14c 100644 --- a/Tiles/FurnitureEutrophic/SmoothNavystone.cs +++ b/Tiles/FurnitureNavystone/SmoothNavystone.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { public class SmoothNavystone : ModTile { diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.png b/Tiles/FurnitureNavystone/SmoothNavystone.png similarity index 100% rename from Tiles/FurnitureEutrophic/SmoothNavystone.png rename to Tiles/FurnitureNavystone/SmoothNavystone.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/Furniture/CraftingStations/SilvaBasin.cs b/Tiles/FurnitureSilva/SilvaBasin.cs similarity index 93% rename from Tiles/Furniture/CraftingStations/SilvaBasin.cs rename to Tiles/FurnitureSilva/SilvaBasin.cs index a056b5aed6..73964ffa6a 100644 --- a/Tiles/Furniture/CraftingStations/SilvaBasin.cs +++ b/Tiles/FurnitureSilva/SilvaBasin.cs @@ -7,7 +7,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureSilva { public class SilvaBasin : ModTile { @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.StyleLineSkip = 2; TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } diff --git a/Tiles/Furniture/CraftingStations/SilvaBasin.png b/Tiles/FurnitureSilva/SilvaBasin.png similarity index 100% rename from Tiles/Furniture/CraftingStations/SilvaBasin.png rename to Tiles/FurnitureSilva/SilvaBasin.png diff --git a/Tiles/Furniture/CraftingStations/SilvaBasin_Highlight.png b/Tiles/FurnitureSilva/SilvaBasin_Highlight.png similarity index 100% rename from Tiles/Furniture/CraftingStations/SilvaBasin_Highlight.png rename to Tiles/FurnitureSilva/SilvaBasin_Highlight.png diff --git a/Tiles/Furniture/CraftingStations/StaticRefiner.cs b/Tiles/FurnitureStatigel/StaticRefiner.cs similarity index 91% rename from Tiles/Furniture/CraftingStations/StaticRefiner.cs rename to Tiles/FurnitureStatigel/StaticRefiner.cs index 092060fb68..083159c5ed 100644 --- a/Tiles/Furniture/CraftingStations/StaticRefiner.cs +++ b/Tiles/FurnitureStatigel/StaticRefiner.cs @@ -6,7 +6,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureStatigel { public class StaticRefiner : ModTile { @@ -18,7 +18,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; //also counts as a Solidifier AdjTiles = new int[] { TileID.Solidifier }; diff --git a/Tiles/Furniture/CraftingStations/StaticRefiner.png b/Tiles/FurnitureStatigel/StaticRefiner.png similarity index 100% rename from Tiles/Furniture/CraftingStations/StaticRefiner.png rename to Tiles/FurnitureStatigel/StaticRefiner.png diff --git a/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs b/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs index 8d0a4d96ff..406f8a0d69 100644 --- a/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs +++ b/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs @@ -98,22 +98,12 @@ namespace CalamityMod.Tiles.FurnitureWulfrum if (Main.tile[i, j].IsTileActuallyInvisible()) return; - 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)); - - float transparency = 0.05f + wave1angle; - Texture2D tex = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb_Glow").Value; Tile tile = Main.tile[i, j]; Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); - TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White * transparency, false), default); + TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White, false), default); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs new file mode 100644 index 0000000000..34ed84e662 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBathtub : ModTile + { + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png new file mode 100644 index 0000000000..552c86a3e5 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs new file mode 100644 index 0000000000..fd1e3426de --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBookcase : ModTile + { + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png new file mode 100644 index 0000000000..93e13605b4 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs new file mode 100644 index 0000000000..7ca49b489d --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs @@ -0,0 +1,37 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChair : ModTile + { + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png new file mode 100644 index 0000000000..6ee3ada599 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair_Highlight.png new file mode 100644 index 0000000000..b59a4f5245 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs new file mode 100644 index 0000000000..025b515bc4 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs @@ -0,0 +1,67 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent.Drawing; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChandelier : ModTile + { + + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 2) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png new file mode 100644 index 0000000000..bc974929bc Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow.png new file mode 100644 index 0000000000..6b8c2c9cf1 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs new file mode 100644 index 0000000000..6b0de18f35 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs @@ -0,0 +1,50 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChest : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChest(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png new file mode 100644 index 0000000000..b34000a603 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow.png new file mode 100644 index 0000000000..a415184891 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Highlight.png new file mode 100644 index 0000000000..c0d1530a5b Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png new file mode 100644 index 0000000000..d2fd41cb59 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Glow.png new file mode 100644 index 0000000000..8c0bf62db6 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Highlight.png new file mode 100644 index 0000000000..3d82b19c24 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs new file mode 100644 index 0000000000..f7d2e1aca5 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs @@ -0,0 +1,76 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDeskLight : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, 1, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 5) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png new file mode 100644 index 0000000000..3acbbd1bee Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow.png new file mode 100644 index 0000000000..9089acfd02 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.cs new file mode 100644 index 0000000000..cd6f07a065 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDoorClosed : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorClosed(ModContent.ItemType(), true); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.png new file mode 100644 index 0000000000..90a41c9aca Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed_Highlight.png new file mode 100644 index 0000000000..e0758984f1 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.cs new file mode 100644 index 0000000000..5df9264a7a --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDoorOpen : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorOpen(ModContent.ItemType(), true); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.png new file mode 100644 index 0000000000..98e854a8cc Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen_Highlight.png new file mode 100644 index 0000000000..ca767aed7b Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs new file mode 100644 index 0000000000..6d78abbe7c --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs @@ -0,0 +1,51 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDresser : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png new file mode 100644 index 0000000000..d37893dd8d Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow.png new file mode 100644 index 0000000000..26cee14f42 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Highlight.png new file mode 100644 index 0000000000..6e31954740 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs new file mode 100644 index 0000000000..d181d7d589 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs @@ -0,0 +1,55 @@ +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumJukebox : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); //This Jukebox has bookcase dimensions + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetText("Tiles.Jukebox")); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png new file mode 100644 index 0000000000..02f87edf42 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow.png new file mode 100644 index 0000000000..3b011f3b84 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs new file mode 100644 index 0000000000..9818d57552 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs @@ -0,0 +1,62 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLamp : ModTile + { + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png new file mode 100644 index 0000000000..0d0d621ae0 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow.png new file mode 100644 index 0000000000..b1d96c1638 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs new file mode 100644 index 0000000000..ef14085edf --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs @@ -0,0 +1,66 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent.Drawing; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLantern : ModTile + { + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 4) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png new file mode 100644 index 0000000000..99ca6f27d1 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow.png new file mode 100644 index 0000000000..cb80de710c Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs new file mode 100644 index 0000000000..ae6d74a64a --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSink : ModTile + { + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png new file mode 100644 index 0000000000..ea91bbf73b Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs new file mode 100644 index 0000000000..ea86bba509 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSleepingPod : ModTile + { + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png new file mode 100644 index 0000000000..76a7a63f3e Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive.png new file mode 100644 index 0000000000..2f42aefcdd Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive_Glow.png new file mode 100644 index 0000000000..285c7fb955 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow.png new file mode 100644 index 0000000000..22a6ed63e9 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Highlight.png new file mode 100644 index 0000000000..514de2d0d8 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs new file mode 100644 index 0000000000..b63d062ebf --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSofa : ModTile + { + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png new file mode 100644 index 0000000000..136844ea32 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow.png new file mode 100644 index 0000000000..ea27a6db33 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Highlight.png new file mode 100644 index 0000000000..ee7b74d4f0 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs new file mode 100644 index 0000000000..f1cb1bd42e --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs @@ -0,0 +1,41 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumTable : ModTile + { + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png new file mode 100644 index 0000000000..6cd3908340 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow.png new file mode 100644 index 0000000000..39b2d14fc7 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs new file mode 100644 index 0000000000..3dd8ae69af --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumToilet : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + // Toilets count as Chairs + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Toilet")); + TileID.Sets.CanBeSatOnForNPCs[Type] = true; + TileID.Sets.CanBeSatOnForPlayers[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + AdjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, shitter: true); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + + public override void HitWire(int i, int j) // I hate this please make it stop. - Merkalto + { + Tile tile = Main.tile[i, j]; + + int spawnX = i; + int spawnY = j - tile.TileFrameY / 18; + + Wiring.SkipWire(spawnX, spawnY); + Wiring.SkipWire(spawnX, spawnY + 1); + + if (Wiring.CheckMech(spawnX, spawnY, 60)) + { + Projectile.NewProjectile(Wiring.GetProjectileSource(spawnX, spawnY), spawnX * 16 + 8, spawnY * 16 + 12, 0f, 0f, ProjectileID.ToiletEffect, 0, 0f, Main.myPlayer); + } + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png new file mode 100644 index 0000000000..890177b446 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet_Highlight.png new file mode 100644 index 0000000000..5c2fc8b88a Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs new file mode 100644 index 0000000000..8281656683 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumWorkBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png new file mode 100644 index 0000000000..94cbc92609 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png differ diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs similarity index 89% rename from Tiles/Furniture/CraftingStations/WulfrumLabstation.cs rename to Tiles/FurnitureWulfrum/WulfrumLabstation.cs index 8b1cfe6971..fdaaccad09 100644 --- a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs @@ -8,7 +8,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureWulfrum { public class WulfrumLabstation : ModTile { @@ -17,7 +17,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations Main.tileFrameImportant[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.addTile(Type); - AddMapEntry(new Color(100, 153, 100), CalamityUtils.GetItemName()); + AddMapEntry(new Color(100, 153, 100), CalamityUtils.GetItemName()); } public override bool CreateDust(int i, int j, ref int type) @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/WulfrumLabstationGlow").Value; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumLabstationGlow").Value; Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstation.png b/Tiles/FurnitureWulfrum/WulfrumLabstation.png similarity index 100% rename from Tiles/Furniture/CraftingStations/WulfrumLabstation.png rename to Tiles/FurnitureWulfrum/WulfrumLabstation.png diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstationGlow.png b/Tiles/FurnitureWulfrum/WulfrumLabstationGlow.png similarity index 100% rename from Tiles/Furniture/CraftingStations/WulfrumLabstationGlow.png rename to Tiles/FurnitureWulfrum/WulfrumLabstationGlow.png diff --git a/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs b/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs index b13c236cc4..384d860146 100644 --- a/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs +++ b/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs @@ -98,22 +98,12 @@ namespace CalamityMod.Tiles.FurnitureWulfrum if (Main.tile[i, j].IsTileActuallyInvisible()) return; - 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)); - - float transparency = 0.05f + wave1angle; - Texture2D tex = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb_Glow").Value; Tile tile = Main.tile[i, j]; Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); - TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White * transparency, false), default); + TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White, false), default); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { 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/Ambient/TableCoral.png b/Tiles/SunkenSea/Ambient/TableCoral.png index 45ea42abfd..9d89cd26ed 100644 Binary files a/Tiles/SunkenSea/Ambient/TableCoral.png and b/Tiles/SunkenSea/Ambient/TableCoral.png differ diff --git a/Tiles/SunkenSea/Ambient/TableCoral2.png b/Tiles/SunkenSea/Ambient/TableCoral2.png index 90c37eaa63..150bdffd38 100644 Binary files a/Tiles/SunkenSea/Ambient/TableCoral2.png and b/Tiles/SunkenSea/Ambient/TableCoral2.png differ diff --git a/Tiles/SunkenSea/Ambient/TableCoral3.png b/Tiles/SunkenSea/Ambient/TableCoral3.png index 4b9b83df62..8dab87e6c8 100644 Binary files a/Tiles/SunkenSea/Ambient/TableCoral3.png and b/Tiles/SunkenSea/Ambient/TableCoral3.png differ 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/EutrophicGlass.cs b/Tiles/SunkenSea/EutrophicGlass.cs index 77f47816d1..ebde80d594 100644 --- a/Tiles/SunkenSea/EutrophicGlass.cs +++ b/Tiles/SunkenSea/EutrophicGlass.cs @@ -1,4 +1,6 @@ -using CalamityMod.Systems; +using System; +using CalamityMod.Systems; +using Microsoft.CodeAnalysis.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -40,12 +42,22 @@ namespace CalamityMod.Tiles.SunkenSea num = fail ? 1 : 3; } + 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) { if (Main.tile[i, j].IsTileActuallyInvisible()) return; - float transparency = 0.6f; + float transparency = 0.4f; // Must be set here TileID.Sets.DrawsWalls[Type] = true; @@ -62,6 +74,41 @@ namespace CalamityMod.Tiles.SunkenSea Color color = Lighting.GetColor(i, j) * transparency; TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, color, false), default); + + //IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's + + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + Texture2D GlintTex = ModContent.Request(Texture + "_Glint").Value; + + Vector2 glintDir = new Vector2(1f, 1f); + glintDir.Normalize(); + + Vector2 screenPos = position; + + float projection = Vector2.Dot(screenPos, glintDir); + + // this sets the length between the glints diagonally + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + float[] beamCenters = new float[] + { + screenDiagonalLength * 0.53f, // upper glint + screenDiagonalLength * 0.63f, // middle glint + screenDiagonalLength * 0.73f // lower glint + }; + + float stripeWidth = 100f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + + if (strength > 0f) + { + spriteBatch.Draw(GlintTex, position, frame, (Lighting.GetColor(i, j) * 2 ) * (strength * 0.4f), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) diff --git a/Tiles/SunkenSea/EutrophicGlass_Glint.png b/Tiles/SunkenSea/EutrophicGlass_Glint.png new file mode 100644 index 0000000000..3b890a78f2 Binary files /dev/null and b/Tiles/SunkenSea/EutrophicGlass_Glint.png differ diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index 586129ae10..a21b66491d 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -21,12 +21,13 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Sand"]); CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); // Tile blends with sandstone, which it is set to merge with here - Main.tileShine[Type] = 1800; + Main.tileShine[Type] = 2500; TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; @@ -139,7 +140,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return TileFramingSystem.BrimstoneFraming(i, j, resetFrame); + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } } } diff --git a/Tiles/SunkenSea/EutrophicSand.png b/Tiles/SunkenSea/EutrophicSand.png index 7561c14ec6..0e4be4e4ad 100644 Binary files a/Tiles/SunkenSea/EutrophicSand.png and b/Tiles/SunkenSea/EutrophicSand.png differ diff --git a/Tiles/SunkenSea/HardenedEutrophicSand.cs b/Tiles/SunkenSea/HardenedEutrophicSand.cs index c85a907006..27c252ec75 100644 --- a/Tiles/SunkenSea/HardenedEutrophicSand.cs +++ b/Tiles/SunkenSea/HardenedEutrophicSand.cs @@ -17,11 +17,12 @@ namespace CalamityMod.Tiles.SunkenSea { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); - Main.tileShine[Type] = 1800; + Main.tileShine[Type] = 2500; Main.tileShine2[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; @@ -44,7 +45,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return TileFramingSystem.BrimstoneFraming(i, j, resetFrame); + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } public override void RandomUpdate(int i, int j) diff --git a/Tiles/SunkenSea/HardenedEutrophicSand.png b/Tiles/SunkenSea/HardenedEutrophicSand.png index 5f80ec3a45..f0dfb21ae8 100644 Binary files a/Tiles/SunkenSea/HardenedEutrophicSand.png and b/Tiles/SunkenSea/HardenedEutrophicSand.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..97f84eec2c 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 { @@ -22,7 +24,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = true; Main.tileSpelunker[Type] = true; - Main.tileShine[Type] = 3500; + Main.tileShine[Type] = 5600; Main.tileShine2[Type] = true; HitSound = SoundID.Item27; @@ -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..ceef890ebe 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..ceef890ebe Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Glint.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Glint.png new file mode 100644 index 0000000000..4667f80b89 Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Glint.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png new file mode 100644 index 0000000000..e10cc3ce4f 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..b0d2462bd5 Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png differ diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index f599048eec..112f32cfe5 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); @@ -37,7 +38,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return TileFramingSystem.BrimstoneFraming(i, j, resetFrame); + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } public override void RandomUpdate(int i, int j) diff --git a/Tiles/SunkenSea/Navystone.png b/Tiles/SunkenSea/Navystone.png index d81a8b93bb..a0cc7f0beb 100644 Binary files a/Tiles/SunkenSea/Navystone.png and b/Tiles/SunkenSea/Navystone.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..22310dc258 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -1,7 +1,9 @@ using System; using CalamityMod.Systems; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,18 +12,20 @@ namespace CalamityMod.Tiles.SunkenSea public class SeaPrism : ModTile { private const short subsheetWidth = 468; - private const short subsheetHeight = 90; - + private const short subsheetHeight = 90; + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = false; TileID.Sets.HasSlopeFrames[Type] = true; + Main.tileMerge[Type][ModContent.TileType()] = 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 +52,95 @@ 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)); + + //IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's + + Texture2D GlintTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_GlintMask").Value; + + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = position; + + float projection = Vector2.Dot(screenPos, glintDir); + + // this sets the length between the glints diagonally + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + float[] beamCenters = new float[] + { + screenDiagonalLength * 0.05f, // upper glint + screenDiagonalLength * 0.5f, // middle glint + screenDiagonalLength * 1.05f // lower glint + }; + + float stripeWidth = 100f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + + if (strength > 0f) + { + spriteBatch.Draw(GlintTex, position, sourceRect, Color.White * strength, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } +} + 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/SeaPrismCrystals.cs b/Tiles/SunkenSea/SeaPrismCrystals.cs index dd064e88e7..8c008a9ff8 100644 --- a/Tiles/SunkenSea/SeaPrismCrystals.cs +++ b/Tiles/SunkenSea/SeaPrismCrystals.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -31,52 +32,51 @@ 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; - int xframe = tile.TileFrameX / 18; - if (xframe > 7 && xframe < 14) - { - //Purple - Color darkviolet = new Color(75, 54, 103); - Color violet = new Color(231, 205, 245); - Color value = Color.Lerp(darkviolet, violet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.037f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(darkviolet, violet, (MathF.Sin((j - 120) / 50f + Main.GameUpdateCount * 0.014f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.36f : 0.48f; - g = lessLightDueToLowWater ? 0.315f : 0.42f; - b = lessLightDueToLowWater ? 0.405f : 0.54f; - r *= (value.R + value1.R) / 300f; - g *= (value.G + value1.G) / 300f; - b *= (value.B + value1.B) / 300f; - - } - else if (xframe >= 14) - { - //Green - Color murkeygreen = new Color(28, 68, 54); - Color lightgreen = new Color(166, 234, 198); - Color value2 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.027f + i / 40f) + 1f) / 2f); - Color value3 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin((j - 80) / 50f + Main.GameUpdateCount * 0.034f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.225f : 0.3f; - g = lessLightDueToLowWater ? 0.405f : 0.54f; - b = lessLightDueToLowWater ? 0.315f : 0.42f; - r *= (value2.R + value3.R) / 300f; - g *= (value2.G + value3.G) / 300f; - b *= (value2.B + value3.B) / 300f; - } - else - { - //Blue - Color blue = new Color(67, 187, 204); - 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; - } + 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; + } + + 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/SeaPrismCrystals").Value; + spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f); + + Texture2D tex1 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_Purple").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_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 bool CanPlace(int i, int j) diff --git a/Tiles/SunkenSea/SeaPrismCrystals.png b/Tiles/SunkenSea/SeaPrismCrystals.png index c4646c40c6..574fd43f13 100644 Binary files a/Tiles/SunkenSea/SeaPrismCrystals.png and b/Tiles/SunkenSea/SeaPrismCrystals.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals_Green.png b/Tiles/SunkenSea/SeaPrismCrystals_Green.png new file mode 100644 index 0000000000..d167aa4b1e Binary files /dev/null and b/Tiles/SunkenSea/SeaPrismCrystals_Green.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals_Purple.png b/Tiles/SunkenSea/SeaPrismCrystals_Purple.png new file mode 100644 index 0000000000..52616c685f Binary files /dev/null and b/Tiles/SunkenSea/SeaPrismCrystals_Purple.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_GlintMask.png b/Tiles/SunkenSea/SeaPrism_GlintMask.png new file mode 100644 index 0000000000..b80a7aaa41 Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_GlintMask.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/Tiles/SunkenSea/YellowCoral.png b/Tiles/SunkenSea/YellowCoral.png index ef005dc85b..7c2ad9d150 100644 Binary files a/Tiles/SunkenSea/YellowCoral.png and b/Tiles/SunkenSea/YellowCoral.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/DraedonSummoning/CodebreakerUI.cs b/UI/DraedonSummoning/CodebreakerUI.cs index b50d05d200..5b20fbed4c 100644 --- a/UI/DraedonSummoning/CodebreakerUI.cs +++ b/UI/DraedonSummoning/CodebreakerUI.cs @@ -2,6 +2,7 @@ using System.Text; using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.NPCs.ExoMechs; using CalamityMod.Packets; using CalamityMod.Systems.Collections; @@ -168,13 +169,13 @@ namespace CalamityMod.UI.DraedonSummoning // Draw the cell payment slot icon. Texture2D emptyCellIconTexture = ModContent.Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Empty").Value; Texture2D occupiedCellIconTexture = ModContent.Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Filled").Value; - Texture2D bloodSampleIconTexture = ModContent.Request("CalamityMod/Items/Materials/BloodSample").Value; + Texture2D bloodyVeinIconTexture = ModContent.Request("CalamityMod/Items/Pets/BloodyVein").Value; Texture2D cellTexture = emptyCellIconTexture; if (codebreakerTileEntity.InputtedCellCount > 0) { - if (codebreakerTileEntity.ContainsBloodSample) + if (codebreakerTileEntity.ContainsBloodyVein) { - cellTexture = bloodSampleIconTexture; + cellTexture = bloodyVeinIconTexture; } else { @@ -194,7 +195,7 @@ namespace CalamityMod.UI.DraedonSummoning DisplayNotStrongEnoughErrorText(schematicSlotDrawCenter + new Vector2(-24f, 56f)); // Handle decryption costs. - else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0 && !codebreakerTileEntity.ContainsBloodSample) + else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0 && !codebreakerTileEntity.ContainsBloodyVein) { int cost = codebreakerTileEntity.DecryptionCellCost; DisplayCostText(costDisplayLocation, cost); @@ -247,8 +248,8 @@ namespace CalamityMod.UI.DraedonSummoning // Create a temporary item for drawing purposes. // If cells are present, make the item reflect that. Item temporaryPowerCell = new Item(); - if (codebreakerTileEntity.ContainsBloodSample) - temporaryPowerCell.SetDefaults(ModContent.ItemType()); + if (codebreakerTileEntity.ContainsBloodyVein) + temporaryPowerCell.SetDefaults(ModContent.ItemType()); else temporaryPowerCell.SetDefaults(ModContent.ItemType()); @@ -313,7 +314,7 @@ namespace CalamityMod.UI.DraedonSummoning if (Main.mouseLeft && Main.mouseLeftRelease && codebreakerTileEntity.DecryptionCountdown <= 0) { int powercellID = ModContent.ItemType(); - int sampleID = ModContent.ItemType(); + int sampleID = ModContent.ItemType(); short cellStackDiff = 0; bool shouldPlaySound = true; @@ -323,7 +324,7 @@ namespace CalamityMod.UI.DraedonSummoning cellStackDiff = (short)-Math.Min(temporaryItem.stack, temporaryItem.maxStack); Player p = Main.LocalPlayer; var source = p.GetSource_TileInteraction(codebreakerTileEntity.Position.X, codebreakerTileEntity.Position.Y); - p.QuickSpawnItem(source, codebreakerTileEntity.ContainsBloodSample ? sampleID : powercellID, -cellStackDiff); + p.QuickSpawnItem(source, codebreakerTileEntity.ContainsBloodyVein ? sampleID : powercellID, -cellStackDiff); // Do not play a sound in this situation. The player is going to pick up the dropped cells in a few frames, which will make sound. shouldPlaySound = false; @@ -333,7 +334,7 @@ namespace CalamityMod.UI.DraedonSummoning else { bool holdingPowercell = playerHandItem.type == powercellID || (playerHandItem.type == sampleID && Main.zenithWorld); - bool powercellsinserted = !codebreakerTileEntity.ContainsBloodSample && temporaryItem.stack > 0; + bool powercellsinserted = !codebreakerTileEntity.ContainsBloodyVein && temporaryItem.stack > 0; bool cansummon = codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon; // If the player's held power cells can be stacked on top of what's already in the codeberaker, then stack them. @@ -347,7 +348,7 @@ namespace CalamityMod.UI.DraedonSummoning { SoundEngine.PlaySound(BloodSound, codebreakerTileEntity.Center); } - codebreakerTileEntity.ContainsBloodSample = true; + codebreakerTileEntity.ContainsBloodyVein = true; int spaceLeft = TECodebreaker.MaxCellCapacity - temporaryItem.stack; @@ -362,7 +363,7 @@ namespace CalamityMod.UI.DraedonSummoning // If theres nothing inside or there are cells inside, cells can be inserted if (playerHandItem.type == powercellID && (temporaryItem.stack == 0 || powercellsinserted)) { - codebreakerTileEntity.ContainsBloodSample = false; + codebreakerTileEntity.ContainsBloodyVein = false; int spaceLeft = TECodebreaker.MaxCellCapacity - temporaryItem.stack; @@ -387,7 +388,7 @@ namespace CalamityMod.UI.DraedonSummoning playerHandItem.stack = -cellStackDiff; temporaryItem.TurnToAir(); AwaitingDecryptionTextClose = false; - codebreakerTileEntity.ContainsBloodSample = false; + codebreakerTileEntity.ContainsBloodyVein = false; } } @@ -637,7 +638,7 @@ namespace CalamityMod.UI.DraedonSummoning Rectangle clickArea = Utils.CenteredRectangle(drawPosition, contactButton.Size() * VerificationButtonScale); - float iconrotation = codebreakerTileEntity.ContainsBloodSample ? Main.GlobalTimeWrappedHourly * 20f : 0f; + float iconrotation = codebreakerTileEntity.ContainsBloodyVein ? Main.GlobalTimeWrappedHourly * 20f : 0f; // Check if the mouse is hovering over the contact button area. if (MouseScreenArea.Intersects(clickArea)) @@ -652,7 +653,7 @@ namespace CalamityMod.UI.DraedonSummoning { CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); - if (Main.zenithWorld && codebreakerTileEntity.ContainsBloodSample) + if (Main.zenithWorld && codebreakerTileEntity.ContainsBloodyVein) { CalamityWorld.DraedonMechdusa = true; } @@ -677,7 +678,7 @@ namespace CalamityMod.UI.DraedonSummoning string contactTextKey = "Contact"; if (DownedBossSystem.downedExoMechs) contactTextKey = "Summon"; - if (codebreakerTileEntity.ContainsBloodSample) + if (codebreakerTileEntity.ContainsBloodyVein) contactTextKey = "Evoke"; string contactText = CalamityUtils.GetTextValue("UI." + contactTextKey); 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/DraedonsArsenal/PowerCellSlot_Blood.png b/UI/DraedonsArsenal/PowerCellSlot_Blood.png index 21ab14e734..709119d21e 100644 Binary files a/UI/DraedonsArsenal/PowerCellSlot_Blood.png and b/UI/DraedonsArsenal/PowerCellSlot_Blood.png differ 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 b547322c9e..f56da1d192 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -203,14 +203,14 @@ namespace CalamityMod.UI.ModeIndicator if (MouseScreenArea.Intersects(MainClickArea)) { //Display the first non-none difficulty by default - string modeToDisplay = Difficulties[1].Name.ToString(); - bool anyActiveMode = false; + string modeToDisplay = Main.getGoodWorld ? Difficulties[0].FTWName.ToString() : Difficulties[1].Name.ToString(); + bool anyActiveMode = Main.getGoodWorld ? true : false; for (int i = 1; i < Difficulties.Count; i++) { if (GetCurrentDifficulty == Difficulties[i]) { - modeToDisplay = Difficulties[i].Name.ToString(); + modeToDisplay = Main.getGoodWorld ? Difficulties[i].FTWName.ToString() : Difficulties[i].Name.ToString(); anyActiveMode = true; } } @@ -367,9 +367,9 @@ namespace CalamityMod.UI.ModeIndicator #region Difficulty toggling public static string GetDifficultyText(DifficultyMode mode) { - LocalizedText preface = mode.Name; + LocalizedText preface = Main.getGoodWorld ? mode.FTWName : mode.Name; if (mode == GetCurrentDifficulty) - preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(mode.Name.ToString()); + preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(Main.getGoodWorld ? mode.FTWName.ToString() : mode.Name.ToString()); string text = "\n" + mode.ShortDescription.ToString(); @@ -395,11 +395,14 @@ namespace CalamityMod.UI.ModeIndicator return; // This has to be put before difficulties change as to not disrupt GetCurrentDifficulty - DisplayFormattedText("Mods.CalamityMod.UI.DifficultySwitch", Color.White, GetCurrentDifficulty.ChatTextColor.Hex3(), GetCurrentDifficulty.Name, mode.ChatTextColor.Hex3(), mode.Name); + DisplayFormattedText("Mods.CalamityMod.UI.DifficultySwitch", Color.White, Main.getGoodWorld ? GetCurrentDifficulty.FTWTextColor.Hex3() : GetCurrentDifficulty.ChatTextColor.Hex3(), Main.getGoodWorld ? GetCurrentDifficulty.FTWName : GetCurrentDifficulty.Name + , Main.getGoodWorld ? mode.FTWTextColor.Hex3() :mode.ChatTextColor.Hex3(), Main.getGoodWorld ? mode.FTWName :mode.Name); // 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++) { @@ -439,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 c28487a7fd..cd56f436e1 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -41,65 +41,6 @@ namespace CalamityMod internal static readonly Color DonatorItemColor = new Color(255, 121, 156); #endregion - // TODO -- This probably isn't the best place to put this but it needs to be somewhere easily accessible. - #region Accessory Prefix Stats - internal static int GetScalingDefense(int prefixID) - { - switch (prefixID) - { - default: - return 0; - - // Ironskin Potion - // This makes sense to be here but also not - case -1: - if (DownedBossSystem.downedDoG) - return 14; - else if (NPC.downedMoonlord) - return 12; - else if (Main.hardMode) - return 10; - return 8; - - case PrefixID.Hard: - if (DownedBossSystem.downedDoG) - return 4; - else if (NPC.downedMoonlord) - return 3; - else if (Main.hardMode) - return 2; - return 1; - - case PrefixID.Guarding: - if (DownedBossSystem.downedDoG) - return 5; - else if (NPC.downedMoonlord) - return 4; - else if (Main.hardMode) - return 3; - return 2; - - case PrefixID.Armored: - if (DownedBossSystem.downedDoG) - return 6; - else if (NPC.downedMoonlord) - return 5; - else if (Main.hardMode) - return 4; - return 3; - - case PrefixID.Warding: - if (DownedBossSystem.downedDoG) - return 7; - else if (NPC.downedMoonlord) - return 6; - else if (Main.hardMode) - return 5; - return 4; - } - } - #endregion - #region Reforging Algorithm internal static int GetReworkedReforge(Item item, UnifiedRandom rand, int currentPrefix) { @@ -120,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 07d6a8c75f..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"); @@ -89,6 +93,9 @@ namespace CalamityMod public static string ToRegenPerSecond(this int regen) => Round(regen * 0.5f, "N2"); 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); @@ -96,5 +103,25 @@ namespace CalamityMod 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 3940899517..024cb4b895 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -438,8 +438,6 @@ namespace CalamityMod int extraIFrames = 0; if (modPlayer.godSlayerThrowing && hurtInfo.Damage > 80) extraIFrames += 30; - if (modPlayer.statigelSet && hurtInfo.Damage > 100) - extraIFrames += 30; // Deific Amulet provides 10 to 40 bonus immunity frames when you get hit which scale with your missing health. // If you only take 1 damage, you get 5 iframes. @@ -1025,10 +1023,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 e8b9ab486f..20c28a596a 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,10 +184,12 @@ 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 || projectile.localNPCImmunity[n.whoAmI] == -1 || n.immune[projectile.owner] > 0))) continue; float currentNPCDist = Vector2.Distance(n.Center, projectile.Center); + if (respectIFrames && Projectile.perIDStaticNPCImmunity[projectile.type][n.whoAmI] > Main.GameUpdateCount) + currentNPCDist += 1600; //Prioritize things that don't currently have iframes, but still home in on stuff that has static iframes if needed. if ((currentNPCDist < npcDistCompare) && (ignoreTiles || Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1))) { npcDistCompare = currentNPCDist; @@ -340,9 +342,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); @@ -845,7 +846,6 @@ namespace CalamityMod private static readonly List vanillaBlastImmuneTiles = new List() { - TileID.DemonAltar, TileID.Cobalt, TileID.Mythril, TileID.Adamantite, @@ -854,8 +854,7 @@ namespace CalamityMod TileID.Titanium, TileID.Chlorophyte, TileID.LihzahrdBrick, - TileID.LihzahrdAltar, - TileID.DesertFossil + TileID.LihzahrdAltar }; public static void ExplodeTiles(this Projectile p, int explosionRadius, bool respectStandardBlastImmunity = true, IEnumerable customBlastImmuneTiles = null, IEnumerable customBlastImmuneWalls = null) @@ -918,6 +917,13 @@ namespace CalamityMod // Conditionally toss in Hellstone if it's not Hardmode yet. if (!Main.hardMode) blastImmuneTiles.Add(TileID.Hellstone); + + // Also spikes in FTW + if (Main.getGoodWorld) + { + blastImmuneTiles.Add(TileID.Spikes); + blastImmuneTiles.Add(TileID.WoodenSpikes); + } } // If specified, add custom blast immune tiles. diff --git a/Utilities/RicoshotUtils.cs b/Utilities/RicoshotUtils.cs index 1f54d392cb..a1edc37fb3 100644 --- a/Utilities/RicoshotUtils.cs +++ b/Utilities/RicoshotUtils.cs @@ -30,13 +30,14 @@ namespace CalamityMod public static int GetActiveRicoshotCoinCount(this Player player) { int count = 0; - int id = ModContent.ProjectileType(); + int coinID = ModContent.ProjectileType(); + int clipID = ModContent.ProjectileType(); foreach (Projectile p in Main.ActiveProjectiles) { if (p.owner != player.whoAmI) continue; - if (p.type == id) + if (p.type == coinID || p.type == clipID) ++count; } return count; @@ -45,10 +46,18 @@ namespace CalamityMod // Intentionally not an extension so it doesn't clog the Visual Studio recommendation lists. This is not generally useful. public static bool CanRicoshotCoinForceCrit(Projectile p) { - int id = ModContent.ProjectileType(); - if (!p.active || p.type != id) + int coinID = ModContent.ProjectileType(); + int clipID = ModContent.ProjectileType(); + + if (!p.active || (p.type != coinID && p.type != clipID)) return false; + if (p.type == clipID) + { + int clipUpdateCount = M1GarandEmptyClip.ClipLifetime - p.timeLeft; + return clipUpdateCount >= M1GarandEmptyClip.CritDelayTime; + } + int coinUpdateCount = RicoshotCoin.CoinLifetime - p.timeLeft; return coinUpdateCount >= RicoshotCoin.CritDelayTime; } @@ -96,21 +105,28 @@ namespace CalamityMod { IList coins = new List(); - // Search for all nearby coins. - // Coins do not necessarily have to be owned by the same player as the searching projectile! + // Search for all nearby coins/clips. + // Coins/clips do not necessarily have to be owned by the same player as the searching projectile! int coinID = ModContent.ProjectileType(); + int clipID = ModContent.ProjectileType(); + foreach (Projectile proj in Main.ActiveProjectiles) { - if (proj.ModProjectile is null || proj.type != coinID) + if (proj.ModProjectile is null) + continue; + + // Check if the projectile is either a coin or clip + if (proj.type != coinID && proj.type != clipID) continue; // Coins that have already been struck are ignored. if (proj.localAI[0] > 0f) continue; - // Finally, do a distance check + // Use the appropriate distance check based on the projectile type + float maxDistance = proj.type == clipID ? M1GarandEmptyClip.MaxIntraClipRicoshotDistance : RicoshotCoin.MaxIntraCoinRicoshotDistance; float dist = searchingShot.DistanceSQ(proj.Center); - if (dist <= RicoshotCoin.MaxIntraCoinRicoshotDistance * RicoshotCoin.MaxIntraCoinRicoshotDistance) + if (dist <= maxDistance * maxDistance) coins.Add(proj); } @@ -143,6 +159,11 @@ namespace CalamityMod float closestCoinDistance = RicoshotCoin.MaxIntraCoinRicoshotDistance; foreach (Projectile coin in availableCoins) { + // Determine the max ricochet distance based on the target type + float maxDistance = coin.type == ModContent.ProjectileType() ? M1GarandEmptyClip.MaxIntraClipRicoshotDistance : RicoshotCoin.MaxIntraCoinRicoshotDistance; // New line. Use different distance based on proj type. + if (coin.Distance(startPos) > maxDistance) + continue; + // Skip coins which are already frozen (part of an ongoing ricoshot), unless considering them if (!considerFrozenCoins && coin.ai[1] > 0f) continue; diff --git a/Utilities/TileEntityUtils.cs b/Utilities/TileEntityUtils.cs index 3e5fae0989..4d164a7f20 100644 --- a/Utilities/TileEntityUtils.cs +++ b/Utilities/TileEntityUtils.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -77,7 +77,7 @@ namespace CalamityMod // This check is done twice because the draw order matters. We want to draw the background icon before any text. if (item.stack > 0) { - if (item.type == ItemType()) + if (item.type == ItemType()) { slotBackgroundTex = Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Blood").Value; } diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 4877f181e9..f0ea7eb99e 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -1,17 +1,20 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone; 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; using CalamityMod.Tiles.FloralParadise; using CalamityMod.Tiles.FurnitureAbyss; using CalamityMod.Tiles.FurnitureAshen; -using CalamityMod.Tiles.FurnitureEutrophic; +using CalamityMod.Tiles.FurnitureNavystone; using CalamityMod.Tiles.FurnitureOtherworldly; using CalamityMod.Tiles.FurnitureProfaned; using CalamityMod.Tiles.FurnitureVoid; @@ -447,6 +450,8 @@ namespace CalamityMod TileType(), TileType(), TileType(), + TileType(), + TileType(), TileType(), TileType(), TileType(), @@ -517,6 +522,7 @@ namespace CalamityMod TileType(), // Sunken Sea TileType(), + TileType(), TileType(), TileType(), TileType(), diff --git a/Walls/AncientSmoothNavystoneWall.cs b/Walls/AncientSmoothNavystoneWall.cs new file mode 100644 index 0000000000..ec71f2f560 --- /dev/null +++ b/Walls/AncientSmoothNavystoneWall.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class AncientSmoothNavystoneWall : ModWall, IVisibleThroughWater + { + int IVisibleThroughWater.WaterMapEntry { get; set; } + + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = true; + + this.AddMapEntryWithWaterVisibility(new Color(27, 35, 36)); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/AncientSmoothNavystoneWall.png b/Walls/AncientSmoothNavystoneWall.png new file mode 100644 index 0000000000..585d059bc8 Binary files /dev/null and b/Walls/AncientSmoothNavystoneWall.png differ 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/SeaPrismWall.cs b/Walls/SeaPrismWall.cs new file mode 100644 index 0000000000..333b163bdf --- /dev/null +++ b/Walls/SeaPrismWall.cs @@ -0,0 +1,85 @@ +using System; +using CalamityMod.Tiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; + +namespace CalamityMod.Walls +{ + public class SeaPrismWall : MultiVariantModWall + { + internal static FramedMaskTexture GlowMaskBlue; + internal static FramedMaskTexture GlowMaskPurple; + internal static FramedMaskTexture GlowMaskGreen; + public override void SetStaticDefaults() + { + GlowMaskBlue = new("CalamityMod/Walls/SeaPrismWall_Blue", 36, 36); + GlowMaskPurple = new("CalamityMod/Walls/SeaPrismWall_Purple", 36, 36); + GlowMaskGreen = new("CalamityMod/Walls/SeaPrismWall_Green", 36, 36); + Main.wallHouse[Type] = true; + DustType = 108; + + AddMapEntry(new Color(27, 123, 131)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override void PopulateWallVariant(int i, int j, ref int frameXOffset, ref int frameYOffset) + { + frameXOffset = (i % 8) * 468; + frameYOffset = (j % 8) * 180; + } + private static float GetFade1(int i, int j) => + (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + + private static float GetFade2(int i, int j) => + (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + + public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + int xLength = 32; + + int frameXOffset = (i % 8) * 468; + int frameYOffset = (j % 8) * 180; + + int xPos = tile.WallFrameX + frameXOffset; + int yPos = tile.WallFrameY + frameYOffset; + + Rectangle frame = new Rectangle(xPos, yPos, xLength, 32); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero; + + // base wall + spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8, -8), frame, Lighting.GetColor(i, j)); + + // glow layers + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); + + if (GlowMaskBlue.HasContentInFramePos(xPos, yPos)) + { + spriteBatch.Draw(GlowMaskBlue.Texture, pos + new Vector2(-8, -8), frame, (Color.White * 1.1f)); + } + if (GlowMaskPurple.HasContentInFramePos(xPos, yPos)) + { + spriteBatch.Draw(GlowMaskPurple.Texture, pos + new Vector2(-8, -8), frame, Color.White * (fade1 * 1.1f)); + } + if (GlowMaskGreen.HasContentInFramePos(xPos, yPos)) + { + spriteBatch.Draw(GlowMaskGreen.Texture, pos + new Vector2(-8, -8), frame, Color.White * (fade2 * 1.5f)); + } + + Color wallColor = Lighting.GetColor(i, j) * 1.2f; // brighten a bit + wallColor.A = 255; + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + DrawWallGlow(Type, i, j, spriteBatch); + return false; + } + } +} diff --git a/Walls/SeaPrismWall.png b/Walls/SeaPrismWall.png new file mode 100644 index 0000000000..5e4988e6b2 Binary files /dev/null and b/Walls/SeaPrismWall.png differ diff --git a/Walls/SeaPrismWall_Blue.png b/Walls/SeaPrismWall_Blue.png new file mode 100644 index 0000000000..63996bc848 Binary files /dev/null and b/Walls/SeaPrismWall_Blue.png differ diff --git a/Walls/SeaPrismWall_Green.png b/Walls/SeaPrismWall_Green.png new file mode 100644 index 0000000000..228fcd2e0b Binary files /dev/null and b/Walls/SeaPrismWall_Green.png differ diff --git a/Walls/SeaPrismWall_Purple.png b/Walls/SeaPrismWall_Purple.png new file mode 100644 index 0000000000..600a9643ff Binary files /dev/null and b/Walls/SeaPrismWall_Purple.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/Walls/SmoothNavystoneWall.png b/Walls/SmoothNavystoneWall.png index 585d059bc8..09aa9344ea 100644 Binary files a/Walls/SmoothNavystoneWall.png and b/Walls/SmoothNavystoneWall.png differ diff --git a/Waters/BasaltGullyLava.cs b/Waters/BasaltGullyLava.cs index d81e1570c5..ba11110a93 100644 --- a/Waters/BasaltGullyLava.cs +++ b/Waters/BasaltGullyLava.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Waters public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 2.48f / 4; - g = 1.29f / 4; - b = 0.48f / 4; + r = 248f / 255; + g = 73f / 255; + b = 73f / 255; } } } diff --git a/Waters/BasaltGullyLava.png b/Waters/BasaltGullyLava.png index 2459b3cf5e..489de52258 100644 Binary files a/Waters/BasaltGullyLava.png and b/Waters/BasaltGullyLava.png differ diff --git a/Waters/BasaltGullyLava_Block.png b/Waters/BasaltGullyLava_Block.png index e1c8be0e19..6fd6bc9bf5 100644 Binary files a/Waters/BasaltGullyLava_Block.png and b/Waters/BasaltGullyLava_Block.png differ diff --git a/Waters/BasaltGullyLava_Slope.png b/Waters/BasaltGullyLava_Slope.png index a6a89147f9..3f4a9dda65 100644 Binary files a/Waters/BasaltGullyLava_Slope.png and b/Waters/BasaltGullyLava_Slope.png differ diff --git a/Waters/BasaltGullyLavaflow.png b/Waters/BasaltGullyLavaflow.png index 791bdd5ff1..162dcce323 100644 Binary files a/Waters/BasaltGullyLavaflow.png and b/Waters/BasaltGullyLavaflow.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/CalamityWorld.cs b/World/CalamityWorld.cs index 0b57888e4f..82bca91ae4 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -5,9 +5,11 @@ using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Creative; using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; @@ -52,10 +54,23 @@ namespace CalamityMod.World /// Evaluates to whether vanilla's "Legendary Mode" is enabled (Master Mode on For the Worthy). public static bool LegendaryMode => Main.getGoodWorld && ReflectMasterMode(); + /// + /// Evaluates to whether "Malice Mode" is enabled (Death Mode on For the Worthy).
+ /// Note that the effects of this difficulty are unaffiliated with the removed Malice Mode. + ///
+ public static bool MaliceMode => Main.getGoodWorld && ReflectMasterMode() && revenge; + // FTW automatically bumps difficulties up and has no proper check for Master since a world generated in Expert Mode will be classified as Master // Therefore gotta reflect! public static bool ReflectMasterMode() { + if (Main.GameModeInfo.IsJourneyMode) + { + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + float level = (float)DifficultyModeSystem.journeySliderCacheField.GetValue(power); + return level == 1f; + } + FieldInfo findInfo = typeof(Main).GetField("_currentGameModeInfo", BindingFlags.Static | BindingFlags.NonPublic); GameModeData data = (GameModeData)findInfo.GetValue(null); return data.IsMasterMode; 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 31de2c97fe..8830825e46 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,61 +20,22 @@ 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) - { - for (int i = fromInclusive; i < toExclusive; i += step) - action.Invoke(i); - } - public static void ReLogicParallelFor(int fromInclusive, int toExclusive, int step, Action action) + public static void ParallelFor(int fromInclusive, int toExclusive, int step, Action action) { - FastParallel.For(fromInclusive, toExclusive, (start, end, _) => + FasterParallel.For(fromInclusive, toExclusive, (start, end, _) => { for (int i = start; i < end; i += step) action.Invoke(i); }); } - public static void CSharpParallelFor(int fromInclusive, int toExclusive, int step, Action action) - { - var partitioner = Partitioner.Create(fromInclusive, toExclusive, step); - Parallel.ForEach(partitioner, (range, _) => - { - for (int i = range.Item1; i < range.Item2; i += step) - action.Invoke(i); - }); - } - - /// - /// The delegate that describes the method of a type of for loop. - /// - public delegate void ForLoopMethod(int fromInclusive, int toExclusive, int step, Action action); - - /// - /// The current type of for loop used to generate the Sunken Sea. - /// - public static ForLoopMethod ForLoop; - public static void PlaceTimelessShores(int startPosX, int startPosY) { int biomeSize = 250 + (Main.maxTilesX / 180); @@ -91,7 +53,7 @@ namespace CalamityMod.World else return -steepness * x + steepness; } - ForLoop.Invoke(startPosX - biomeSize - 5, startPosX + biomeSize + 20, 15, (X) => + 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) @@ -110,7 +72,7 @@ namespace CalamityMod.World // Makes the bottom borders of the Timeless Shores curved downwards. // const int totalCuveDepth = 90; - ForLoop.Invoke(startPosX - biomeSize - 10, startPosX - biomeSize + 200, 10, (x) => + 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) @@ -124,7 +86,7 @@ namespace CalamityMod.World WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } }); - ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize + 10, 5, (x) => + 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) @@ -141,7 +103,7 @@ namespace CalamityMod.World // 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 - ForLoop.Invoke(startPosX - biomeSize + 10, startPosX + biomeSize - 10, 1, (X) => + 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))); @@ -166,7 +128,7 @@ namespace CalamityMod.World // // Places slopes at the sides of the shores to actually make shores. // - ForLoop.Invoke(startPosX - biomeSize - 15, startPosX - biomeSize + 200, 20, (moundX) => + ParallelFor(startPosX - biomeSize - 15, startPosX - biomeSize + 200, 20, (moundX) => { int RandomX = Main.rand.Next(15, 20); ShapeData mound = new(); @@ -178,7 +140,7 @@ namespace CalamityMod.World 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())); }); - ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize - 15, 20, (moundX) => + ParallelFor(startPosX + biomeSize - 200, startPosX + biomeSize - 15, 20, (moundX) => { ShapeData mound = new(); GenAction blotchMod = new Modifiers.Blotches().Output(mound); @@ -196,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. - ForLoop.Invoke(startPosX - platformSize / 2, startPosX + platformSize / 2, 5, (platformX) => + 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; @@ -210,7 +172,7 @@ namespace CalamityMod.World })); } }); - ForLoop.Invoke(startPosX - platformSize / 2, startPosX + platformSize / 2, 1, (x) => + 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); @@ -218,7 +180,7 @@ namespace CalamityMod.World }); // Plateau - ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 100, (wallPillarX) => + ParallelFor(startPosX - biomeSize, startPosX + biomeSize, 100, (wallPillarX) => { int randomDisplacement = WorldGen.genRand.Next(-27, 46); int RandomX = Main.rand.Next(15, 20); @@ -249,7 +211,7 @@ namespace CalamityMod.World }); //place water below the clear barrier for the islands so that theres water inbetween them - ForLoop.Invoke(startPosX - biomeSize + 35, startPosX + biomeSize - 35, 1, (WaterX) => + ParallelFor(startPosX - biomeSize + 35, startPosX + biomeSize - 35, 1, (WaterX) => { for (int WaterY = startPosY + 37; WaterY <= startPosY + 60; WaterY++) { @@ -262,7 +224,7 @@ namespace CalamityMod.World // Generates pillars made out of walls at random points in the Timeless Shores. // const int furthestDistanceFromCenter = 100; - ForLoop.Invoke(startPosX - (biomeSize / 2) - furthestDistanceFromCenter, startPosX + (biomeSize / 2) + furthestDistanceFromCenter, 100, (wallPillarX) => + 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); @@ -294,7 +256,7 @@ namespace CalamityMod.World // Makes the transition area to the Timeless Shores. // Replaces tiles, walls, and places some water spots. // - ForLoop.Invoke(startPosX - biomeSize - 30, startPosX + biomeSize + 30, 20, (x) => + 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))); @@ -360,7 +322,7 @@ namespace CalamityMod.World } // Place layer of sand on valid runestone blocks. - ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 1, (X) => + for (int X = startPosX - biomeSize; X < startPosX + biomeSize; X += 1) { for (int Y = startPosY - 100; Y <= startPosY + 100; Y++) { @@ -369,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()); @@ -386,38 +348,39 @@ 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 - ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 1, (X) => + } + + // 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)) + })); + + } + } + } + } }); } @@ -506,7 +469,7 @@ namespace CalamityMod.World } // Cleanup - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -526,10 +489,10 @@ namespace CalamityMod.World WorldGen.KillTile(X, Y); } } - }); + } // Place layer of sand blocks on valid surfaces - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -546,10 +509,10 @@ namespace CalamityMod.World PlaceSand(X, Y, 5, ModContent.TileType()); } } - }); + } // Cleanup again - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -578,7 +541,7 @@ namespace CalamityMod.World Tile.SmoothSlope(X, Y); } } - }); + } } // Middle of the sunken sea (polyp forest) @@ -682,7 +645,7 @@ namespace CalamityMod.World } //cleanup - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -706,10 +669,10 @@ namespace CalamityMod.World } } } - }); + } //place extra tiles - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 20; Y <= origin.Y + verticalRadius + 20; Y++) { @@ -731,8 +694,8 @@ namespace CalamityMod.World } } - }); - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + } + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 20; Y <= origin.Y + verticalRadius + 20; Y++) { @@ -740,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) { @@ -752,12 +715,33 @@ 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)) + })); + + } + } } - }); + } //cleanup again - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -790,7 +774,7 @@ namespace CalamityMod.World Tile.SmoothSlope(X, Y); } } - }); + } } //bottom of the biome (gleaming burrows) public static void PlaceGleamingBurrows(int startPosX, int startPosY) @@ -816,7 +800,7 @@ namespace CalamityMod.World Vector2 bottomFoci = center + fociOffset; //place another barrier so the gleaming burrows doesnt just burst into the gully - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 10, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 10) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y += 2) { @@ -845,7 +829,7 @@ namespace CalamityMod.World } } } - }); + } @@ -927,7 +911,7 @@ namespace CalamityMod.World //cleanup the perlin caves - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -951,11 +935,11 @@ namespace CalamityMod.World } } } - }); + } //place extra tiles - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -975,7 +959,7 @@ namespace CalamityMod.World } } } - }); + } //cleanup again, also place geodes for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -1103,7 +1087,7 @@ namespace CalamityMod.World //cleanup the perlin caves - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -1127,11 +1111,11 @@ namespace CalamityMod.World } } } - }); + } //place extra tiles - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -1151,7 +1135,7 @@ namespace CalamityMod.World } } } - }); + } //cleanup again for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -1198,7 +1182,7 @@ namespace CalamityMod.World int XLeft = GenVars.UndergroundDesertLocation.Left + 40; int XRight = GenVars.UndergroundDesertLocation.Right - 70; //place blocks of basalt all the way down to hell, here it just places one block and wall so it doesnt hurt preformance - ForLoop.Invoke(startPosX - biomeSize - 60, startPosX + biomeSize + 60, 1, (X) => + for (int X = startPosX - biomeSize - 60; X < startPosX + biomeSize + 60; X += 1) { //const int totalCuveDepth = -120; //const int totalCuveDepth2 = 120; @@ -1229,7 +1213,7 @@ namespace CalamityMod.World WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); WorldGen.PlaceWall(X, Y, ModContent.WallType()); } - }); + } //place caverns and lava for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++) @@ -1256,7 +1240,7 @@ namespace CalamityMod.World } //place sand blocks - ForLoop.Invoke(startPosX - biomeSize - (Main.maxTilesX / 25), startPosX + biomeSize + (Main.maxTilesX / 25), 1, (X) => + for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X < startPosX + biomeSize + (Main.maxTilesX / 25); X += 1) { for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) { @@ -1273,10 +1257,10 @@ namespace CalamityMod.World PlaceSand(X, Y, 3, ModContent.TileType()); } } - }); + } //cleanup - ForLoop.Invoke(startPosX - biomeSize - (Main.maxTilesX / 25), startPosX + biomeSize + (Main.maxTilesX / 25), 1, (X) => + for(int X = startPosX - biomeSize - (Main.maxTilesX / 25); X < startPosX + biomeSize + (Main.maxTilesX / 25); X += 1) { for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) { @@ -1305,7 +1289,7 @@ namespace CalamityMod.World } Tile.SmoothSlope(X, Y); } - }); + } } //cleanup is done separately because for whatever reason it keeps placing water inside of the gully if the cleanup is done before it @@ -1348,7 +1332,7 @@ namespace CalamityMod.World for (int Y = 20; Y <= Main.maxTilesY - 20; Y++) { //place coral blobs in the radiant reefs - if (WorldGen.genRand.NextBool(1000) && ((Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile) || + if (WorldGen.genRand.NextBool(800) && ((Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile) || (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile))) { ushort[] Corals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), @@ -1370,7 +1354,7 @@ namespace CalamityMod.World if (Main.tile[X, Y].TileType == ModContent.TileType()) { //Driftwood Ambiance - if (WorldGen.genRand.NextBool(100)) + if (WorldGen.genRand.NextBool(70)) { ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -1437,26 +1421,28 @@ namespace CalamityMod.World } if (Main.tile[X, Y].TileType == ModContent.TileType()) { + int RandStyle() => WorldGen.genRand.Next(8); + int style = RandStyle(); //Medium Sea Prism down if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 7); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 5); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 4); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 2); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } } if (Main.tile[X, Y].TileType == ModContent.TileType()) @@ -1502,60 +1488,33 @@ namespace CalamityMod.World if (WorldGen.genRand.NextBool()) { ushort[] Piles = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (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(Piles)); } - if (WorldGen.genRand.NextBool(8)) - { - ushort[] NavystoneAmbients = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(NavystoneAmbients)); - } } //Polyp Forest Ambient tiles if (Main.tile[X, Y].TileType == ModContent.TileType()) { + int RandStyle() => WorldGen.genRand.Next(8); + int style = RandStyle(); //BranchCoralsOnLimestone if (WorldGen.genRand.NextBool(15)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 7); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } if (WorldGen.genRand.NextBool(15)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 1); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 5); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 4); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 3); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 2); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 6); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } } if (Main.tile[X, Y].TileType == ModContent.TileType()) { + int RandStyle() => WorldGen.genRand.Next(8); + int style = RandStyle(); if (WorldGen.genRand.NextBool(50) && !Main.tile[X - 1, Y].HasTile) WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(3), Actions.Chain(new GenAction[] { @@ -1564,49 +1523,24 @@ namespace CalamityMod.World new Actions.PlaceTile((ushort)ModContent.TileType()), })); //BranchCoralsOnSand - if (WorldGen.genRand.NextBool(55)) + if (WorldGen.genRand.NextBool(25)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 3); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } - if (WorldGen.genRand.NextBool(55)) + if (WorldGen.genRand.NextBool(25)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 1); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 5); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 4); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 3); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 2); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 8); - } - if (WorldGen.genRand.NextBool(30)) + if (WorldGen.genRand.NextBool(25)) { ushort[] DigitateCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DigitateCorals)); } - if (WorldGen.genRand.NextBool(15)) + if (WorldGen.genRand.NextBool(8)) { ushort[] FryCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -1856,7 +1790,11 @@ namespace CalamityMod.World { new Actions.ClearTile(), new Actions.SetLiquid(), - new Actions.PlaceWall((ushort)ModContent.WallType()) + })); + + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(radius - 4), Actions.Chain(new GenAction[] + { + new Actions.PlaceWall((ushort)ModContent.WallType()) })); return true; @@ -1902,7 +1840,7 @@ namespace CalamityMod.World getAttachedPoints(x, y - 1, points); } - ForLoop.Invoke(20, Main.maxTilesX - 20, 1, (x) => + for (int x = 20; x < Main.maxTilesX - 20; x += 1) { for (int y = 20; y < Main.maxTilesY - 20; y++) { @@ -1922,7 +1860,7 @@ namespace CalamityMod.World } } } - }); + } } 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 {