diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs index 838eda9488..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) @@ -73,6 +122,7 @@ namespace CalamityMod.Backgrounds // Leaving this here for other programmers, in case I don't get to doing this myself. Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix); + DrawShoresBG(); DrawBurrowsBG(); Main.spriteBatch.End(); @@ -97,6 +147,7 @@ namespace CalamityMod.Backgrounds // rendering code if that setting is on. if (Main.WaveQuality > 0 || !CalamityClientConfig.Instance.SunkenSeaBackgroundDistortion) { + DrawShoresBG(); DrawBurrowsBG(); } else @@ -123,14 +174,103 @@ namespace CalamityMod.Backgrounds } public static float Transparency; - public static float TransitionSpeed => 0.02f; + private static void DrawShoresBG() + { + if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) + { + Transparency += 1f; + + if (Transparency > 1f) + Transparency = 1f; + } + else + { + // Make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has. + Transparency -= 1f; + + if (Transparency < 0f) + Transparency = 0f; + } + + // Don't bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active). + // Also do not run any of the background drawing if you have the vanilla background config option turned off. + if (Transparency > 0f && Main.BackgroundEnabled) + { + Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1)); + float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f; + float Scale = 1.5f; + float playerDrawPosition = ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f; + + for (int Layers = 4; Layers >= 0; Layers--) + { + // Get each background texture. + Texture2D BGTexture = ModContent.Request("CalamityMod/Backgrounds/SunkenSeaShoresBG" + Layers).Value; + + Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f; + float num2 = (Layers * 2 + 3f); + Vector2 vector3 = new Vector2(1f / num2); + Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height); + Vector2 zero = Vector2.Zero; + + switch (Layers) + { + case 0: + { + zero.Y += 200f; + break; + } + case 1: + { + zero.Y += 0f; + break; + } + case 2: + { + zero.Y += 0f; + break; + } + case 3: + { + zero.Y += 0f; + break; + } + case 4: + { + zero.Y += 0f; + break; + } + } + + vector2 *= Scale; + + zero.Y -= num; + float LoopWidth = Scale * rectangle.Width; + float LoopHeight = Scale * rectangle.Height; + int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth); + int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth); + + for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++) + { + for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++) + { + Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), playerDrawPosition) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero; + + var frame = rectangle; + var color = Color.White * Transparency; + + Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); + } + } + } + } + } private static void DrawBurrowsBG() { if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) { - Transparency += TransitionSpeed; + Transparency += 1f; if (Transparency > 1f) Transparency = 1f; diff --git a/Backgrounds/SunkenSeaShoresBG0.png b/Backgrounds/SunkenSeaShoresBG0.png new file mode 100644 index 0000000000..272e84a3d0 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG0.png differ diff --git a/Backgrounds/SunkenSeaShoresBG1.png b/Backgrounds/SunkenSeaShoresBG1.png new file mode 100644 index 0000000000..0d7faa83b7 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG1.png differ diff --git a/Backgrounds/SunkenSeaShoresBG2.png b/Backgrounds/SunkenSeaShoresBG2.png new file mode 100644 index 0000000000..ddaffc2a82 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG2.png differ diff --git a/Backgrounds/SunkenSeaShoresBG3.png b/Backgrounds/SunkenSeaShoresBG3.png new file mode 100644 index 0000000000..e9668359e5 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG3.png differ diff --git a/Backgrounds/SunkenSeaShoresBG4.png b/Backgrounds/SunkenSeaShoresBG4.png new file mode 100644 index 0000000000..4922846eb0 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG4.png differ diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 1e5a5fe8b1..644d258596 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Balancing { public sealed class BalancingChangesManager : ModSystem { - internal static List UniversalBalancingChanges = null; internal static List NPCSpecificBalancingChanges = null; // 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. @@ -37,6 +36,7 @@ namespace CalamityMod.Balancing public override void SetStaticDefaults() { // Dirty shorthand for true melee resists, because they're super common and other class resists aren't. + // If you add/change a true melee resist here, be sure to add/change the resist in CalamityGlobalNPC ModifyHitByItem as well. IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance); // Declare specific filters. @@ -46,50 +46,12 @@ namespace CalamityMod.Balancing bool DragonRageFilter(Projectile p) => p.type == ProjectileType() || p.type == ProjectileType() || (p.type == ProjectileType() && p.CountsAsClass()); - // bool MonkStaffT3Filter(Projectile p) => - // p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3); - - bool MushroomSpearFilter(Projectile p) => - p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear; - - bool OrichalcumPetalFilter(Projectile p) => - p.type == ProjectileID.FlowerPetal && Main.player[p.owner].onHitPetal; - - bool SpectreMaskSetBonusFilter(Projectile p) => - p.type == ProjectileID.SpectreWrath && Main.player[p.owner].ghostHurt; - bool AotCThrowCombo(Projectile p) => p.type == ProjectileType() && (p.ai[0] == 2 || p.ai[0] == 3); bool HiveBeeFilter(Projectile p) => p.type == ProjectileType() && Main.player[p.owner].ActiveItem().type == ItemType(); - UniversalBalancingChanges = new List() - { - // Nerf Crystal bullet shards by 45% - // Currently crystal bullet projectiles deal 50% of the bullet's damage which is absurd in vanilla, this nerfs them to 27.5% - Do(new ProjectileResistBalancingRule(0.55f, ProjectileID.CrystalShard)), - - // Nerf Luminite Arrow trails by 50%. - Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.MoonlordArrowTrail)), - - // Nerf Seedler seeds by 25%. - Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.SeedlerNut, ProjectileID.SeedlerThorn)), - - // Nerf Cursed Dart flames by 50%. - Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CursedDartFlame)), - - // Nerf Mushroom Spear projectiles by 50%. - Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)), - - // Nerf Orichalcum armor set bonus petals by 25%. - Do(new ProjectileSpecificRequirementBalancingRule(0.75f, OrichalcumPetalFilter)), - - // Nerf Spectre Mask set bonus projectiles by 50%. - Do(new ProjectileSpecificRequirementBalancingRule(0.5f, SpectreMaskSetBonusFilter)), - - }; - NPCSpecificBalancingChanges = new List(); #region Crabulon @@ -97,28 +59,28 @@ namespace CalamityMod.Balancing NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), ResistTrueMelee(0.8f))); #endregion - #region Brain of Cthulhu: Creepers - // 50% resist to true melee. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.5f)))); - - // 50% resist to Demon Scythe. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); - #endregion - #region Eater of Worlds - // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.5f)))); - // 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(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f)))); + #endregion + + #region Brain of Cthulhu: Creepers + // 50% resist to Demon Scythe. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); + + // 25% resist to true melee. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.75f)))); #endregion #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 @@ -128,55 +90,58 @@ 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 - // 30% resist to The Ballista's greatarrows. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 25% resist to true melee. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), ResistTrueMelee(0.75f))); + + // 25% resist to The Ballista's greatarrows. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); #endregion #region Duke Fishron @@ -197,28 +162,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())))); - // 50% resist to Icicle Arrows. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + // 40% resist to Icicle Arrows. + 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)))); - - // 30% resist to Aurora Blazer. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); - - // 30% resist to Flak Kraken. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + 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(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 @@ -237,37 +199,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)))); - - // 55% resist to Flak Kraken. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType())))); + 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())))); - - // 50% resist to Aurora Blazer. - 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)))); - - // 35% resist to Ballistic Poison Bomb's clouds. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + 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(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + + // 30% resist to Flak Kraken. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + + // 20% resist to Ballistic Poison Bomb's clouds. + 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 @@ -301,28 +263,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 @@ -332,19 +294,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 @@ -357,34 +319,34 @@ 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())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, 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)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, 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 ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); // 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 @@ -396,85 +358,85 @@ 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())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, 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())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, 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.55f, 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())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 30% resist to Sirius. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 30% resist to Ultima's rays. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, 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)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, 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 ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 25% resist to Zenith. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, 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.8f, ProjectileType())))); // 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 ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Plasma Grenade and Dynamic Pursuer's explosions. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), 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())))); #endregion #region Supreme Calamitas: Brimstone Hearts @@ -511,23 +473,12 @@ namespace CalamityMod.Balancing public override void Unload() { - UniversalBalancingChanges = null; NPCSpecificBalancingChanges = null; } public static void ApplyFromProjectile(NPC npc, ref NPC.HitModifiers modifiers, Projectile proj) { - // Apply universal balancing rules. - foreach (IBalancingRule[] balancingRules in UniversalBalancingChanges) - { - foreach (IBalancingRule balancingRule in balancingRules) - { - if (balancingRule.AppliesTo(npc, modifiers, proj)) - balancingRule.ApplyBalancingChange(npc, ref modifiers); - } - } - - // As well as rules specific to NPCs. + // Apply NPC-specific balancing rules. foreach (NPCBalancingChange balanceChange in NPCSpecificBalancingChanges) { if (npc.type != balanceChange.NPCType) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 430de64677..2322303648 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -117,54 +117,22 @@ #endregion #region Life Steal - // Life steal cap + // Life steal cap (Maximum HP healed per instance of lifesteal) internal static readonly int LifeStealCap = 100; - - // Life steal accessories require a more strict cooldown due to their ease of use and global application - internal static readonly float LifeStealAccessoryCooldownMultiplier = 3f; - // Life steal cooldown multipliers used for armor set bonuses - internal static readonly float LifeStealSetBonusCooldownMultiplier = 2f; - internal static readonly float LifeStealReaverTankCooldownMultiplier = 4f; - - // The range was buffed in vanilla from 1200 to 3000 in 1.4.4, and I agree with that decision - internal static readonly float LifeStealRange = 3000f; - - // Life steal caps (aka, how much life steal the player is allowed before it goes on cooldown) - internal static readonly float LifeStealCap_Classic = 60f; - internal static readonly float LifeStealCap_Expert = 50f; - internal static readonly float LifeStealCap_Revengeance = 40f; - internal static readonly float LifeStealCap_Death = 30f; - - // Master nerfs the life steal cap by 10, resulting in 40 in non-Rev Master, 30 in Rev Master, and 20 in Death Master - internal static readonly float LifeStealCapReduction_Master = 10f; + // Base life steal caps from vanilla (aka, how much life steal the player is allowed before it goes on cooldown) + internal static readonly float LifeStealCap_Classic = 80f; + internal static readonly float LifeStealCap_Expert = 70f; // The base life steal cooldowns from vanilla internal static readonly float LifeStealRecoveryRate_Classic = 0.6f; internal static readonly float LifeStealRecoveryRate_Expert = 0.5f; - // The calculations below show the time (in frames) for 10 life steal cooldown to recover in each difficulty - // Classic: 10 / 0.2 = 50 - // Expert: 10 / 0.15 = 66.667 - // Revengeance: 10 / 0.125 = 80 - // Death: 10 / 0.1 = 100 - // Master: 10 / 0.1 = 100 - // Revengeance Master: 10 / 0.075 = 133.333 - // Death Master: 10 / 0.05 = 200 - // Nerfs the life steal recovery rate in Classic from 0.6/s to 0.2/s + // Nerfs the life steal recovery rate in Classic from 0.6 to 0.2 (36 HP/s to 12 HP/s) internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f; - // Nerfs the life steal recovery rate in Expert from 0.5/s to 0.15/s + // Nerfs the life steal recovery rate in Expert from 0.5 to 0.15 (30 HP/s to 9 HP/s) internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f; - - // Nerfs the life steal recovery rate in Revengeance from 0.5/s to 0.125/s - internal static readonly float LifeStealRecoveryRateReduction_Revengeance = 0.375f; - - // Nerfs the life steal recovery rate in Death from 0.5/s to 0.1/s - internal static readonly float LifeStealRecoveryRateReduction_Death = 0.4f; - - // Nerfs the life steal recovery rate in Master by 0.05/s, resulting in 0.1/s in non-Rev Master, 0.075/s in Rev Master, and 0.05/s in Death Master - internal static readonly float LifeStealRecoveryRateReduction_Master = 0.05f; #endregion #region Rogue Base Stats 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 f893df6689..28c7af8b79 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -16,14 +16,14 @@ namespace CalamityMod.Buffs { // Globally remove summon tag buff stacking // Other mods need to add to this list because we genuinely don't have any way to tell this - if (SummonTagBuffList.Includes(type) && buffIndex > 0) + if (CalamityBuffSets.IsSummonTagBuff[type] && buffIndex > 0) { for (int i = buffIndex; i >= 0; i--) { if (player.buffTime[i] > 0) { int buffID = player.buffType[i]; - if (SummonTagBuffList.Includes(buffID) && buffID != type) + if (CalamityBuffSets.IsSummonTagBuff[buffID] && buffID != type) { player.DelBuff(i); break; @@ -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) @@ -115,6 +107,19 @@ namespace CalamityMod.Buffs else if (type == BuffID.Rabies) { player.GetDamage() -= 0.2f; + + // Reimplementation of random debuff infliction; now occurs on a consistent timer and with a different debuff list + if (player.buffTime[buffIndex] % 600 == 300) + { + int debuffType = Main.rand.Next(4) switch + { + 0 => BuffID.Weak, + 1 => BuffID.Bleeding, + 2 => BuffID.Darkness, + _ => BuffID.BrokenArmor, + }; + player.AddBuff(debuffType, Main.rand.Next(90, 211)); + } } else if (type == BuffID.Werewolf) { @@ -126,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; @@ -144,28 +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--; - } - else if (type == BuffID.Slow) - { - if (npc.Calamity().slowed < npc.buffTime[buffIndex]) - npc.Calamity().slowed = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().slowed; - 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; } } @@ -210,10 +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; @@ -251,6 +237,10 @@ namespace CalamityMod.Buffs tip = tip.Replace("45", "22.5"); break; + case BuffID.Rabies: + tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.Rabies"); + break; + case BuffID.SugarRush: 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..c8453011c4 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) 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..b1de8ac23a 100644 --- a/Buffs/DamageOverTime/ManaBurn.cs +++ b/Buffs/DamageOverTime/ManaBurn.cs @@ -6,6 +6,7 @@ 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; 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..7008cead6a 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,10 +31,7 @@ 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) 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/PopoBuff.cs b/Buffs/PopoBuff.cs index f5d8e36d54..4b433f99ae 100644 --- a/Buffs/PopoBuff.cs +++ b/Buffs/PopoBuff.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Accessories.Vanity; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,11 +19,7 @@ namespace CalamityMod.Buffs public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.snowmanPrevious) - { - modPlayer.snowmanPower = true; - } - else + if (player.Transformation().Type != ModContent.ItemType()) { player.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/PopoNoselessBuff.cs b/Buffs/PopoNoselessBuff.cs index ed87c9db8d..fd284151e7 100644 --- a/Buffs/PopoNoselessBuff.cs +++ b/Buffs/PopoNoselessBuff.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Accessories.Vanity; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,11 +18,8 @@ namespace CalamityMod.Buffs public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.snowmanPrevious) - { - modPlayer.snowmanPower = true; + if (player.Transformation().Type == ModContent.ItemType()) modPlayer.snowmanNoseless = true; - } else { player.DelBuff(buffIndex); diff --git a/Buffs/Potions/ShadowBuff.png b/Buffs/Potions/ShadowBuff.png index ed4141070a..bb0b1ed058 100644 Binary files a/Buffs/Potions/ShadowBuff.png and b/Buffs/Potions/ShadowBuff.png differ diff --git a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs index e1757ba91c..68c5c642f7 100644 --- a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs +++ b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Buffs.StatBuffs player.maxFallSpeed = 9f; player.gills = true; } - modPlayer.abyssalDivingSuitPower = true; modPlayer.depthCharm = true; modPlayer.jellyfishNecklace = true; modPlayer.anechoicPlating = true; 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/AquaticHeartBuff.cs b/Buffs/StatBuffs/AquaticHeartBuff.cs index 344acacd15..5dde4436f3 100644 --- a/Buffs/StatBuffs/AquaticHeartBuff.cs +++ b/Buffs/StatBuffs/AquaticHeartBuff.cs @@ -20,14 +20,13 @@ namespace CalamityMod.Buffs.StatBuffs CalamityPlayer modPlayer = player.Calamity(); if (modPlayer.aquaticHeartPrevious) { - modPlayer.aquaticHeartPower = true; player.ignoreWater = NPC.downedBoss3; player.accFlipper = true; if (player.breath <= player.breathMax + 2 && !modPlayer.ZoneAbyss && NPC.downedBoss3) { player.breath = player.breathMax + 3; } - if (Main.myPlayer == player.whoAmI && player.wet && NPC.downedBoss3) + if (Main.myPlayer == player.whoAmI && player.Calamity().countsAsAnyWet && NPC.downedBoss3) { player.AddBuff(ModContent.BuffType(), 360); } diff --git a/Buffs/StatBuffs/BrutalCarnage.cs b/Buffs/StatBuffs/BrutalCarnage.cs deleted file mode 100644 index bcb31db8f7..0000000000 --- a/Buffs/StatBuffs/BrutalCarnage.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Terraria; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatBuffs -{ - public class BrutalCarnage : ModBuff - { - public static float MeleeDamageBoost = 0.2f; - public override LocalizedText Description => base.Description.WithFormatArgs(MeleeDamageBoost.ToPercent()); - - public override void SetStaticDefaults() - { - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().brutalCarnage = true; - } - } -} diff --git a/Buffs/StatBuffs/BrutalCarnage.png b/Buffs/StatBuffs/BrutalCarnage.png deleted file mode 100644 index 9b3ce4f18a..0000000000 Binary files a/Buffs/StatBuffs/BrutalCarnage.png and /dev/null differ 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 ffbb2a810b..b87a1df91b 100644 --- a/Buffs/StatDebuffs/GlacialState.cs +++ b/Buffs/StatDebuffs/GlacialState.cs @@ -18,34 +18,13 @@ namespace CalamityMod.Buffs.StatDebuffs BuffID.Sets.LongerExpertDebuff[Type] = true; } - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().gState = true; - } - 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--; } - - internal static void DrawEffects(PlayerDrawSet drawInfo) - { - Player Player = drawInfo.drawPlayer; - - if (Main.rand.NextBool(4)) - { - Dust d = Dust.NewDustDirect(Player.Center - 10 * Vector2.One, 20, 20, DustID.IcyMerman); - d.noGravity = Main.rand.NextBool(); - d.noLight = false; - d.velocity *= 0.2f; - d.velocity.Y -= Main.rand.NextFloat(0.4f, 0.6f); - d.scale = Main.rand.NextFloat(0.4f, 0.7f); - } - } } } 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/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1f7e29d431..a2b7731d04 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -21,14 +21,18 @@ 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; @@ -103,10 +107,6 @@ namespace CalamityMod.CalPlayer public static int chaosStateDuration = 900; /// Constant variable used for how long Chaos State is inflicted by Normality Relocator while a boss is alive. public static int chaosStateDuration_NR = 1200; - /// Used by Sky Stabber and Gods' Paranoia to delete spiky balls when using right-click. - public bool killSpikyBalls = false; - public float KameiTrailXScale = 0.1f; - public int KameiBladeUseDelay = 0; /// Stores the positions of the player within the previous 4 frames. Used for drawing trail effects. public Vector2[] OldPositions = new Vector2[4]; public double contactDamageReduction = 0D; @@ -175,6 +175,15 @@ namespace CalamityMod.CalPlayer public int momentumCapacitorTime = 0; /// A multiplier on the player's movement speed applied while using Momentum Capacitor. public float momentumCapacitorBoost = 0f; + + public bool countsAsAnyWet => (Player.armor[0].type == ItemID.FishBowl || Player.wetCount > 0 || Player.wet || Player.honeyWet || Player.lavaWet); + + public StatModifier TypelessDebuffMultiplier = new(); + public StatModifier HeatDebuffMultiplier = new(); + public StatModifier ColdDebuffMultiplier = new(); + public StatModifier SicknessDebuffMultiplier = new(); + public StatModifier WaterDebuffMultiplier = new(); + public StatModifier ElectricDebuffMultiplier = new(); #endregion #region Speedrun Timer @@ -198,7 +207,6 @@ namespace CalamityMod.CalPlayer #region External variables -- Not used by Calamity, only via Mod.Call or reflection public int externalAbyssLight = 0; - public float externalBreathLossMultBoost = 0f; public float externalBreathTickBoost = 0f; public float externalFlightTimeMultBoost = 0f; @@ -277,6 +285,8 @@ namespace CalamityMod.CalPlayer public int evilSmasherBoost = 0; /// Cooldown variable for spawning Plague Tainted SMG's drones from left-click bullets. public int plagueTaintedSMGDroneCooldown = 0; + /// Cooldown variable which prevents using Firestorm Cannon or Spectralstorm Cannon during their overheat periods. + public int flareGunOverheat = 0; /// /// If true, this player's Brittle Star Staff minions are in their orbiting mode.
/// While in this mode, they orbit around the player, do not break on hits, and increase defense. @@ -298,10 +308,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; @@ -333,10 +346,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; @@ -402,7 +415,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"); @@ -455,7 +467,7 @@ namespace CalamityMod.CalPlayer /// This is obtained from a formula derived from the player's current stealth, the weapon's use time, and the player's stealth generation boosts. ///
public float stealthDamage = 0f; - /// An additional damage multiplier applied to rogue stealth strikes. Used by Filthy Glove and its upgrades, and Rotten Dogtooth. + /// An additional damage multiplier applied to rogue stealth strikes. Used by Filthy Glove, Rotten Dogtooth and their upgrades. public double bonusStealthDamage = 0; public float rogueVelocity = 1f; #endregion @@ -556,7 +568,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 @@ -660,8 +671,6 @@ namespace CalamityMod.CalPlayer #endregion #region Abyss - /// The amount of breath lost on each tick while in the Abyss. - public float abyssBreathLossStat = 0; /// The rate at which breath is lost while in the Abyss. public float abyssBreathLossRateStat = 0; /// The rate at which health is decreased after running out of breath while in the Abyss. @@ -718,8 +727,8 @@ namespace CalamityMod.CalPlayer public bool gladiatorSword = false; public int gladiatorTimer = 0; public bool unstableGraniteCore = false; - public bool regenator = false; - public float regenatorDamage = 0; + public bool regenerator = false; + public float regeneratorDamage = 0; public bool theBee = false; public bool arcFlashRing = false; public bool arcFlashRingVisual = false; @@ -765,8 +774,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; @@ -781,10 +788,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; @@ -801,12 +804,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; @@ -875,7 +880,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; @@ -927,15 +931,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; @@ -979,16 +982,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; @@ -1049,7 +1052,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; @@ -1063,6 +1065,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. @@ -1083,8 +1087,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; @@ -1141,12 +1149,9 @@ 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; - public bool reaverRegen = false; - public int reaverRegenCooldown = 0; public bool reaverDefense = false; public bool reaverExplore = false; public bool fathomSwarmer = false; @@ -1182,8 +1187,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; @@ -1246,26 +1251,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 gState = 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; @@ -1276,9 +1280,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; @@ -1288,9 +1292,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; @@ -1321,7 +1325,6 @@ namespace CalamityMod.CalPlayer public bool xWrath = false; public bool graxDefense = false; public bool encased = false; - public bool brutalCarnage = false; public bool omniscience = false; public bool zerg = false; public bool zen = false; @@ -1448,21 +1451,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; @@ -1579,33 +1582,19 @@ namespace CalamityMod.CalPlayer #endregion #region Transformation - public bool abyssalDivingSuitPrevious; public bool abyssalDivingSuit; - public bool abyssalDivingSuitHide; - public bool abyssalDivingSuitForce; - public bool abyssalDivingSuitPower; + public bool abyssalDivingSuitPrevious; public bool profanedCrystal; public int profanedCrystalStatePrevious; public bool profanedCrystalPrevious; public int profanedCrystalAnim; - public bool profanedCrystalForce; public bool profanedCrystalBuffs; - public bool profanedCrystalHide; - public KeyValuePair profanedCrystalWingCounter = new KeyValuePair(0, 10); - public KeyValuePair profanedCrystalAnimCounter = new KeyValuePair(0, 10); + public int pscState; public Color pscLerpColor = Color.White; public bool aquaticHeartPrevious; public bool aquaticHeart; - public bool aquaticHeartHide; - public bool aquaticHeartForce; - public bool aquaticHeartPower; - public bool snowmanPrevious; - public bool snowman; - public bool snowmanHide; - public bool snowmanForce; public bool snowmanNoseless; - public bool snowmanPower; public bool meldTransformationPrevious; public bool meldTransformation; public bool meldTransformationForce; @@ -1614,8 +1603,6 @@ namespace CalamityMod.CalPlayer public bool omegaBlueTransformation; public bool omegaBlueTransformationForce; public bool omegaBlueTransformationPower; - public bool ghostBracelet; - public bool punchCard; #endregion #region Calamitas Enchant Effects @@ -2000,10 +1987,9 @@ 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 if (bloodPact) percentMaxLifeIncrease += 25; @@ -2043,7 +2029,6 @@ namespace CalamityMod.CalPlayer DashID = string.Empty; externalAbyssLight = 0; - externalBreathLossMultBoost = 0f; externalBreathTickBoost = 0f; externalFlightTimeMultBoost = 0f; externalRageEnabled = externalAdrenalineEnabled = null; @@ -2174,7 +2159,7 @@ namespace CalamityMod.CalPlayer trinketOfChi = false; gladiatorSword = false; unstableGraniteCore = false; - regenator = false; + regenerator = false; deepDiver = false; theBee = false; arcFlashRing = false; @@ -2235,8 +2220,6 @@ namespace CalamityMod.CalPlayer cryogenSoul = false; ascendantInsignia = false; ascendantTrail = false; - frozenWingsCold = false; - flameWingsHeat = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; @@ -2324,7 +2307,6 @@ namespace CalamityMod.CalPlayer scionsCurio = false; rottenDogTooth = false; angelicAlliance = false; - BloomStoneRegen = false; ChaosStone = false; CryoStone = false; CryoStoneVanity = false; @@ -2349,7 +2331,6 @@ namespace CalamityMod.CalPlayer avertorBonus = false; - reaverRegen = false; reaverSpeed = false; reaverDefense = false; reaverExplore = false; @@ -2381,6 +2362,7 @@ namespace CalamityMod.CalPlayer forbiddenCirclet = false; silverMedkit = false; + tungstenArmorHookBoost = false; goldArmorGoldDrops = false; miningSet = false; @@ -2392,8 +2374,11 @@ namespace CalamityMod.CalPlayer necroSet = false; frostSet = false; - victideSet = false; - victideSummoner = false; + victideBarrierSet = false; + victideBarrierHead = false; + victideBurrowSet = false; + victideBurrowHead = false; + victideSnailSet = false; sulphurSet = false; @@ -2404,7 +2389,6 @@ namespace CalamityMod.CalPlayer titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; - titanHeartBoots = false; umbraphileSet = false; plagueReaper = false; plaguebringerPatronSet = false; @@ -2463,27 +2447,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; - gState = false; - bBlood = false; + plague = false; + holyFlames = false; + holyInferno = false; + burningBlood = false; brainRot = false; heavybleeding = false; laceration = false; @@ -2493,9 +2476,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; @@ -2505,13 +2488,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; @@ -2522,7 +2512,6 @@ namespace CalamityMod.CalPlayer xWrath = false; graxDefense = false; encased = false; - brutalCarnage = false; omniscience = false; zerg = false; zen = false; @@ -2556,8 +2545,6 @@ namespace CalamityMod.CalPlayer bloodfinBoost = false; divineBless = false; - killSpikyBalls = false; - vodka = false; redWine = false; grapeBeer = false; @@ -2616,11 +2603,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; @@ -2634,18 +2621,18 @@ namespace CalamityMod.CalPlayer 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; @@ -2728,32 +2715,24 @@ namespace CalamityMod.CalPlayer */ abyssalDivingSuitPrevious = abyssalDivingSuit; - abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; + abyssalDivingSuit = false; - aquaticHeartPrevious = aquaticHeart; - aquaticHeart = aquaticHeartHide = aquaticHeartForce = aquaticHeartPower = false; + aquaticHeart = false; profanedCrystalStatePrevious = pscState; profanedCrystalPrevious = profanedCrystal; - profanedCrystal = profanedCrystalBuffs = profanedCrystalForce = profanedCrystalHide = false; + profanedCrystal = profanedCrystalBuffs = false; pscState = 0; pscLerpColor = Color.White; - snowmanPrevious = snowman; - snowman = snowmanHide = snowmanForce = snowmanPower = false; - meldTransformationPrevious = meldTransformation; meldTransformation = meldTransformationForce = meldTransformationPower = false; omegaBlueTransformationPrevious = omegaBlueTransformation; omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false; - ghostBracelet = false; - punchCard = false; - rageModeActive = false; adrenalineModeActive = false; - AdrenalineTrail = false; RageDuration = BalancingConstants.DefaultRageDuration; RageDamageBoost = BalancingConstants.DefaultRageDamageBoost; @@ -2799,14 +2778,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 @@ -2869,10 +2846,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,7 +2881,6 @@ namespace CalamityMod.CalPlayer demonSwordKillMode = false; externalAbyssLight = 0; - externalBreathLossMultBoost = 0f; externalBreathTickBoost = 0f; externalFlightTimeMultBoost = 0f; externalColdImmunity = externalHeatImmunity = false; @@ -2917,11 +2893,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; @@ -2932,27 +2906,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; - gState = false; - bBlood = false; + plague = false; + holyFlames = false; + holyInferno = false; + burningBlood = false; brainRot = false; heavybleeding = false; laceration = false; @@ -2962,9 +2935,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; @@ -2974,13 +2947,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 @@ -3025,7 +3004,6 @@ namespace CalamityMod.CalPlayer xWrath = false; graxDefense = false; encased = false; - brutalCarnage = false; omniscience = false; zerg = false; zen = false; @@ -3102,6 +3080,7 @@ namespace CalamityMod.CalPlayer #region Armor Set Bonuses silverMedkit = false; silverMedkitTimer = 0; + tungstenArmorHookBoost = false; goldArmorGoldDrops = false; miningSet = false; miningSetCooldown = 0; @@ -3118,7 +3097,7 @@ namespace CalamityMod.CalPlayer silvaMage = false; silvaSummon = false; hasSilvaEffect = false; - silvaCountdown = silvaReviveDuration; + silvaCountdown = SilvaReviveDuration; auricSet = false; GemTechSet = false; CobaltSet = false; @@ -3143,8 +3122,6 @@ namespace CalamityMod.CalPlayer lunicCorpsSet = false; lunicCorpsLegs = false; reaverSpeed = false; - reaverRegen = false; - reaverRegenCooldown = 0; reaverDefense = false; reaverExplore = false; shadeRegen = false; @@ -3152,7 +3129,6 @@ namespace CalamityMod.CalPlayer titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; - titanHeartBoots = false; titanCooldown = 0; umbraphileSet = false; fathomSwarmer = false; @@ -3184,7 +3160,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; @@ -3237,11 +3216,10 @@ namespace CalamityMod.CalPlayer CurrentlyViewedHologramText = string.Empty; #endregion - KameiBladeUseDelay = 0; - AdrenalineTrail = false; ascendantTrail = false; evilSmasherBoost = 0; burningSeaBurnOut = 0; + flareGunOverheat = 0; hellbornShots = 0; searedPanCounter = 0; searedPanTimer = 0; @@ -3551,19 +3529,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(); } } @@ -3776,25 +3751,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); @@ -3917,8 +3916,8 @@ namespace CalamityMod.CalPlayer } if (forbiddenCirclet && forbiddenCooldown <= 0) { - 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) @@ -3934,9 +3933,9 @@ namespace CalamityMod.CalPlayer // To compute Forbidden Circlet tornado damage, create a fake stat modifier on the spot which combines both classes. StatModifier forbidden = Player.GetTotalDamage().CombineWith(Player.GetDamage()); - int damage = (int)forbidden.ApplyTo(ForbiddenCirclet.tornadoBaseDmg); + 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) { @@ -3948,6 +3947,30 @@ namespace CalamityMod.CalPlayer } 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 @@ -4057,6 +4080,11 @@ namespace CalamityMod.CalPlayer // Putting this in GlobalItem will run multiple times for each slot, which this system already does, creating a slew of problems. VanillaArmorChangeManager.ApplyPotentialEffectsTo(Player); + // Nerf to the proc rate of Spectre Mask's set bonus souls + // Vanilla subtracts 6.6666665 from this counter per frame, this reduces it to 4 + if (Player.ghostDmg > 0) + Player.ghostDmg += 2.6666665f; + // If the config is enabled, vastly increase the player's base tile and wall placement speeds // This stacks with the Brick Layer and Portable Cement Mixer if (CalamityServerConfig.Instance.FasterTilePlacement) @@ -4087,7 +4115,7 @@ namespace CalamityMod.CalPlayer if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && absorber) Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType(), 0, 0, Player.whoAmI); - if (snowman) + if (Player.Transformation().Type == ModContent.ItemType()) { if (Player.whoAmI == Main.myPlayer && !snowmanNoseless) Player.AddBuff(BuffType(), 60, true); @@ -4363,15 +4391,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { float baseRecoveryRate = Main.expertMode ? BalancingConstants.LifeStealRecoveryRate_Expert : BalancingConstants.LifeStealRecoveryRate_Classic; - - float lifeStealRecoveryRateReduction = - CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death : - CalamityWorld.revenge ? BalancingConstants.LifeStealRecoveryRateReduction_Revengeance : - Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : - BalancingConstants.LifeStealRecoveryRateReduction_Classic; - - if (Main.masterMode) - lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master; + float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic; float lifeStealRecoveryRate = baseRecoveryRate - lifeStealRecoveryRateReduction; if (Player.lifeSteal < -lifeStealRecoveryRate) @@ -4463,7 +4483,8 @@ namespace CalamityMod.CalPlayer 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) + @@ -4484,7 +4505,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) + @@ -4514,6 +4536,12 @@ namespace CalamityMod.CalPlayer else momentumCapacitorBoost = 0f; + if (victideBarrierHead) + { + Player.runAcceleration *= VictideHeadBarrier.RunAccelerationMult; + Player.runSlowdown *= VictideHeadBarrier.RunAccelerationMult; + } + Player.runAcceleration *= runAccMult; Player.maxRunSpeed *= runSpeedMult; } @@ -4592,20 +4620,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 @@ -4619,7 +4638,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; } @@ -4781,10 +4800,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); @@ -4896,37 +4915,6 @@ namespace CalamityMod.CalPlayer && Player.armor[1].type == ModContent.ItemType() && Player.armor[2].type == ModContent.ItemType()) snowRuffianSet = true; - - // Accessories - for (int i = 3; i < 8; i++) - { - Item vanity = Player.armor[i]; - - if (vanity.type == ModContent.ItemType()) - Player.GetModPlayer().transformationActive = true; - if (vanity.type == ModContent.ItemType()) - abyssalDivingSuitForce = true; - if (vanity.type == ModContent.ItemType()) - aquaticHeartForce = true; - if (vanity.type == ModContent.ItemType()) - ghostBracelet = true; - if (vanity.type == ModContent.ItemType()) - Player.GetModPlayer().vanityEquipped = true; - if (vanity.type == ModContent.ItemType()) - Player.GetModPlayer().vanityEquipped = true; - if (vanity.type == ModContent.ItemType()) - snowmanForce = true; - if (vanity.type == ModContent.ItemType()) - profanedCrystalForce = true; - if (vanity.type == ModContent.ItemType()) - punchCard = true; - if (vanity.type == ModContent.ItemType()) - Player.GetModPlayer().vanityEquipped = true; - if (vanity.type == ModContent.ItemType()) - Player.GetModPlayer().vanityEquipped = true; - if (vanity.type == ModContent.ItemType()) - Player.GetModPlayer().vanityEquipped = true; - } } if (Player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot || @@ -4934,58 +4922,8 @@ namespace CalamityMod.CalPlayer { Player.head = EquipLoader.GetEquipSlot(Mod, "HeadlessEquipTexture", EquipType.Head); // To make the head invisible on the map. The map was having a hissy fit because of hitbox changes. } - else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightLegs", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightHead", EquipType.Head); - Player.wings = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightWings", EquipType.Wings); - Player.face = -1; - - bool enrage = pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged; - - if (profanedCrystalWingCounter.Value == 0) - { - int key = profanedCrystalWingCounter.Key; - profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 8); - } - - Player.wingFrame = profanedCrystalWingCounter.Key; - profanedCrystalWingCounter = new KeyValuePair(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1); - Player.armorEffectDrawOutlines = true; - if (profanedCrystalBuffs) - { - Player.armorEffectDrawShadow = true; - if (enrage) - { - Player.armorEffectDrawOutlinesForbidden = true; - } - } - } - else if ((snowmanPower || snowmanForce) && !snowmanHide) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head); - Player.face = -1; - } else if (AresExoskeleton.ArmExists(Player)) Player.body = EquipLoader.GetEquipSlot(Mod, "AresExoskeleton", EquipType.Body); - - else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Head); - Player.face = -1; - } - else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Head); - Player.face = -1; - } else if (meldTransformationPower || meldTransformationForce) { Player.legs = EquipLoader.GetEquipSlot(Mod, "MeldTransformation", EquipType.Legs); @@ -5000,26 +4938,7 @@ namespace CalamityMod.CalPlayer if (hasOmegaBlueCooldown && cd.timeLeft > 1500) Player.head = EquipLoader.GetEquipSlot(Mod, "OmegaBlueTransformation", EquipType.Head); } - else - { - if (profanedCrystalWingCounter.Key != 1) - profanedCrystalWingCounter = new KeyValuePair(1, 7); - if (profanedCrystalAnimCounter.Key != 0) - profanedCrystalAnimCounter = new KeyValuePair(0, 10); - } - if (ghostBracelet) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head); - } - if (punchCard) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Head); - } if (snowRuffianSet) { @@ -5029,7 +4948,7 @@ namespace CalamityMod.CalPlayer { if (!Player.mount.Active) { - Player.velocity.Y *= 0.9f; + Player.velocity.Y *= SnowRuffianMask.GlideFallSpeedMult; Player.wingFrame = 3; } Player.noFallDmg = true; @@ -5317,7 +5236,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 }); } @@ -5617,60 +5536,6 @@ namespace CalamityMod.CalPlayer } } - private bool IsValidTransitionFrame(AnimationType currentAnim, AnimationType newAnim, int frame, int counter) //this exists so it doesn't loop through the entire walk/idle anim just to find one frame for switching. - { - bool result = newAnim != AnimationType.Jump && currentAnim != AnimationType.Jump; - if (currentAnim == AnimationType.Walk && newAnim == AnimationType.Idle) - { - result = counter <= 0 && (frame == 11 || frame == 15 || frame == 19); - } - else if (currentAnim == AnimationType.Idle && newAnim == AnimationType.Walk) - { - result = counter <= 0 && (frame == 2 || frame == 6); - } - return currentAnim != newAnim && result; //swapping to jumps should be instant, no need to check the counter here - } - - private int HandlePSCAnimationFrames(AnimationType newType) - { - int key = profanedCrystalAnimCounter.Key; //0-based indexing - int value = profanedCrystalAnimCounter.Value - 1; - AnimationType currentType = key < 8 ? AnimationType.Idle : key == 8 ? AnimationType.Jump : AnimationType.Walk; - - bool isInvalidTransFrame = !IsValidTransitionFrame(currentType, newType, key, value); //to make the transition between walk and idle frames less jarring and smoother - AnimationType type = isInvalidTransFrame ? newType : currentType; - int frameCount = type == AnimationType.Walk || (!profanedCrystalForce && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 7 : 10; - int lowerRange = type == AnimationType.Idle ? 0 : type == AnimationType.Jump ? 8 : 9; - int upperRange = type == AnimationType.Idle ? 7 : type == AnimationType.Jump ? 8 : 22; - if (value <= 0 || !isInvalidTransFrame) - { - value = frameCount; - if (key >= lowerRange && key < upperRange) - key++; - else - key = lowerRange; - } - profanedCrystalAnimCounter = new KeyValuePair(key, value); - return profanedCrystalAnimCounter.Key; - } - - public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs - { - bool validEquipSlot = Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) || - Player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs); - if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && validEquipSlot) - { - bool usingCarpet = Player.carpetTime > 0 && Player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground - AnimationType animType = AnimationType.Walk; - if ((Player.sliding || Player.velocity.Y != 0 || Player.mount.Active || (Player.grappling[0] != -1 || !Player.CheckSolidGround()) || Player.GoingDownWithGrapple) && !usingCarpet) - animType = AnimationType.Jump; - else if (Player.velocity.X == 0 || usingCarpet) - animType = AnimationType.Idle; - int frame = HandlePSCAnimationFrames(animType); - Player.legFrame.Y = Player.legFrame.Height * frame; - } - } - #endregion #region Misc Stuff diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index b5470a17e4..0f4858dc98 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) { @@ -199,10 +207,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,7 +219,7 @@ 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 @@ -230,26 +238,17 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.eutrophication && drawInfo.shadow == 0f) Eutrophication.DrawEffects(drawInfo); - if (calamityPlayer.gState && drawInfo.shadow == 0f) - { - // These lines cannot be moved to Glacial State's own file - r *= 0.13f; - g *= 0.66f; - - GlacialState.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 @@ -269,10 +268,10 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.nightwither && drawInfo.shadow == 0f) // Looks weaker if you have Moon Stone equipped Nightwither.DrawEffects(drawInfo, reducedNightwitherDamage); - 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) @@ -328,7 +327,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)) { @@ -451,52 +450,6 @@ namespace CalamityMod.CalPlayer Player drawPlayer = drawInfo.drawPlayer; Item item = drawPlayer.ActiveItem(); - // Vanity accessory effects, allows them to draw while the game is paused - if (drawPlayer.Calamity().ghostBracelet) - { - drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs); - drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body); - drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head); - } - else if ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide) - { - drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Legs); - drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Body); - drawPlayer.head = EquipLoader.GetEquipSlot(Mod, snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head); - drawPlayer.face = -1; - } - else if (drawPlayer.Calamity().punchCard) - { - drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Legs); - drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Body); - drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Head); - } - else if ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide) - { - drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs); - drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Body); - drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Head); - drawPlayer.face = -1; - } - else if ((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide) - { - drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Legs); - drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Body); - drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Head); - drawPlayer.face = -1; - } - // Need to set all of these so that certain vanity pieces like Capricorn Tail don't screw it up - if (drawPlayer.Calamity().ghostBracelet || ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide) || - drawPlayer.Calamity().punchCard || ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide) || - ((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide)) - { - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.bodyGlowMask = -1; - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - if (!drawPlayer.frozen && (item.IsAir || item.type > ItemID.None) && !drawPlayer.dead && diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index c965b451ff..870e37d592 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -169,6 +169,8 @@ namespace CalamityMod.CalPlayer if (canSulphurFish && bait == ModContent.ItemType() && !BossRushEvent.BossRushActive) { CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType(), bait); + itemDrop = -1; + return; } // Ignore catches if it's junk @@ -370,7 +372,7 @@ namespace CalamityMod.CalPlayer if (ZoneAbyss || ZoneSulphur) canSulphurFish = true; - Item item = Player.ActiveItem(); + Item item = Player.HeldItem; if (!canSulphurFish || item.fishingPole <= 0 || item.holdStyle != 1) fishingLevel = -1; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 51a94a1d11..4241bf5930 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -17,6 +17,8 @@ using CalamityMod.Items.Armor.Aerospec; using CalamityMod.Items.Armor.Demonshade; using CalamityMod.Items.Armor.LunicCorps; 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 +33,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 +247,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 +295,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; @@ -377,7 +380,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 +411,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 +427,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 +447,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)); } @@ -485,7 +488,7 @@ namespace CalamityMod.CalPlayer damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").ToNetworkText(Player.name)); } } - if (profanedCrystalBuffs && !profanedCrystalHide) + if (profanedCrystalBuffs && Player.Transformation().Type == ModContent.ItemType()) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProfanedSoulCrystal").ToNetworkText(Player.name)); } @@ -635,11 +638,6 @@ namespace CalamityMod.CalPlayer modifiers.ScalingBonusDamage += Screwdriver.PiercingDamageBuff; } - // Calamity buffs Inferno Fork by 20%. This is multiplicative because it's supposed to be a buff to the weapon's base damage. - // However, because the weapon is coded like spaghetti, you have to multiply the explosion's damage too. - if (proj.type == ProjectileID.InfernoFriendlyBlast) - modifiers.SourceDamage *= 1.2f; - if (Player.Calamity().scionsCurio && proj.CountsAsClass()) target.Calamity().scionsCurioEffected = true; @@ -708,7 +706,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; } } @@ -723,7 +721,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) @@ -738,7 +736,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) @@ -751,9 +749,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) @@ -766,9 +764,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) @@ -781,9 +779,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) @@ -814,7 +812,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) @@ -879,13 +877,13 @@ 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; // Contact damage reduction is reduced by DR Damage, which itself is proportional to defense damage - // In GFB, as defense damage is uncapped, DR damage is also uncapped. + // In FTW, as defense damage is uncapped, DR damage is also uncapped. int currentDefense = Player.GetCurrentDefense(false); if (totalDefenseDamage > 0 && currentDefense > 0) { @@ -918,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); @@ -987,30 +985,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) || @@ -1027,7 +1018,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. @@ -1042,11 +1033,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; } @@ -1065,7 +1055,7 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.25; } - 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) { // Daedalus Reflect counts as a reflect but doesn't actually stop you from taking damage if (daedalusReflect && !disableAllDodges && !evolution && !Player.HasCooldown(GlobalDodge.ID)) @@ -1146,7 +1136,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; @@ -1312,7 +1302,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; } @@ -1375,90 +1365,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); @@ -1471,10 +1381,51 @@ namespace CalamityMod.CalPlayer { Player.AddBuff(ModContent.BuffType(), 600); } + + if (CalamityWorld.revenge) + { + 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.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); + } + } } // 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) + if (!CalamityProjectileSets.ShouldNotBeReflected[proj.type] && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0 && !hurtInfo.PvP) { double dodgeDamageGateValuePercent = 0.05; int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent); @@ -1750,11 +1701,17 @@ namespace CalamityMod.CalPlayer // Handles energy shields and Boss Rush, in that order modifiers.ModifyHurtInfo += ModifyHurtInfo_Calamity; - // TODO -- At some point it'd be nice to have a "TransformationPlayer" that has all the transformation sfx and visuals so their priorities can be more easily managed. #region Custom Hurt Sounds if (hurtSoundTimer == 0) { - if (roverDrive && RoverDriveShieldDurability > 0) + if(Player.Transformation().Type != -1 && Player.Transformation().currentTransformation.HurtSound(Player) != null) + { + var hurtSound = Player.Transformation().currentTransformation.HurtSound(Player).Value; + modifiers.DisableSound(); + SoundEngine.PlaySound(hurtSound.sound, Player.Center); + hurtSoundTimer = hurtSound.delay; + } + else if (roverDrive && RoverDriveShieldDurability > 0) { modifiers.DisableSound(); SoundEngine.PlaySound(RoverDrive.ShieldHurtSound, Player.Center); @@ -1772,42 +1729,12 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(TheSponge.ShieldHurtSound, Player.Center); hurtSoundTimer = 20; } - else if (((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) && pSoulShieldDurability > 0) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(ProfanedGuardianDefender.ShieldDeathSound); - hurtSoundTimer = 20; - } - else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(Providence.HurtSound, Player.Center); - hurtSoundTimer = 20; - } - else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center); //metal hit noise - hurtSoundTimer = 10; - } - else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(SoundID.FemaleHit, Player.Center); //female hit noise - hurtSoundTimer = 10; - } else if (titanHeartSet) { modifiers.DisableSound(); SoundEngine.PlaySound(NPCs.Astral.Atlas.HurtSound, Player.Center); hurtSoundTimer = 10; } - else if (Player.GetModPlayer().transformationActive) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center); - hurtSoundTimer = 10; - } else if (Player.GetModPlayer().wulfrumSet && (Player.name.ToLower() == "wagstaff" || Player.name.ToLower() == "john wulfrum")) { modifiers.DisableSound(); @@ -2304,8 +2231,8 @@ namespace CalamityMod.CalPlayer if (RageEnabled) rageCombatFrames = BalancingConstants.RageCombatDelayTime; - // Regenator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later) - if (regenator && false) + // Regenerator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later) + if (regenerator && false) { // Projectile damage and count is based on source damage of the hit float hitPower = (hurtInfo.SourceDamage / (Player.statLifeMax2 * 0.5f)); @@ -2347,6 +2274,12 @@ namespace CalamityMod.CalPlayer } } + if (victideBarrierSet && !Player.HasCooldown(WardingWave.ID)) + { + int healAmt = (int)(hurtInfo.Damage * VictideHeadBarrier.BarrierDamageAbsorptionPercent); + victideBarrierHeal += healAmt; + } + if (daedalusAbsorb && Main.rand.NextBool(10)) { int healAmt = (int)(hurtInfo.Damage / 2D); @@ -2622,13 +2555,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); } @@ -2702,15 +2635,20 @@ namespace CalamityMod.CalPlayer } if (inkBomb && !abyssalMirror && !eclipseMirror) { - var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(Cooldowns.InkBomb.ID)) + if (Player.whoAmI == Main.myPlayer) { - Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20)); - rogueStealth += 0.5f; + if (!Player.HasCooldown(Cooldowns.InkBomb.ID)) + { + Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20)); + rogueStealth += 0.5f; + SoundEngine.PlaySound(SoundID.NPCDeath28 with { Volume = 2f }, Player.Center); + } + + var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); + SoundEngine.PlaySound(SoundID.Item1, Player.Center); for (int i = 0; i < 3; i++) { - SoundEngine.PlaySound(SoundID.Item61, Player.Center); - int ink = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, Player.whoAmI); + int ink = Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 2f, ModContent.ProjectileType(), 0, 0, Player.whoAmI); if (ink.WithinBounds(Main.maxProjectiles)) Main.projectile[ink].DamageType = DamageClass.Generic; } @@ -2742,7 +2680,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { - for (int i = 0; i < 16; i++) + for (int i = 0; i < 10; i++) { Vector2 circleVel = (MathHelper.TwoPi * i / 16f).ToRotationVector2() * Main.rand.NextFloat(5f, 8f); int shard = Projectile.NewProjectile(source, Player.Center, circleVel, ProjectileID.CrystalShard, sDamage, 1f, Player.whoAmI); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 65019aed05..c56ef35904 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -97,46 +97,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, reducedDaybrokenDamage ? 20 : 40, purity); + ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 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 +191,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) @@ -331,11 +331,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 +379,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; } @@ -402,7 +402,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 +419,10 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) Player.Heal(1); - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; - intendedPurityDefense = 20 + (currentDebuffs - 1) * 8; + intendedPurityDefense = 15 + (currentDebuffs - 1) * 5; if (jewelBonusDefense < intendedPurityDefense) jewelBonusDefense = intendedPurityDefense; @@ -457,14 +457,14 @@ 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; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; - intendedJewelDefense = 16 + (currentDebuffs - 1) * 5; + intendedJewelDefense = 12 + (currentDebuffs - 1) * 4; if (jewelBonusDefense < intendedJewelDefense) jewelBonusDefense = intendedJewelDefense; } @@ -484,11 +484,11 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 2; // If any debuff is detected, provide even more life regen and massively accelerate it - if (Player.buffType.Any(DebuffsList.List.Contains)) + if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i])) { Player.lifeRegen += 3; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; } } #endregion @@ -525,7 +525,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegenCount = 0; } - if (hInferno) + if (holyInferno) { Player.nebulaLevelLife = 0; @@ -625,6 +625,9 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += Main.eclipse ? 2 : 4; } + if (silvaSet) + Player.lifeRegen += 6; + if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600) { Player.lifeRegen += PhantomicArtifact.RegenBoost; @@ -648,7 +651,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; @@ -673,8 +676,8 @@ namespace CalamityMod.CalPlayer { Player.lifeRegen += 7; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; Player.lifeRegenTime += 4; } @@ -693,23 +696,6 @@ namespace CalamityMod.CalPlayer else pinkCandleHealFraction = 0D; - if (reaverRegen && reaverRegenCooldown >= 60) - { - reaverRegenCooldown = 0; - - if (Player.statLife != Player.statLifeMax2 && !noLifeRegen) - Player.HealPlayer(1, HealTextType.None); - } - - 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; @@ -753,9 +739,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; @@ -766,48 +752,7 @@ namespace CalamityMod.CalPlayer } #endregion - // Life regen soft cap. - if (Player.statLife < actualMaxLife) - { - // The soft cap doesn't apply if the player is not moving and not using a weapon while having any of the following: - // Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Regenator, or The Camper. - int baseLifeRegenBoost = 4; - bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || camper || regenator) && - Player.StandingStill() && Player.itemAnimation == 0; - - if (!noLifeRegenCap) - { - // Calculate the % of HP the player has left. - float maxLifeRatio = Player.statLife / (float)actualMaxLife; - - // Calculate the ratio of the player's current max life relative to the starting HP of 100. - // This makes the soft cap far less harsh at lower amounts of max life. - // Ranges from 20 (at 100 max life) to 4 (at 500 max life) to 2 (at 1000 max life) to 1 (at greater than 2000 max life). - int lifeRegenSoftCapMax = 20; - int lifeRegenSoftCapMin = (int)Math.Round(100f / actualMaxLife * lifeRegenSoftCapMax); - - // The soft cap for life regen which ranges from 20 (at less than 5% HP) to 1 (at greater than or equal to 95% HP). - // This value is capped at a min and max amount. - int lifeRegenSoftCap = (int)MathHelper.Clamp((int)Math.Round((1f - maxLifeRatio) * lifeRegenSoftCapMax), lifeRegenSoftCapMin, lifeRegenSoftCapMax); - - // If life regen is greater than the calculated soft cap, reduce it. - if (Player.lifeRegen - baseLifeRegenBoost > lifeRegenSoftCap) - { - // The scalar used to calculate how much the life regen stat should be reduced by. - // Ranges from 1 (at 0% HP) to 2 (at 100% HP). - float lifeRegenScalar = 1f + maxLifeRatio; - - // Calculate the amount of life regen the player should get according to the soft cap and their current % HP remaining. - // The higher the player's % HP remaining the less life regen they get and vice versa. - int defLifeRegen = (int)((Player.lifeRegen - baseLifeRegenBoost) / lifeRegenScalar); - - // Set the player's life regen to the scaled amount. - Player.lifeRegen = baseLifeRegenBoost + defLifeRegen; - } - } - } - - if (regenator) // Gives special regen of it's own, but disables all regular life regen + 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)) Player.HealPlayer(1, HealTextType.None); @@ -818,7 +763,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegenTime += 10; } else - regenatorDamage = 0; + regeneratorDamage = 0; if (toxicHeart) // Since it needs to know your life regen, it must be placed here { @@ -873,8 +818,8 @@ namespace CalamityMod.CalPlayer } } - // Regenator trades all positive regen for damage, and caps your health gain at 50% - if (regenator) + // Regenerator trades all positive regen for damage, and caps your health gain at 50% + if (regenerator) { int finalRegen = Player.lifeRegen + (int)Math.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f)); finalRegen = (int)Math.Max(finalRegen, 0); @@ -884,8 +829,8 @@ namespace CalamityMod.CalPlayer if (Player.palladiumRegen) finalRegen += 4; - regenatorDamage = (finalRegen * 1.75f) * 0.01f; - Player.GetDamage() += regenatorDamage; + regeneratorDamage = (finalRegen * 1.75f) * 0.01f; + Player.GetDamage() += regeneratorDamage; if (Player.lifeRegen > 0) Player.lifeRegen = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index dc1d30416e..57f1bbc47c 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -17,6 +17,7 @@ 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; @@ -201,12 +202,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 +222,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 +290,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) @@ -479,13 +479,17 @@ namespace CalamityMod.CalPlayer IsFirstDashFrame = false; else IsFirstDashFrame = true; - + // THIS MUST BE NEAR THE END OF PostUpdateMiscEffects SO ALL OTHER RUN SPEED IS DONE FIRST. DO NOT PUT ANY RUN SPEED AFTER THIS - + // Multiplies movement speed by 1.5x so that you don't feel like a snail in the early game. // This applies to movement speed boosts as well as base speed to ensure they are actually worth their listed value compared to base speed + // // Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy - if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed) + // 22JUN2025: Ozzatron: Disabled while Remnants is enabled, because Remnants has its own move speed reworks. + + bool ignoreSpeedConfig = ExternalMods.overhaul is not null || ExternalMods.remnants is not null; + if (!ignoreSpeedConfig && CalamityServerConfig.Instance.FasterBaseSpeed) Player.moveSpeed *= BalancingConstants.DefaultMoveSpeedBoost; // This is used to increase horizontal velocity based on the player's movement speed stat. @@ -506,8 +510,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; } } @@ -623,7 +627,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; } } @@ -910,8 +914,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++) @@ -943,8 +950,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++) @@ -1117,34 +1128,11 @@ namespace CalamityMod.CalPlayer } } - // Life Steal nerf in difficulties above Expert - // Reduces the max possible life steal before the cooldown occurs (this mostly just nerfs how much life steal the player can get in bursts) - // Master Mode nerfs this by an additional 10 - float lifeStealCap = - CalamityWorld.death ? BalancingConstants.LifeStealCap_Death : - CalamityWorld.revenge ? BalancingConstants.LifeStealCap_Revengeance : - Main.expertMode ? BalancingConstants.LifeStealCap_Expert : - BalancingConstants.LifeStealCap_Classic; - - if (Main.masterMode) - lifeStealCap -= BalancingConstants.LifeStealCapReduction_Master; - - if (Player.lifeSteal > lifeStealCap) - Player.lifeSteal = lifeStealCap; - - // Normal Mode life steal recovery rate is 0.2/s - // Expert Mode life steal recovery rate is 0.15/s - // Revengeance Mode life steal recovery rate is 0.125/s - // Death Mode life steal recovery rate is 0.1/s - // Master Mode life steal recovery rate is nerfed by an additional 0.05/s - float lifeStealRecoveryRateReduction = - CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death : - CalamityWorld.revenge ? BalancingConstants.LifeStealRecoveryRateReduction_Revengeance : - Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : - BalancingConstants.LifeStealRecoveryRateReduction_Classic; - - if (Main.masterMode) - lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master; + // Reduce the rate of recovery of the Lifesteal variable + // Classic Mode: 36 HP/s to 12 HP/s + // Expert Mode: 30 HP/s to 9 HP/s + float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic; + float lifeStealCap = Main.expertMode ? BalancingConstants.LifeStealCap_Expert : BalancingConstants.LifeStealCap_Classic; if (Player.lifeSteal < lifeStealCap) Player.lifeSteal -= lifeStealRecoveryRateReduction; @@ -1161,7 +1149,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]--; } } @@ -1175,7 +1163,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. @@ -1196,11 +1184,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); } @@ -1222,7 +1210,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), 2, false); } } - if (iCantBreathe) + if (frozenLungs) { if (Player.breath > 0 && Player.miscCounter % 2 == 0) Player.breath--; @@ -1312,18 +1300,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) @@ -1344,10 +1330,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; } @@ -1549,11 +1531,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--; @@ -1825,7 +1805,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--; @@ -1891,6 +1871,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) { @@ -2012,7 +2027,7 @@ namespace CalamityMod.CalPlayer SyncCooldownRemoval(Main.dedServ, expiredCooldowns); // Grant the player 5 seconds of immunity to immobilizing debuffs after an immobilizing debuff wears off. - if (Player.stoned || Player.frozen || Player.webbed || gState) + if (Player.stoned || Player.frozen || Player.webbed) { ImmobilityDebuffImmunityTimer = ImmobilityDebuffImmunityTimerMax; } @@ -2022,7 +2037,6 @@ namespace CalamityMod.CalPlayer Player.buffImmune[BuffID.Stoned] = true; Player.buffImmune[BuffID.Frozen] = true; Player.buffImmune[BuffID.Webbed] = true; - Player.buffImmune[ModContent.BuffType()] = true; } if (arsenalCooldown > 0) @@ -2047,14 +2061,14 @@ namespace CalamityMod.CalPlayer --fullRageSoundCountdownTimer; if (plagueTaintedSMGDroneCooldown > 0) plagueTaintedSMGDroneCooldown--; + if (flareGunOverheat > 0) + flareGunOverheat--; if (momentumCapacitorTime > 0) --momentumCapacitorTime; if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000) phantomicHeartRegen--; if (phantomicBulwarkCooldown > 0) phantomicBulwarkCooldown--; - if (KameiBladeUseDelay > 0) - KameiBladeUseDelay--; if (galileoCooldown > 0) galileoCooldown--; if (gladiatorTimer > 0) @@ -2096,15 +2110,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) @@ -2115,22 +2141,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; @@ -2156,13 +2176,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) @@ -2227,10 +2240,6 @@ namespace CalamityMod.CalPlayer canFireGodSlayerRangedProjectile = true; canFireBloodflareRangedProjectile = true; } - if (reaverRegenCooldown < 60 && reaverRegen) - reaverRegenCooldown++; - else - reaverRegenCooldown = 0; if (auralisAurora > 0) auralisAurora--; if (auralisAuroraCooldown > 0) @@ -2319,8 +2328,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 @@ -2391,8 +2402,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; @@ -2471,8 +2485,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; } } @@ -2521,6 +2534,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; @@ -2540,7 +2564,7 @@ namespace CalamityMod.CalPlayer if (Player.isNearFairy()) { Player.lifeRegen += 4; - Player.statDefense += 10; + Player.statDefense += 6; Player.moveSpeed += 0.1f; } } @@ -2564,7 +2588,7 @@ namespace CalamityMod.CalPlayer if (affliction || afflicted) { Player.endurance += 0.07f; - Player.statDefense += 13; + Player.statDefense += 9; Player.GetDamage() += 0.1f; } @@ -2604,7 +2628,7 @@ namespace CalamityMod.CalPlayer // Permafrost's Concoction bonuses/debuffs if (permafrostsConcoction) { - Player.manaCost *= 0.85f; + Player.manaCost -= 0.15f; Player.statManaMax2 += 50; } @@ -2621,7 +2645,6 @@ namespace CalamityMod.CalPlayer Player.buffImmune[BuffID.Frozen] = true; Player.buffImmune[BuffID.Chilled] = true; - Player.buffImmune[ModContent.BuffType()] = true; } // Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff @@ -2734,23 +2757,19 @@ namespace CalamityMod.CalPlayer // Plagued Fuel Pack and Blunder Booster effects if (jetPackDash > 0 && Player.whoAmI == Main.myPlayer) { - int velocityAmt = blunderBooster ? 35 : 25; - int velocityMult = jetPackDash > 1 ? velocityAmt : 5; - Player.velocity = new Vector2(jetPackDirection, -1) * velocityMult; + int velocityMult = (int)((blunderBooster ? 35 : 25) * Utils.GetLerpValue(-4, 5, jetPackDash, true)); + Player.velocity = new Vector2(jetPackDirection, -1f) * velocityMult; if (blunderBooster) { - int lightningCount = Main.rand.Next(5, 7); + int lightningCount = 4; var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); for (int i = 0; i < lightningCount; i++) { - Vector2 lightningVel = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); - lightningVel.Normalize(); - lightningVel *= Main.rand.NextFloat(1f, 2f); - int damage = (int)Player.GetTotalDamage().ApplyTo(30); + Vector2 lightningVel = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(7f, 10f); + int damage = (int)Player.GetTotalDamage().ApplyTo(35); int projectile = Projectile.NewProjectile(source, Player.Center, lightningVel, ModContent.ProjectileType(), damage, 0, Player.whoAmI, Main.rand.Next(2), 0f); - Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -2765,17 +2784,14 @@ namespace CalamityMod.CalPlayer } else if (plaguedFuelPack) { - int numClouds = Main.rand.Next(8, 10); + int numClouds = 3; var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); for (int i = 0; i < numClouds; i++) { - Vector2 cloudVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); - cloudVelocity.Normalize(); - cloudVelocity *= Main.rand.NextFloat(0f, 1f); - int damage = (int)Player.GetTotalDamage().ApplyTo(20); + Vector2 cloudVelocity = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(5f, 7f); + int damage = (int)Player.GetTotalDamage().ApplyTo(30); int projectile = Projectile.NewProjectile(source, Player.Center, cloudVelocity, ModContent.ProjectileType(), damage, 0, Player.whoAmI, 0, 0); - Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -2802,7 +2818,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) { @@ -2955,36 +2971,7 @@ namespace CalamityMod.CalPlayer } // Breath lost while at zero breath - double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D) : (point.Y > abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D); - - // Breath Loss Multiplier, depending on gear - // 27AUG2024: Ozzatron: fixed this being subtractive like mining speed. now doesn't stack exponentially - // It is now a multiplier for the time it takes to lose any unit amount of breath - double breathLossTimeMult = 1D + - (Player.gills ? 0.2 : 0D) + // 1.2 - (oceanCrest ? 0.2 : 0D) + // 1.2 - (victideSet ? 0.2 : 0D) + // 1.2 - (Player.accDivingHelm ? 0.25 : 0D) + // 1.25 - (Player.arcticDivingGear ? 0.25 : 0D) + // 1.25 - (aquaticEmblem ? 0.25 : 0D) + // 1.25 - (Player.accMerman ? 0.3 : 0D) + // 1.3 - (reaverExplore ? 0.3 : 0D) + // 1.3 - ((aquaticHeart && NPC.downedBoss3) ? 0.3 : 0D) + // 1.3 - (abyssalDivingSuit ? 0.3 : 0D) + // 1.3 - externalBreathLossMultBoost; - - // Invert the breath loss time multiplier, to get the multiplier for the speed at which breath is actually lost - double breathLossMult = 1D / breathLossTimeMult; - - // Limit the multiplier to 5% - if (breathLossMult < 0.05) - breathLossMult = 0.05; - - // Reduce breath lost while at zero breath, depending on gear - breathLoss *= breathLossTimeMult; - - // Record the final breath loss for the stat meter - abyssBreathLossStat = (float)breathLoss; + double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 1D : 0D) : (point.Y > abyssLevel1 ? 1D : 0D); // Defense loss int defenseLoss = (int)(120D * depthRatio); @@ -3005,24 +2992,8 @@ namespace CalamityMod.CalPlayer // Record the final defense reduction for the stat meter abyssDefenseLossStat = defenseLoss; - // Bleed effect based on abyss layer - if (ZoneAbyssLayer4) - { - Player.bleed = true; - } - else if (ZoneAbyssLayer3) - { - if (!abyssalDivingSuit) - Player.bleed = true; - } - else if (ZoneAbyssLayer2) - { - if (!depthCharm) - Player.bleed = true; - } - // Ticks (frames) until breath is deducted from the breath meter - double tick = 12D * (1D - depthRatio); + double tick = 10D * (1D - depthRatio); // Prevent 0 if (tick < 1D) @@ -3030,16 +3001,16 @@ namespace CalamityMod.CalPlayer // Tick (frame) multiplier, depending on gear double tickMult = 1D + - (Player.gills ? 4D : 0D) + // 5 - (oceanCrest ? 4D : 0D) + // 5 - (Player.ignoreWater ? 5D : 0D) + // 10 - (Player.accDivingHelm ? 10D : 0D) + // 20 - (Player.arcticDivingGear ? 10D : 0D) + // 30 - (aquaticEmblem ? 10D : 0D) + // 40 - (Player.accMerman ? 15D : 0D) + // 55 - (victideSet ? 5D : 0D) + // 60 - ((aquaticHeart && NPC.downedBoss3) ? 15D : 0D) + // 75 - (abyssalDivingSuit ? 15D : 0D) + // 90 + (Player.gills ? 2D : 0D) + + (oceanCrest ? 2D : 0D) + + (Player.ignoreWater ? 3D : 0D) + + (Player.accDivingHelm ? 5D : 0D) + + (Player.arcticDivingGear ? 5D : 0D) + + (aquaticEmblem ? 5D : 0D) + + (Player.accMerman ? 8D : 0D) + + (victideBurrowHead ? 2D : 0D) + + ((aquaticHeart && NPC.downedBoss3) ? 8D : 0D) + + (abyssalDivingSuit ? 8D : 0D) + externalBreathTickBoost; // Limit the multiplier to 50 @@ -3053,6 +3024,8 @@ namespace CalamityMod.CalPlayer abyssBreathLossRateStat = (float)tick; float resistanceSlowdownFactor = 1f; + if (hadopelagicPressure) + resistanceSlowdownFactor -= abyssalDivingSuit ? 0.2f : 0.5f; // Reduce breath over ticks (frames) abyssBreathCD++; @@ -3064,17 +3037,14 @@ namespace CalamityMod.CalPlayer // Reduce breath if (Player.breath > 0) { - Player.breath -= (int)(cDepth && !depthCharm ? breathLoss + 1D : breathLoss); - - if (hPressure) - resistanceSlowdownFactor -= (int)(!abyssalDivingSuit ? 1.2f : 0.5f); + Player.breath -= (int)(crushDepth && !depthCharm ? breathLoss + 1D : breathLoss); } } // If breath is greater than 0 and player has gills or is merfolk, balance out the effects by reducing breath if (Player.breath > 0) { - if (Player.gills || Player.merman) + if (Player.gills || Player.merman || Player.accMerman) Player.breath -= 3; } @@ -3083,8 +3053,8 @@ namespace CalamityMod.CalPlayer // Resistance to life loss at zero breath int lifeLossAtZeroBreathResist = 0 + - (depthCharm ? 3 : 0) + - (abyssalDivingSuit ? 6 : 0); + (depthCharm ? 4 : 0) + + (abyssalDivingSuit ? 5 : 0); // Reduce life loss, depending on gear lifeLossAtZeroBreath -= lifeLossAtZeroBreathResist; @@ -3117,7 +3087,7 @@ namespace CalamityMod.CalPlayer abyssDeath = false; // Signus headcrab darkness - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { if (CalamityGlobalNPC.signus != -1) { @@ -3208,7 +3178,7 @@ namespace CalamityMod.CalPlayer // Aquatic Emblem bonus if (aquaticEmblem) { - if (Player.IsUnderwater() && Player.wet && !Player.lavaWet && !Player.honeyWet && + if (countsAsAnyWet && !Player.lavaWet && !Player.honeyWet && !Player.mount.Active) { if (aquaticBoost > 0f) @@ -3225,17 +3195,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)) { @@ -3363,12 +3333,12 @@ namespace CalamityMod.CalPlayer if (AdamantiteSet) Player.statDefense += AdamantiteSetDefenseBoost; - // Warmth makes Chilled, Frozen, and Glacial State tick down 3x as fast + // Warmth makes Chilled and Frozen tick down 3x as fast if (Player.HasBuff(BuffID.Warmth)) { for (int b = 0; b < Player.MaxBuffs; b++) { - if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen || Player.buffType[b] == ModContent.BuffType()) + if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen) { if (Player.buffTime[b] > 3) { @@ -3408,11 +3378,6 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += Grax.DamageBoost; } - if (brutalCarnage) - { - Player.GetDamage() += BrutalCarnage.MeleeDamageBoost; - } - // Trinket of Chi bonus if (trinketOfChi) { @@ -3430,7 +3395,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) @@ -3477,7 +3442,7 @@ namespace CalamityMod.CalPlayer if (tortShellPostHit > 0) { - Player.statDefense -= 8; + Player.statDefense -= 6; tortShellPostHit--; } else @@ -3595,7 +3560,7 @@ namespace CalamityMod.CalPlayer if (starBeamRye) { Player.GetDamage() += StarBeamRye.MagicDamageBoost; - Player.manaCost *= (1f - StarBeamRye.ManaCostReduction); + Player.manaCost -= StarBeamRye.ManaCostReduction; Player.statManaMax2 += StarBeamRye.MaxManaBoost; } @@ -3626,7 +3591,7 @@ namespace CalamityMod.CalPlayer } } - if (HighTestFishingPoleList.Includes(Player.ActiveItem().type)) + if (CalamityItemSets.FishingPoleThatNeverBreaks[Player.ActiveItem().type]) Player.accFishingLine = true; if (planarSpeedBoost != 0) @@ -3733,24 +3698,12 @@ namespace CalamityMod.CalPlayer } if (tarraSet) - { - if (!tarraMelee) - Player.calmed = true; Player.lifeMagnet = true; - } - if (wDeath && !laudanum && !purity) + if (whisperingDeath && !laudanum && !purity) Player.GetDamage() -= 0.2f; - if (astralInfection && !(infectedJewel || hideOfDeus || purity)) - Player.GetDamage() -= 0.1f; - - if (pFlames && !purity) - { - Player.GetDamage() -= 0.1f; - } - - if (aCrunch && !laudanum && !purity) + if (armorCrunch && !laudanum && !purity) { Player.statDefense -= ArmorCrunch.DefenseReduction; Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer; @@ -3761,14 +3714,6 @@ namespace CalamityMod.CalPlayer Player.statDefense -= RemsRevenge.WitherDefenseReduction; } - if (gState) - { - Player.velocity.X *= 0.5f; - Player.velocity.Y += 0.05f; - if (Player.velocity.Y > 15f) - Player.velocity.Y = 15f; - } - if (eutrophication && !purity) Player.velocity = Vector2.Zero; @@ -3820,11 +3765,17 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += 0.1f; } + // While making the rogue update verify if we should allow these to stack again - Shade if (filthyGlove) { bonusStealthDamage += nanotech ? 0.05f : 0.08f; } + if (rottenDogTooth && !nanotech) + { + bonusStealthDamage += 0.08f; + } + if (sandsWindBuff) { Player.GetDamage() += PrimordialEarth.BuffDamageBoost; @@ -3850,7 +3801,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) @@ -4071,7 +4022,7 @@ namespace CalamityMod.CalPlayer if (eArtifact) { - Player.manaCost *= 0.75f; + Player.manaCost -= 0.25f; Player.maxMinions++; } @@ -4412,7 +4363,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) { @@ -4429,7 +4380,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; } } @@ -4477,7 +4428,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; @@ -4495,7 +4446,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: @@ -4504,7 +4455,7 @@ namespace CalamityMod.CalPlayer break; case BuffID.Confused: Player.confused = false; - Player.statDefense += 50; + Player.statDefense += 15; break; case BuffID.Cursed: Player.cursed = false; @@ -4922,7 +4873,7 @@ namespace CalamityMod.CalPlayer } if (DesertProwlerHat.ShroudedInSmoke(Player, out _)) - Player.statDefense -= (int)(Player.statDefense * 0.75); + Player.statDefense -= (int)(Player.statDefense * DesertProwlerHat.SmokeDefenseMult); } #endregion diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 31b9ec0761..30f3e9fa18 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -8,7 +8,13 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Cooldowns; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor; +using CalamityMod.Items.Armor.Astral; 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; @@ -103,7 +109,7 @@ namespace CalamityMod.CalPlayer break; case ItemID.FieryGreatsword: - target.AddBuff(BuffID.OnFire3, 180); + target.AddBuff(BuffID.OnFire3, 90); break; case ItemID.IceSickle: @@ -138,7 +144,7 @@ namespace CalamityMod.CalPlayer ItemLifesteal(target, item, damageDone); ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy); - NPCDebuffs(target, item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass()); + NPCDebuffs(target, item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), hit.Crit); // Ursa Sergeant slash cooldown is reset on kill if (ursaSergeant && target.life <= 0 && target.realLife == -1) @@ -193,13 +199,14 @@ namespace CalamityMod.CalPlayer // Arc Flash Ring lightning strike (Remember to change the one for projectile hits if applicable when you change this one!) // This one has a lot less limits than the projectile one, but that's because vanilla broadsword code is limiting (wow so surprising) - if (arcFlashRing && (Main.rand.Next(0, 100) < 6)) + bool spawnChance = (Main.rand.Next(0, 100) < 6); + if (arcFlashRing && spawnChance) { var source = item.GetSource_FromThis(); - int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits) - Vector2 position = target.Center + new Vector2(0, -750); + int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline) - Projectile.NewProjectile(source, position, new Vector2(0, 10), ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI); + Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI); + bolt.DamageType = hit.DamageType; } // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). @@ -233,25 +240,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) { @@ -396,27 +390,25 @@ namespace CalamityMod.CalPlayer CalamityGlobalProjectile globalProj = proj.Calamity(); // Arc Flash Ring lightning strike (Remember to change the one for item hits if applicable when you change this one!) - // Minions ignore the chance penalty on penetration - bool spawnChance = (Main.rand.Next(0, 100) < MathHelper.Clamp(6 - proj.numHits, (proj.minion ? 6 : 1), 6)); - if (arcFlashRing && spawnChance && proj.type != ProjectileType() && globalProj.spawnArcFlash) + bool spawnChance = (Main.rand.Next(0, 100) < 6); + if (arcFlashRing && spawnChance && proj.type != ProjectileType()) { proj.active = true; // Okay so if a projectile manually kills itself on hit, it totally breaks the bolts. to prevent this we set them to active var source = proj.GetSource_FromThis(); - int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits) - Vector2 position = target.Center + new Vector2(0, -750); + int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline) - Projectile bolt = Projectile.NewProjectileDirect(source, position, new Vector2(0, 10), ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI); + Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI, (globalProj.showArcFlash ? 0 : 1)); bolt.DamageType = hit.DamageType; - globalProj.spawnArcFlash = false; - // This is really only used for long lasting projectiles and contact damage minions - globalProj.arcFlashCooldown = 90; + globalProj.showArcFlash = false; + // This is really only used for piercing and long lasting projectiles so they dont flood the screen with bolts + globalProj.arcFlashCooldown = 30; } if (!proj.npcProj && !proj.trap && proj.friendly) { - if (plaguebringerCarapace && FriendlyBeesList.Includes(proj.type)) + if (plaguebringerCarapace && CalamityProjectileSets.IsFriendlyBeeProjectile[proj.type]) target.AddBuff(BuffType(), 300); // All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile @@ -574,11 +566,7 @@ namespace CalamityMod.CalPlayer GeneralParticleHandler.SpawnParticle(orb); } - int heal = (int)Math.Round(hit.Damage * 0.035); - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(hit.Damage * 0.035)); } if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0) @@ -594,13 +582,9 @@ namespace CalamityMod.CalPlayer GeneralParticleHandler.SpawnParticle(orb); } - int heal = (int)Math.Round(hit.Damage * 0.01); - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - for (int i = 0; i <= 2; i++) { - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(hit.Damage * 0.01), 0.75f); } } @@ -608,7 +592,7 @@ namespace CalamityMod.CalPlayer ProjLifesteal(target, proj, damageDone, hit.Crit); ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false), targetIsDummy); - NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), true, proj.noEnchantments); + NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), hit.Crit, true, proj.noEnchantments); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). if (targetIsDummy) @@ -627,9 +611,6 @@ namespace CalamityMod.CalPlayer if (!item.CountsAsClass() && Player.meleeEnchant == 7) Projectile.NewProjectile(source, position, Player.velocity, ProjectileID.ConfettiMelee, 0, 0f, Player.whoAmI); - if (reaverDefense) - Player.lifeRegenTime += 1; - if (npcCheck) { if (item.CountsAsClass() && hideOfDeus && hideOfDeusTimer == 0) @@ -642,7 +623,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[] @@ -653,7 +634,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)) @@ -708,14 +689,11 @@ namespace CalamityMod.CalPlayer if (theBee && lifeAndShieldCondition) SoundEngine.PlaySound(SoundID.Item110, proj.Center); - if (reaverDefense) - Player.lifeRegenTime += 1; - if (npcCheck) { 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[] @@ -726,7 +704,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,8 +816,9 @@ namespace CalamityMod.CalPlayer if (dynamoStemCells && MiniSwarmerCooldown <= 0 && proj.CountsAsClass()) { MiniSwarmerCooldown = DynamoStemCells.MiniSwarmerCooldown; - - Vector2 velocity = proj.velocity.SafeNormalize(Vector2.UnitY) * 19; + Vector2 directionToMouse = Main.MouseWorld - Player.Center; + directionToMouse.Normalize(); + Vector2 velocity = directionToMouse * 19; int MiniSwamerDamage = (int)Player.GetTotalDamage().ApplyTo(DynamoStemCells.MiniSwamerDamage); Projectile.NewProjectile(source, Player.Center, velocity, ProjectileType(), MiniSwamerDamage, 2f, proj.owner); } @@ -1127,30 +1106,28 @@ namespace CalamityMod.CalPlayer if (forbiddenCirclet && modProj.stealthStrike && forbiddenCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { - for (int index2 = 0; index2 < 6; index2++) + for (int index2 = 0; index2 < ForbiddenCirclet.EaterSpawnCount; 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); + float xVector = Main.rand.NextFloat(-7f, 7f); + float yVector = Main.rand.NextFloat(-7f, 7f); + int damage = (int)Player.GetTotalDamage().ApplyTo(ForbiddenCirclet.EaterDamage); 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; + forbiddenCooldown = ForbiddenCirclet.EaterSpawnCooldown; } } 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); - for (int dustexplode = 0; dustexplode < 180; dustexplode++) + for (int dustexplode = 0; dustexplode < 120; dustexplode++) { - Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 2)) * 1.7f; + Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 3)) * 1.7f; Dust dust = Dust.NewDustPerfect(proj.Center, Main.rand.NextBool() ? DustType() : DustType(), dustd, Alpha: 100); dust.noGravity = true; } @@ -1160,6 +1137,7 @@ namespace CalamityMod.CalPlayer if (raiderTalisman && modProj.stealthStrike) { raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown); + // TO DO: Add nanotech here Player.AddCooldown(RaiderBoost.ID, raiderCritLifespan, true, vampiricTalisman ? "Bloodfeast" : "default"); if (raiderSoundCooldown <= 0) { @@ -1173,9 +1151,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) @@ -1200,7 +1176,7 @@ namespace CalamityMod.CalPlayer #endregion #region Debuffs - public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool proj = false, bool noFlask = false) + public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool crit, bool proj = false, bool noFlask = false) { if (melee && !noFlask) // Prevents Deep Sea Dumbell from snagging true melee debuff memes { @@ -1256,7 +1232,7 @@ namespace CalamityMod.CalPlayer } if (titanHeartMask) { - target.AddBuff(BuffType(), 120); + target.AddBuff(BuffType(), TitanHeartMask.OnHitDebuffDuration); } } if (summon) @@ -1306,8 +1282,8 @@ namespace CalamityMod.CalPlayer if (omegaBlueChestplate) target.AddBuff(BuffType(), 180); if (sulphurSet) - target.AddBuff(BuffID.Poisoned, 60); - if (ilSpark && Player.IsUnderwater()) + target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); + if (ilSpark && Player.Calamity().countsAsAnyWet) { int duration = 60; target.AddBuff(BuffType(), duration); @@ -1322,7 +1298,11 @@ namespace CalamityMod.CalPlayer } if (vexation) { - target.AddBuff(BuffID.Venom, 120, false); + target.AddBuff(BuffID.Venom, 120, false); + } + if (snowRuffianSet && ranged && crit) + { + target.AddBuff(BuffID.Frostburn, SnowRuffianMask.SetBonusFrostburnDuration, false); } } #endregion @@ -1331,148 +1311,56 @@ namespace CalamityMod.CalPlayer public void ProjLifesteal(NPC target, Projectile proj, int damage, bool crit) { CalamityGlobalProjectile modProj = proj.Calamity(); - - if (bloodflareSet && !target.IsAnEnemy(false) && !Player.moonLeech && target.lifeMax > 5) + if (target.IsAnEnemy(false)) { - if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) + if (bloodflareSet && !Player.moonLeech) { - bloodflareHeartTimer = 300; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); - } - } - - if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) - { - float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); - target.Calamity().gladiatorOnKill = false; - if (healPower >= 1) - { - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); - gladiatorTimer = 300; - } - } - - if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5) - { - // Increases the degree to which Spectre Healing set contributes to the lifesteal cap - if (Player.ghostHeal && proj.CountsAsClass()) - { - // This doesn't use Math.Round because it doesn't in vanilla - float cooldownMult = 0.2f; - cooldownMult -= proj.numHits * 0.05f; - if (cooldownMult < 0f) - cooldownMult = 0f; - - float cooldown = damage * cooldownMult; - Main.LocalPlayer.lifeSteal -= cooldown; - } - - if (vampiricTalisman && proj.CountsAsClass() && crit) - { - int heal = (int)Math.Round(damage * (Main.zenithWorld ? 0.01 : 0.008)); - if (proj.Calamity().stealthStrike) + if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { - heal /= 2; //stealth strikes heal half due to generally dealing far more dmg - - if (Main.zenithWorld) - heal *= -2; // IT YEARNS FOR MORE BLOOD + bloodflareHeartTimer = 300; + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); } - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - // Heals more if the ability is active - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile((raiderCritLifespan > 0) ? 1.5f : 1f, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); } - if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); - - if (target.IsAnEnemy(false)) + if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill) { - if (bloodflareThrowing && proj.CountsAsClass() && crit) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - - if (bloodflareMelee && proj.IsTrueMelee()) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); + float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); + target.Calamity().gladiatorOnKill = false; + if (healPower >= 1) + { + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); + gladiatorTimer = 300; + } } + if (vampiricTalisman && proj.CountsAsClass() && crit && proj.numHits <1) + { + int heal = (int)Math.Round(damage * 0.008); + if (heal > 2) + heal = 2; + + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.3f : 1.6f); + } + + if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike && proj.numHits < 1) + //Nanotech has the same heal as Electrician's glove + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, 2f); + + if (bloodflareThrowing && proj.CountsAsClass() && crit) + Projectile.NewProjectile(proj.GetSource_OnHit(target), proj.Center, proj.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((proj.velocity.Length() * proj.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 4, 0f, proj.owner); + if (proj.CountsAsClass() && Player.ActiveItem().CountsAsClass()) { if (manaOverloader) { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.25; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); + double healMult = 0.1D - proj.numHits * 0.025D; + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.5f); } - } - if (silvaSet) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - } - else if (proj.CountsAsClass() && Player.ActiveItem().CountsAsClass()) - { - if (tarraMage) + if (ataxiaMage) { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - } - else if (ataxiaMage) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - } - } - - if (reaverDefense) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealReaverTankCooldownMultiplier); - } - - if (proj.CountsAsClass()) - { - if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType()] < 3 && Player.ownedProjectileCounts[ProjectileType()] < 3) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); + double healMult = 0.1D - proj.numHits * 0.05D; + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.25f); } } } @@ -1480,89 +1368,25 @@ namespace CalamityMod.CalPlayer public void ItemLifesteal(NPC target, Item item, int damage) { - if (bloodflareSet && target.IsAnEnemy(false) && target.lifeMax > 5) + if (target.IsAnEnemy(false)) { - if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) + if (bloodflareSet) { - bloodflareHeartTimer = 300; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); - } - } - - if (bloodflareMelee && item.CountsAsClass() && target.lifeMax > 5) - { - if (target.IsAnEnemy(false) && Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech) - { - int heal = 4; - if (!Main.LocalPlayer.moonLeech) + if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { - Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealSetBonusCooldownMultiplier; - - float lowestHealthCheck = 0f; - int healTarget = Player.whoAmI; - foreach (Player otherPlayer in Main.ActivePlayers) - { - if (!otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team)) - { - float playerDist = Vector2.Distance(target.Center, otherPlayer.Center); - if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) - { - lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; - healTarget = otherPlayer.whoAmI; - } - } - } - - // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list - var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileID.VampireHeal, 0, 0f, Player.whoAmI, healTarget, heal); + bloodflareHeartTimer = 300; + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); } } - } - if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) - { - float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); - target.Calamity().gladiatorOnKill = false; - if (healPower >= 1) + if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill) { - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); - gladiatorTimer = 300; - } - } - - if (reaverDefense) - { - if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5) - { - double healMult = 0.1; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (heal > 0 && !Main.LocalPlayer.moonLeech) + float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); + target.Calamity().gladiatorOnKill = false; + if (healPower >= 1) { - Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealReaverTankCooldownMultiplier; - - float lowestHealthCheck = 0f; - int healTarget = Player.whoAmI; - for (int i = 0; i < Main.maxPlayers; i++) - { - Player otherPlayer = Main.player[i]; - if (otherPlayer.active && !otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team)) - { - float playerDist = Vector2.Distance(target.Center, otherPlayer.Center); - if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) - { - lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; - healTarget = otherPlayer.whoAmI; - } - } - } - - // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list - var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileType(), 0, 0f, Player.whoAmI, healTarget, heal); + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); + gladiatorTimer = 300; } } } diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index 108819e310..f14b13f223 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -61,8 +61,7 @@ namespace CalamityMod.CalPlayer.Dashes // Constantly update the player's velocity direction. Vector2 dashVel = Main.MouseWorld - player.Center; - dashVel = dashVel.SafeNormalize(Vector2.UnitX) * CalculateDashSpeed(player); - player.velocity = dashVel; + player.velocity = player.velocity.ToRotation().AngleTowards(dashVel.ToRotation(), 0.175f).ToRotationVector2() * CalculateDashSpeed(player); // Fall way, way, faster than usual. player.maxFallSpeed = 50f; 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/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/WardingWave.cs b/Cooldowns/WardingWave.cs new file mode 100644 index 0000000000..1a52fd7d48 --- /dev/null +++ b/Cooldowns/WardingWave.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class WardingWave : CooldownHandler + { + public static new string ID => "WardingWave"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText("UI.Cooldowns.WardingWave"); + public override string Texture => "CalamityMod/Cooldowns/WardingWave"; + public override Color OutlineColor => new Color(158, 158, 255); + public override Color CooldownStartColor => new Color(72, 125, 204); + public override Color CooldownEndColor => new Color(97, 200, 255); + public override SoundStyle? EndSound => SoundID.Item85; + } +} diff --git a/Cooldowns/WardingWave.png b/Cooldowns/WardingWave.png new file mode 100644 index 0000000000..6e578a359e Binary files /dev/null and b/Cooldowns/WardingWave.png differ diff --git a/Cooldowns/WardingWaveOutline.png b/Cooldowns/WardingWaveOutline.png new file mode 100644 index 0000000000..558164d44e Binary files /dev/null and b/Cooldowns/WardingWaveOutline.png differ diff --git a/Cooldowns/WardingWaveOverlay.png b/Cooldowns/WardingWaveOverlay.png new file mode 100644 index 0000000000..4bc05e7014 Binary files /dev/null and b/Cooldowns/WardingWaveOverlay.png differ diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index 683b8a49b1..8c36c52d84 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -508,11 +508,7 @@ namespace CalamityMod.DataStructures { if (Procced) { - if (!player.moonLeech) - { - player.HealPlayer(OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal); - } - + player.DoLifestealDirect(null, OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal); Procced = false; } } diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs new file mode 100644 index 0000000000..56ba9e5c0a --- /dev/null +++ b/DataStructures/DebuffData.cs @@ -0,0 +1,410 @@ +using System; +using System.Diagnostics; +using System.Security.Cryptography; +using CalamityMod.NPCs; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.DataStructures +{ + [ReinitializeDuringResizeArrays] + public static class BuffDatasets + { + public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData") + .Description("Stores DebuffData for a particular debuff") + .RegisterCustomSet(null, + BuffID.OnFire, DebuffData.OnFire, + BuffID.OnFire3, DebuffData.Hellfire, + BuffID.CursedInferno, DebuffData.CursedInferno, + BuffID.ShadowFlame, DebuffData.Shadowflame, + BuffID.Daybreak, DebuffData.Daybroken, + BuffID.Frostburn, DebuffData.Frostburn, + BuffID.Frostburn2, DebuffData.Frostbite, + BuffID.Poisoned, DebuffData.Poisoned, + BuffID.Venom, DebuffData.AcidVenom, + BuffID.Electrified, DebuffData.Electrified + ); + } + public class DebuffData + { + /// + /// Determines the behavior of the debuff. + /// + public enum DebuffBehavior + { + Default, + Electric + } + #region DebuffData data + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// Amount of life regen lost by a player under this debuff + /// For debuffs with unique scaling, this should usually be the "base" amount. + /// Defaults to 0 + /// + public float PlayerLostRegen = 0; + + /// + /// Amount of life regen lost by an enemy under this debuff. + /// For debuffs with unique scaling, this should usually be the "base" amount. + /// Defaults to 0 + /// + public float EnemyLostRegen = 0; + + /// + /// This is used to cancel Vanilla DoT damage on enemies and allow using Calamity's own instead. + /// + public int EnemyVanillaRegenToCancelOut = 0; + + /// + /// The minimum size of damage ticks from this debuff on an enemy. + /// Ticks can be larger than this due to MultiplierDamageTickSize + /// Defaults to 1 + /// + public int MinimumDamageTickSize = 1; + + /// + /// The size of damage ticks from this debuff on an enemy + /// This is based on the applied regen of the debuff, and will cause the tick to scale with amplifiers + /// Ticks can be larger than this due to MinimumDamageTickSize + /// Defaults to 0.25f + /// + public float MultiplierDamageTickSize = 0.25f; + + /// + /// How much this benefits from heat debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float HeatDebuffScaling = 0; + /// + /// How much this benefits from sickness debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float SicknessDebuffScaling = 0; + /// + /// How much this benefits from cold debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float ColdDebuffScaling = 0; + /// + /// How much this benefits from water debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float WaterDebuffScaling = 0; + /// + /// How much this benefits from electric debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float ElectricDebuffScaling = 0; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// Whether or not this debuff should draw above inflicted NPCs. + /// Defaults to TRUE + /// + public bool DrawAboveNPC = true; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// Whether or not gear can modify the debuff effects such as duration or damage on the player. + /// + public bool GearCanModifyDebuff = true; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// How much alcohol this counts as. + /// Default is 0, most alcohol is 1, and Everclear is 2 + /// + public float AlcoholLevel = 0f; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// The UpdatePlayerLifeRegen code to run. Defaults to just applying DoT + /// + public UpdatePlayerLifeRegen PlayerUpdateMethod; + + /// + /// The UpdateNPCLifeRegen code to run. Defaults to just applying DoT + /// Parameters of the method should be (NPC npc, int buffType, ref int buffIndex, ref int damage) + /// + public UpdateNPCLifeRegen NPCLifeRegenMethod; + + public DebuffData() + { + PlayerUpdateMethod = DefaultUpdateOnPlayer; + NPCLifeRegenMethod = BaseUpdateNPCLifeRegen; + } + /// + /// Allows using DebuffBehavior to determine preset behavior + /// "electric" causes debuffs to scale 4x when moving + /// Uses default behavior if no known key is inputed + /// + /// This determines the type of behavior of the debuff + public DebuffData(DebuffBehavior behavior) + { + + PlayerUpdateMethod = DefaultUpdateOnPlayer; + if (behavior == DebuffBehavior.Electric) + NPCLifeRegenMethod = ElectricDebuffNPCLifeRegen; + else + NPCLifeRegenMethod = BaseUpdateNPCLifeRegen; + } + + /// + /// UNIMPLEMENTED. WILL BE IN A FUTURE PR + /// This is the code that should be run when updating the buff on a player. + /// Use for DoT damage. Other effects should be in the ModBuff class, or wherever appropriate. + /// + /// + public delegate void UpdatePlayerLifeRegen(Player player, int buffType, ref int buffIndex, ref int damage); + + /// + /// This is the code that should be run when updating life regen on NPC + /// Use for DoT damage. Other effects should be in the ModBuff class, or wherever appropriate. + /// + /// + public delegate void UpdateNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage); + + /// + /// Applies a scaling amount to a StatModifer + /// + /// + /// + /// + public static StatModifier ApplyScalingToStatModifer(StatModifier Modifer, float scaling) + { + StatModifier output = new(); + output += (Modifer.Additive-1) * scaling; + output *= 1 + (Modifer.Multiplicative-1) * scaling; + output.Base = Modifer.Base * scaling; + output.Flat = Modifer.Flat * scaling; + return output; + } + + /// + /// UNIMPLEMENTED. WILL BE IN A FUTURE PR + /// The default debuff DoT functionality on a player + /// + public void DefaultUpdateOnPlayer(Player player, int buffType, ref int buffIndex, ref int damage) + { + + } + + /// + /// The default debuff DoT functionality on enemies. + /// + public void BaseUpdateNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + float totalDPS = EnemyLostRegen; + StatModifier totalScaling = + HeatDebuffScaling + ColdDebuffScaling + SicknessDebuffScaling + WaterDebuffScaling + ElectricDebuffScaling != 0 + ? + ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, HeatDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveColdDebuffMultiplier, ColdDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveSicknessDebuffMultiplier, SicknessDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveWaterDebuffMultiplier, WaterDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) + )))) + : + cnpc.ActiveTypelessDebuffMultiplier; + totalDPS = totalScaling.ApplyTo(totalDPS); + var totalDPSAdjusted = totalDPS-EnemyVanillaRegenToCancelOut; + npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS*MultiplierDamageTickSize,MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + /// + /// DoT functionality that takes into account Electric debuff's 4x DPS when moving + /// + /// + /// + /// + /// + public void ElectricDebuffNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + float totalDPS = EnemyLostRegen; + StatModifier totalScaling = + HeatDebuffScaling + ColdDebuffScaling + SicknessDebuffScaling + WaterDebuffScaling + ElectricDebuffScaling != 0 + ? + ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, HeatDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveColdDebuffMultiplier, ColdDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveSicknessDebuffMultiplier, SicknessDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveWaterDebuffMultiplier, WaterDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) + )))) + : + cnpc.ActiveTypelessDebuffMultiplier; + totalDPS = totalScaling.ApplyTo(totalDPS); + totalDPS *= (npc.velocity.X == 0 ? 1 : 4); + totalDPS -= EnemyVanillaRegenToCancelOut * (npc.velocity.X == 0 ? 1 : 5); //Vanilla Electrified is 5x when moving, not 4x + npc.Calamity().ApplyDPSDebuff((int)(totalDPS), (int)Math.Max(totalDPS * MultiplierDamageTickSize, MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + #region Special Regen Functions + /// + /// 18OCT2023: Ozzatron: im not gonna sugarcoat it + /// vanilla debuff damage from Daybreak impales scales linearly up to 8 for 800 DPS + /// instead of allowing this entire 800 DPS to be multiplied by heat weakness + heat DoT bonuses, + /// each Daybreak spear beyond the first is only affected 25% as much by weaknesses or resistances. + /// This also stops Daybreak's DPS from being utterly shafted by heat resistance. + /// As no other weapon can stack Daybroken, this has no effect on other weapons (they count as "1 Daybreak spear") + /// + /// + /// + /// + /// + public static void DaybrokenRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + int numImpaledSpears = 0; + for (int k = 0; k < Main.maxProjectiles; k++) + { + if (Main.projectile[k].active && Main.projectile[k].type == ProjectileID.Daybreak && Main.projectile[k].ai[0] == 1f && Main.projectile[k].ai[1] == npc.whoAmI) + numImpaledSpears++; + } + + // If there are no Daybreak impaled spears, Daybroken has 1x potency (it was applied some other way) + float daybrokenMultiplier = numImpaledSpears <= 1 ? 1f : (1f + 0.25f * (numImpaledSpears - 1)); + int adjustedSpears = Math.Max(1, numImpaledSpears); + int baseDaybreakDoTValue = (int)(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(Daybroken.EnemyLostRegen * adjustedSpears) + npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(Daybroken.EnemyLostRegen * 0.25f * (adjustedSpears - 1))); + var totalDPSAdjusted = baseDaybreakDoTValue - Daybroken.EnemyVanillaRegenToCancelOut*numImpaledSpears; + if (numImpaledSpears == 0) + { + totalDPSAdjusted -= Daybroken.EnemyVanillaRegenToCancelOut; + } + npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(baseDaybreakDoTValue * Daybroken.MultiplierDamageTickSize, Daybroken.MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + /// + /// Apply Oiled DoT. + /// + public static void OiledNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier,Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen); + if (totalDPS <= 0) + return; + npc.Calamity().ApplyDPSDebuff((int)(totalDPS), damage+(int)Math.Max(totalDPS * Oiled.MultiplierDamageTickSize, Oiled.MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + /// + /// Has Dryad's Bane scale with Calamity's town NPC buffs + /// + public static void DryadsBaneNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + // Buffs match 1:1 with Town NPC buffs + // See CalamityGlobalTownNPC: BuffTownNPC + float buffedDryadsBaneMult = 0f + + (NPC.downedMoonlord ? 0.6f : 0f) + + (DownedBossSystem.downedProvidence ? 0.2f : 0f) + + (DownedBossSystem.downedPolterghast ? 0.2f : 0f) + + (DownedBossSystem.downedDoG ? 0.2f : 0f) + + (DownedBossSystem.downedYharon ? 0.2f : 0f) + + (DownedBossSystem.downedExoMechs ? 0.6f : 0f) + + (DownedBossSystem.downedCalamitas ? 0.6f : 0f); + if (Main.expertMode) + buffedDryadsBaneMult *= Main.GameModeInfo.TownNPCDamageMultiplier; + int buffedDryadsBaneDoTValue = 2 * (int)(4 * buffedDryadsBaneMult); + npc.lifeRegen -= buffedDryadsBaneDoTValue; + + // Scales damage tick if greater than the vanilla amount + float vanillaDryadsBaneMult = 1f + + (NPC.downedBoss1 ? 0.1f : 0f) + + (NPC.downedBoss2 ? 0.1f : 0f) + + (NPC.downedBoss3 ? 0.1f : 0f) + + (NPC.downedQueenBee ? 0.1f : 0f) + + (Main.hardMode ? 0.4f : 0f) + + (NPC.downedMechBoss1 ? 0.15f : 0f) + + (NPC.downedMechBoss1 ? 0.15f : 0f) + + (NPC.downedMechBoss1 ? 0.15f : 0f) + + (NPC.downedPlantBoss ? 0.15f : 0f) + + (NPC.downedGolemBoss ? 0.15f : 0f) + + (NPC.downedAncientCultist ? 0.15f : 0f); + if (Main.expertMode) + vanillaDryadsBaneMult *= Main.GameModeInfo.TownNPCDamageMultiplier; + int totalDryadsBaneDoTValue = 2 * (int)(4 * vanillaDryadsBaneMult) + buffedDryadsBaneDoTValue; + if (damage < totalDryadsBaneDoTValue / 6) + damage = totalDryadsBaneDoTValue / 6; + } + + #endregion + #endregion + + #region Vanilla debuff stats + public static DebuffData OnFire = new DebuffData() + { + EnemyLostRegen = 12, + EnemyVanillaRegenToCancelOut = 12, + HeatDebuffScaling = 1 + }; + public static DebuffData Hellfire = new DebuffData() + { + EnemyLostRegen = 30, + EnemyVanillaRegenToCancelOut = 30, + HeatDebuffScaling = 1 + }; + public static DebuffData CursedInferno = new DebuffData() + { + EnemyLostRegen = 48, + EnemyVanillaRegenToCancelOut = 48, + HeatDebuffScaling = 1 + }; + public static DebuffData Shadowflame = new DebuffData() + { + EnemyLostRegen = 60, + EnemyVanillaRegenToCancelOut = 60, + HeatDebuffScaling = 1 + }; + public static DebuffData Daybroken = new DebuffData() + { + EnemyLostRegen = 200, + EnemyVanillaRegenToCancelOut = 200, + HeatDebuffScaling = 1, + NPCLifeRegenMethod = DaybrokenRegen + }; + public static DebuffData Frostburn = new DebuffData() + { + EnemyLostRegen = 16, + EnemyVanillaRegenToCancelOut = 16, + ColdDebuffScaling = 1 + }; + public static DebuffData Frostbite = new DebuffData() + { + EnemyLostRegen = 50, + EnemyVanillaRegenToCancelOut = 50, + ColdDebuffScaling = 1 + }; + public static DebuffData Poisoned = new DebuffData() + { + EnemyLostRegen = 12, + EnemyVanillaRegenToCancelOut = 12, + SicknessDebuffScaling = 1 + }; + public static DebuffData AcidVenom = new DebuffData() + { + EnemyLostRegen = 60, + EnemyVanillaRegenToCancelOut = 60, + SicknessDebuffScaling = 1 + }; + public static DebuffData Electrified = new DebuffData(DebuffBehavior.Electric) + { + EnemyLostRegen = 21, + EnemyVanillaRegenToCancelOut = 8, + ElectricDebuffScaling = 1 + }; + public static DebuffData Oiled = new DebuffData() + { + EnemyLostRegen = 50, //This is how much DPS Oiled does when applied alongside a valid debuff + EnemyVanillaRegenToCancelOut = 50, + HeatDebuffScaling = 2, //Oiled scales twice as hard with heat debuff scaling to reward debuff builds who use such a rare and difficult to apply debuff. + NPCLifeRegenMethod = OiledNPCMethod + }; + public static DebuffData DryadsBane = new DebuffData() + { + EnemyLostRegen = 8, //This is not used in the method, serves as a token amount for anything that may need to interface in the future. + NPCLifeRegenMethod = DryadsBaneNPCMethod + }; + #endregion + } +} diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs deleted file mode 100644 index c346d23677..0000000000 --- a/DataStructures/NPCStats.cs +++ /dev/null @@ -1,880 +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 deathDamage = contactDamage[3] == -1 ? -1 : (int)Math.Round(contactDamage[3] / damageAdjustment); - int masterDamage = contactDamage[4] == -1 ? -1 : (int)Math.Round(contactDamage[4] / 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.death ? deathDamage : 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 deathDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment); - int masterDamage = (int)Math.Round(projectileDamage[4] / damageAdjustment); - - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : 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 deathDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment); - int masterDamage = (int)Math.Round(projectileDamage[4] / damageAdjustment); - - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : 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[4] - : CalamityWorld.death ? 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(), 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 }, - { ModContent.NPCType(), 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, 96, 144 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, - - { ModContent.NPCType(), new int[] { 45, 66, 88, 110, 165 } }, - { ModContent.NPCType(), new int[] { 24, 32, 40, 48, 72 } }, - { ModContent.NPCType(), new int[] { 18, 24, 30, 36, 54 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, - { ModContent.NPCType(), new int[] { 21, 28, 32, 36, 63 } }, - { ModContent.NPCType(), new int[] { 12, 16, 20, 24, 36 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, - { ModContent.NPCType(), new int[] { 21, 28, 32, 36, 63 } }, - { ModContent.NPCType(), new int[] { 12, 16, 20, 24, 36 } }, - - { NPCID.EyeofCthulhu, new int[] { - 24, // 36 in phase 2 - 30, // 45 in phase 2 - 40, // 48 in phase 2, 56 in phase 3 - 50, // 60 in phase 2, 70 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, 36, 54 } }, - { ModContent.NPCType(), new int[] { 20, 26, 34, 42, 63 } }, // In phase 2: 26, 34, 44, 55, 82 - - { ModContent.NPCType(), new int[] { 40, 64, 80, 96, 144 } }, - { ModContent.NPCType(), new int[] { 25, 50, 62, 74, 111 } }, - - { NPCID.EaterofWorldsHead, new int[] { 38, 55, 77, 99, 165 } }, - { NPCID.EaterofWorldsBody, new int[] { 18, 24, 32, 40, 60 } }, - { NPCID.EaterofWorldsTail, new int[] { 12, 16, 24, 32, 48 } }, - { NPCID.VileSpitEaterOfWorlds, new int[] { -1, 64, 64, 64, 96 } }, - - { NPCID.BrainofCthulhu, new int[] { 36, 54, 81, 108, 162 } }, - { NPCID.Creeper, new int[] { 24, 36, 66, 96, 144 } }, - - { ModContent.NPCType(), new int[] { 42, 63, 81, 99, 162 } }, - { ModContent.NPCType(), new int[] { 30, 50, 62, 74, 111 } }, - - { ModContent.NPCType(), new int[] { 36, 54, 63, 72, 108 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 126, 189 } }, - { ModContent.NPCType(), new int[] { 28, 48, 56, 64, 96 } }, - { ModContent.NPCType(), new int[] { 22, 36, 42, 48, 72 } }, - { ModContent.NPCType(), new int[] { 42, 70, 84, 98, 147 } }, - { ModContent.NPCType(), new int[] { 24, 42, 50, 58, 87 } }, - { ModContent.NPCType(), new int[] { 18, 28, 34, 40, 60 } }, - { ModContent.NPCType(), new int[] { 36, 60, 72, 84, 126 } }, - { ModContent.NPCType(), new int[] { 20, 36, 42, 48, 72 } }, - { ModContent.NPCType(), new int[] { 14, 20, 26, 32, 48 } }, - - { NPCID.QueenBee, new int[] { 36, 54, 81, 108, 162 } }, - { NPCID.Bee, new int[] { 20, 24, 48, 72, 108 } }, - { NPCID.BeeSmall, new int[] { 15, 18, 36, 54, 81 } }, - - { NPCID.SkeletronHead, new int[] { - 42, // 55 while spinning - 77, // 100 while spinning - 88, // 114 while spinning - 99, // 128 while spinning - 165 } }, // 215 while spinning - { NPCID.SkeletronHand, new int[] { 32, 44, 77, 110, 165 } }, - - { NPCID.Deerclops, new int[] { 20, 40, 50, 60, 90 } }, - - { ModContent.NPCType(), new int[] { 48, 80, 96, 112, 168 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 126, 189 } }, - { ModContent.NPCType(), new int[] { 48, 80, 96, 112, 168 } }, - { ModContent.NPCType(), new int[] { 60, 100, 120, 140, 210 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 126, 189 } }, - { ModContent.NPCType(), new int[] { 36, 60, 72, 84, 126 } }, - { ModContent.NPCType(), new int[] { 24, 40, 48, 56, 84 } }, - { ModContent.NPCType(), new int[] { 42, 70, 84, 98, 147 } }, - { ModContent.NPCType(), new int[] { 30, 50, 60, 70, 105 } }, - - { NPCID.WallofFlesh, new int[] { 100, 150, 180, 210, 315 } }, - { NPCID.WallofFleshEye, new int[] { 100, 150, 180, 210, 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 - 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, 88, 132 } }, - { NPCID.LeechHead, new int[] { 26, 52, 62, 72, 108 } }, - { NPCID.LeechBody, new int[] { 22, 44, 52, 60, 90 } }, - { NPCID.LeechTail, new int[] { 18, 36, 42, 48, 72 } }, - - { NPCID.QueenSlimeBoss, new int[] { 80, 120, 150, 180, 270 } }, - { NPCID.QueenSlimeMinionBlue, new int[] { 60, 80, 100, 120, 180 } }, - { NPCID.QueenSlimeMinionPink, new int[] { 60, 80, 100, 120, 180 } }, - { NPCID.QueenSlimeMinionPurple, new int[] { 70, 100, 120, 140, 210 } }, - - { ModContent.NPCType(), new int[] { 90, 138, 161, 184, 276 } }, - { ModContent.NPCType(), new int[] { 80, 120, 138, 156, 240 } }, - - { NPCID.Spazmatism, new int[] { - 70, // 105 in phase 2 - 102, // 153 in phase 2 - 119, // 178 in phase 2 - 136, // 204 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 - 119, // 178 in phase 2 - 153 } }, // 229 in phase 2 - { ModContent.NPCType(), new int[] { - 62, // 93 in phase 2 - 94, // 141 in phase 2 - 110, // 165 in phase 2 - 128, // 192 in phase 2 - 178 } }, // 267 in phase 2 - - { ModContent.NPCType(), new int[] { 110, 176, 187, 198, 330 } }, - { ModContent.NPCType(), new int[] { 75, 112, 136, 160, 240 } }, - { ModContent.NPCType(), new int[] { 70, 104, 112, 120, 192 } }, - { ModContent.NPCType(), new int[] { 65, 96, 104, 112, 168 } }, - - { NPCID.TheDestroyer, new int[] { 140, 280, 300, 320, 480 } }, - { NPCID.TheDestroyerBody, new int[] { 70, 102, 136, 170, 255 } }, - { NPCID.TheDestroyerTail, new int[] { 45, 68, 102, 136, 204 } }, - - { ModContent.NPCType(), new int[] { 75, 112, 136, 160, 240 } }, - - { NPCID.SkeletronPrime, new int[] { - 50, // 100 while spinning - 85, // 170 while spinning - 102, // 204 while spinning - 119, // 238 while spinning - 153 } }, // 306 while spinning - { ModContent.NPCType(), new int[] { - 50, // 100 while spinning - 85, // 170 while spinning - 102, // 204 while spinning - 119, // 238 while spinning - 153 } }, // 306 while spinning - { NPCID.PrimeVice, new int[] { 70, 102, 136, 170, 255 } }, - { NPCID.PrimeSaw, new int[] { 70, 102, 136, 170, 255 } }, - { NPCID.PrimeCannon, new int[] { 30, 51, 68, 85, 102 } }, - { NPCID.PrimeLaser, new int[] { 30, 51, 68, 85, 102 } }, - - { ModContent.NPCType(), new int[] { 95, 144, 168, 192, 288 } }, - { ModContent.NPCType(), new int[] { 80, 120, 138, 156, 240 } }, - { ModContent.NPCType(), new int[] { 85, 130, 150, 170, 255 } }, - - { NPCID.Plantera, new int[] { - 70, // 98 in phase 2 - 100, // 140 in phase 2 - 138, // 193 in phase 2 - 176, // 246 in phase 2 - 276 } }, // 386 in phase 2 - { NPCID.PlanterasTentacle, new int[] { 90, 138, 161, 184, 276 } }, - { ModContent.NPCType(), new int[] { 90, 138, 161, 184, 276 } }, - { NPCID.Spore, new int[] { 90, 140, 160, 180, 270 } }, - - { NPCID.HallowBoss, new int[] { 80, // 120 during charge - 110, // 165 during charge - 143, // 215 during charge - 176, // 264 during charge - 264 } }, // 396 during charge - - { ModContent.NPCType(), new int[] { 140, 216, 240, 264, 414 } }, - { ModContent.NPCType(), new int[] { - 75, // 113 during charge - 112, // 168 during charge - 136, // 204 during charge - 160, // 240 during charge - 240 } }, // 360 during charge - { ModContent.NPCType(), new int[] { 70, 110, 126, 142, 210 } }, - { NPCID.DetonatingBubble, new int[] { 100, 150, 180, 210, 315 } }, - { ModContent.NPCType(), new int[] { 90, 140, 160, 180, 270 } }, - - { ModContent.NPCType(), new int[] { 145, 220, 242, 264, 429 } }, - { ModContent.NPCType(), new int[] { 75, 112, 128, 144, 225 } }, - - { NPCID.Golem, new int[] { 95, 144, 176, 208, 312 } }, - { NPCID.GolemHead, new int[] { 85, 128, 144, 160, 240 } }, - { NPCID.GolemFistLeft, new int[] { 75, 112, 144, 176, 264 } }, - { NPCID.GolemFistRight, new int[] { 75, 112, 144, 176, 264 } }, - - { ModContent.NPCType(), new int[] { 120, 180, 216, 252, 378 } }, - { ModContent.NPCType(), new int[] { 120, 180, 210, 240, 360 } }, - { ModContent.NPCType(), new int[] { 130, 200, 240, 280, 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 - 196, // 282 in phase 2, 259 in phase 3 - 294 } }, // 423 in phase 2, 388 in phase 3 - { NPCID.Sharkron, new int[] { 100, 150, 180, 210, 315 } }, - { NPCID.Sharkron2, new int[] { 120, 180, 210, 240, 360 } }, - - { ModContent.NPCType(), new int[] { 130, 192, 224, 256, 384 } }, - { ModContent.NPCType(), new int[] { 105, 160, 180, 200, 315 } }, - { ModContent.NPCType(), new int[] { 105, 160, 180, 200, 315 } }, - { ModContent.NPCType(), new int[] { 130, 192, 224, 256, 390 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 224, 336 } }, - - { NPCID.CultistDragonHead, new int[] { 120, 180, 210, 240, 360 } }, - { NPCID.CultistDragonBody1, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonBody2, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonBody3, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonBody4, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonTail, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.AncientCultistSquidhead, new int[] { 120, 180, 210, 240, 360 } }, - { NPCID.AncientLight, new int[] { 120, 180, 210, 240, 360 } }, - - { ModContent.NPCType(), new int[] { 160, 240, 268, 296, 480 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 224, 336 } }, - { ModContent.NPCType(), new int[] { 85, 128, 160, 192, 288 } }, - - { ModContent.NPCType(), new int[] { 150, 224, 256, 288, 444 } }, - { ModContent.NPCType(), new int[] { 160, 240, 264, 288, 405 } }, - { ModContent.NPCType(), new int[] { 100, 200, 220, 240, 300 } }, - { ModContent.NPCType(), new int[] { 100, 200, 220, 232, 300 } }, - - { ModContent.NPCType(), new int[] { 170, 256, 288, 320, 504 } }, - { ModContent.NPCType(), new int[] { 145, 220, 242, 264, 435 } }, - - { ModContent.NPCType(), new int[] { 240, 360, 396, 432, 720 } }, - { ModContent.NPCType(), new int[] { 175, 260, 288, 316, 525 } }, - - { ModContent.NPCType(), new int[] { 240, 360, 396, 432, 720 } }, - { ModContent.NPCType(), new int[] { 125, 192, 224, 256, 372 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 224, 312 } }, - - { ModContent.NPCType(), new int[] { 210, 315, 351, 387, 621 } }, - { ModContent.NPCType(), new int[] { 175, 260, 288, 316, 525 } }, - { ModContent.NPCType(), new int[] { 190, 280, 300, 320, 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 - 288, // 346 in phase 2, 403 in phase 3 - 480 } }, // 576 in phase 2, 672 in phase 3 - { ModContent.NPCType(), new int[] { 224, 336, 370, 403, 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 - 360, // 396 in phase 2, 432 in phase 3 - 567 } }, // 624 in phase 2, 680 in phase 3 - { ModContent.NPCType(), new int[] { 192, 288, 328, 368, 576 } }, - { ModContent.NPCType(), new int[] { 192, 288, 328, 368, 576 } }, - - { ModContent.NPCType(), new int[] { 470, 700, 750, 800, 1410 } }, - { ModContent.NPCType(), new int[] { 250, 374, 425, 476, 714 } }, - { ModContent.NPCType(), new int[] { 204, 306, 340, 374, 612 } }, - { ModContent.NPCType(), new int[] { 240, 360, 396, 432, 720 } }, - { ModContent.NPCType(), new int[] { 175, 260, 290, 320, 525 } }, - { ModContent.NPCType(), new int[] { 135, 200, 230, 260, 405 } }, - - { ModContent.NPCType(), new int[] { 300, 448, 480, 512, 900 } }, - - { ModContent.NPCType(), new int[] { 340, 512, 544, 576, 1020 } }, - - { ModContent.NPCType(), new int[] { 340, 512, 544, 576, 1020 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 544, 960 } }, - - { ModContent.NPCType(), new int[] { 375, 560, 592, 624, 1116 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 544, 960 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 544, 960 } }, - { ModContent.NPCType(), new int[] { 270, 400, 424, 448, 804 } }, - - { ModContent.NPCType(), new int[] { 535, 800, 850, 900, 1596 } } - }; - - EnemyStats.ProjectileDamageValues = new SortedDictionary, int[]> - { - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(NPCID.EyeofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 26, 44, 60, 76, 114 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.BloodShot), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 72, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 72, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 72, 108 } }, - - { new Tuple(NPCID.EaterofWorldsHead, ProjectileID.CursedFlameHostile), new int[] { 26, 44, 60, 76, 114 } }, - { new Tuple(NPCID.EaterofWorldsHead, ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(NPCID.BrainofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(NPCID.BrainofCthulhu, ProjectileID.BloodShot), new int[] { 26, 44, 60, 76, 114 } }, - { new Tuple(NPCID.Creeper, ProjectileID.BloodShot), new int[] { 26, 44, 60, 76, 114 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 30, 48, 60, 72, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 30, 48, 60, 72, 108 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 22, 36, 44, 52, 84 } }, - - { new Tuple(NPCID.QueenBee, ProjectileID.QueenBeeStinger), new int[] { 22, 44, 64, 84, 126 } }, - { new Tuple(NPCID.QueenBee, ModContent.ProjectileType()), new int[] { 46, 72, 84, 96, 144 } }, // Beenade Bees: 122 (death mode-exclusive) - - { new Tuple(NPCID.SkeletronHead, ProjectileID.Skull), new int[] { 46, 72, 84, 96, 144 } }, - { new Tuple(NPCID.SkeletronHead, ProjectileID.Shadowflames), new int[] { 36, 72, 88, 104, 156 } }, - { new Tuple(NPCID.SkeletronHand, ProjectileID.Skull), new int[] { 36, 56, 68, 80, 120 } }, - - { new Tuple(NPCID.Deerclops, ProjectileID.DeerclopsIceSpike), new int[] { 26, 52, 76, 100, 150 } }, - { new Tuple(NPCID.Deerclops, ProjectileID.DeerclopsRangedProjectile), new int[] { 36, 72, 88, 104, 156 } }, - { new Tuple(NPCID.Deerclops, ProjectileID.InsanityShadowHostile), new int[] { 20, 40, 60, 80, 120 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 100, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 92, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 100, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 92, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 100, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 92, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 34, 52, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 24, 48, 60, 72, 108 } }, - - { new Tuple(NPCID.WallofFleshEye, ProjectileID.EyeLaser), new int[] { 36, 72, 88, 104, 156 } }, - { new Tuple(NPCID.WallofFlesh, ProjectileID.DemonSickle), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(NPCID.WallofFlesh, ProjectileID.Fireball), new int[] { 36, 72, 88, 104, 156 } }, - - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeGelAttack), new int[] { 60, 120, 136, 152, 228 } }, - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeSmash), new int[] { 80, 160, 188, 216, 324 } }, - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(NPCID.QueenSlimeMinionBlue, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(NPCID.QueenSlimeMinionPink, ProjectileID.QueenSlimeMinionPinkBall), new int[] { 52, 92, 112, 132, 198 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 228 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 140, 210 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 52, 92, 112, 132, 198 } }, - - { new Tuple(NPCID.Retinazer, ProjectileID.EyeLaser), new int[] { 40, 92, 116, 140, 210 } }, - { new Tuple(NPCID.Retinazer, ProjectileID.DeathLaser), new int[] { - 50, // 38 in rapid fire - 108, // 81 in rapid fire - 132, // 99 in rapid fire - 156, // 117 in rapid fire - 234 } }, // 176 in rapid fire - { new Tuple(NPCID.Retinazer, ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 228 } }, - { new Tuple(NPCID.Spazmatism, ProjectileID.CursedFlameHostile), new int[] { 50, 100, 120, 140, 210 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 60, 120, 148, 176, 264 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 60, 100, 128, 156, 234 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 50, 108, 132, 156, 234 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 140, 210 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 228 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 66, 112, 128, 144, 216 } }, - - { new Tuple(NPCID.TheDestroyer, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 136, 204 } }, - { new Tuple(NPCID.TheDestroyer, ModContent.ProjectileType()), new int[] { 46, 108, 128, 148, 222 } }, - { new Tuple(NPCID.TheDestroyer, ModContent.ProjectileType()), new int[] { 48, 116, 136, 156, 234 } }, - { new Tuple(NPCID.TheDestroyerBody, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 136, 204 } }, - { new Tuple(NPCID.TheDestroyerBody, ModContent.ProjectileType()), new int[] { 46, 108, 128, 148, 222 } }, - { new Tuple(NPCID.TheDestroyerBody, ModContent.ProjectileType()), new int[] { 48, 116, 136, 156, 234 } }, - { new Tuple(NPCID.Probe, ProjectileID.PinkLaser), new int[] { 50, 88, 100, 112, 168 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 240, 280, 420 } }, // Split shots: 72, 120, 144, 168, 252 - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - - { new Tuple(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 180, 200, 300 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.FrostBeam), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } }, - { new Tuple(NPCID.PrimeCannon, ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 0, 0, 300 } }, - { new Tuple(NPCID.PrimeLaser, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - - { new Tuple(NPCID.Plantera, ProjectileID.SeedPlantera), new int[] { 52, 96, 128, 160, 240 } }, - { new Tuple(NPCID.Plantera, ProjectileID.PoisonSeedPlantera), new int[] { 62, 116, 144, 172, 258 } }, - { new Tuple(NPCID.Plantera, ProjectileID.ThornBall), new int[] { 72, 132, 160, 188, 282 } }, - { new Tuple(NPCID.Plantera, ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(NPCID.Plantera, ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - - { new Tuple(NPCID.HallowBoss, ProjectileID.HallowBossRainbowStreak), new int[] { 100, 152, 172, 192, 300 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.FairyQueenSunDance), new int[] { 120, 180, 204, 228, 360 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.HallowBossLastingRainbow), new int[] { 100, 152, 172, 192, 300 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.FairyQueenLance), new int[] { 130, 196, 216, 236, 390 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 208, 244, 366 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 84, 148, 172, 196, 294 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 208, 244, 366 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(NPCID.Golem, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, - { new Tuple(NPCID.Golem, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, - { new Tuple(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, - { new Tuple(NPCID.GolemHead, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, - { new Tuple(NPCID.GolemFistLeft, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.GolemFistRight, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 372 } }, - - { new Tuple(NPCID.DukeFishron, ProjectileID.Sharknado), new int[] { 80, 100, 150, 200, 300 } }, - { new Tuple(NPCID.DukeFishron, ProjectileID.Cthulunado), new int[] { 160, 200, 232, 264, 480 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 144, 172, 200, 300 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 144, 172, 200, 300 } }, - - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossFireBall), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossIceMist), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossLightningOrb), new int[] { 120, 192, 220, 248, 372 } }, - { new Tuple(NPCID.CultistBossClone, ProjectileID.CultistBossFireBallClone), new int[] { 90, 144, 172, 200, 300 } }, - { new Tuple(NPCID.AncientDoom, ProjectileID.AncientDoomProjectile), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 152, 176, 200, 300 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 192, 212, 318 } }, - - { new Tuple(NPCID.MoonLordHead, ProjectileID.PhantasmalDeathray), new int[] { 200, 300, 380, 460, 690 } }, - { new Tuple(NPCID.MoonLordHead, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 200, 300 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalEye), new int[] { 90, 120, 160, 200, 300 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalSphere), new int[] { 120, 160, 220, 280, 420 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 200, 300 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalBolt), new int[] { 100, 140, 180, 220, 330 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalEye), new int[] { 100, 140, 180, 220, 330 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalSphere), new int[] { 132, 176, 220, 264, 396 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalDeathray), new int[] { 150, 200, 260, 320, 480 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 320, 352, 384, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0, 0 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 364, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, // Split holy fire does: 113, 198, 216, 234, 338 - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0, 0 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 400, 440, 480, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrbArc), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.FrostWave), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 332, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrb), new int[] { 150, 264, 288, 312, 450 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 332, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 264, 420 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 420, 460, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 316, 348, 380, 540 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 316, 348, 380, 540 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 340, 376, 412, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 520, 548, 576, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 592, 624, 656, 1050 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 592, 624, 656, 1050 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 608, 640, 672, 1200 } }, - - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossIceMist), new int[] { 400, 600, 632, 664, 1200 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrbArc), new int[] { 500, 752, 788, 824, 1500 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.AncientDoomProjectile), new int[] { 400, 600, 632, 664, 1200 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossFireBallClone), new int[] { 400, 600, 632, 664, 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/Dusts/WaterSplash/BasaltGullyLavaSplash.cs b/Dusts/WaterSplash/BasaltGullyLavaSplash.cs new file mode 100644 index 0000000000..aa7ec173f8 --- /dev/null +++ b/Dusts/WaterSplash/BasaltGullyLavaSplash.cs @@ -0,0 +1,178 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics.PackedVector; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Dusts.WaterSplash +{ + public class BasaltGullyLavaSplash : ModDust + { + public override void OnSpawn(Dust dust) + { + dust.velocity *= 0.1f; + dust.velocity.Y = -0.5f; + } + + public override bool Update(Dust dust) + { + if (dust.scale > 10f) + { + dust.active = false; + } + Dust.lavaBubbles++; + dust.position += dust.velocity; + if (!dust.noGravity) + { + dust.velocity.Y += 0.1f; + } + if (dust.noGravity) + { + dust.scale += 0.03f; + if (dust.scale < 1f) + { + dust.velocity.Y += 0.075f; + } + dust.velocity.X *= 1.08f; + if (dust.velocity.X > 0f) + { + dust.rotation += 0.01f; + } + else + { + dust.rotation -= 0.01f; + } + float num109 = dust.scale * 0.6f; + if (num109 > 1f) + { + num109 = 1f; + } + Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f + 1f), num109 * (2.5f / 4), num109 * (1.3f / 4), num109 * (0.1f / 4)); + } + else + { + if (!Collision.WetCollision(new Vector2(dust.position.X, dust.position.Y - 8f), 4, 4)) + { + dust.scale = 0f; + } + else + { + dust.alpha += Main.rand.Next(2); + if (dust.alpha > 255) + { + dust.scale = 0f; + } + dust.velocity.Y = -0.5f; + dust.alpha++; + dust.scale -= 0.01f; + dust.velocity.Y = -0.2f; + dust.velocity.X += (float)Main.rand.Next(-10, 10) * 0.002f; + if ((double)dust.velocity.X < -0.25) + { + dust.velocity.X = -0.25f; + } + if ((double)dust.velocity.X > 0.25) + { + dust.velocity.X = 0.25f; + } + } + float num3 = dust.scale * 0.3f + 0.4f; + if (num3 > 1f) + { + num3 = 1f; + } + Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), num3 * (2.5f / 4), num3 * (1.3f / 4), num3 * (0.1f / 4)); + } + dust.rotation += dust.velocity.X * 0.5f; + if (dust.fadeIn > 0f && dust.fadeIn < 100f) + { + dust.scale += 0.03f; + if (dust.scale > dust.fadeIn) + { + dust.fadeIn = 0f; + } + } + dust.scale -= 0.01f; + if (dust.noGravity) + { + dust.velocity *= 0.92f; + if (dust.fadeIn == 0f) + { + dust.scale -= 0.04f; + } + } + if (dust.position.Y > Main.screenPosition.Y + (float)Main.screenHeight) + { + dust.active = false; + } + float num17 = 0.1f; + if ((double)Dust.dCount == 0.5) + { + dust.scale -= 0.001f; + } + if ((double)Dust.dCount == 0.6) + { + dust.scale -= 0.0025f; + } + if ((double)Dust.dCount == 0.7) + { + dust.scale -= 0.005f; + } + if ((double)Dust.dCount == 0.8) + { + dust.scale -= 0.01f; + } + if ((double)Dust.dCount == 0.9) + { + dust.scale -= 0.02f; + } + if ((double)Dust.dCount == 0.5) + { + num17 = 0.11f; + } + if ((double)Dust.dCount == 0.6) + { + num17 = 0.13f; + } + if ((double)Dust.dCount == 0.7) + { + num17 = 0.16f; + } + if ((double)Dust.dCount == 0.8) + { + num17 = 0.22f; + } + if ((double)Dust.dCount == 0.9) + { + num17 = 0.25f; + } + if (dust.scale < num17) + { + dust.active = false; + } + return false; + } + + public override Color? GetAlpha(Dust dust, Color lightColor) + { + float num = (float)(255 - dust.alpha) / 255f; + int num4; + int num3; + int num2; + num = (num + 3f) / 4f; + num4 = (int)((int)lightColor.R * num); + num3 = (int)((int)lightColor.G * num); + num2 = (int)((int)lightColor.B * num); + int num6 = lightColor.A - dust.alpha; + if (num6 < 0) + { + num6 = 0; + } + if (num6 > 255) + { + num6 = 255; + } + return new Color(num4, num3, num2, num6); + } + } +} diff --git a/Dusts/WaterSplash/BasaltGullyLavaSplash.png b/Dusts/WaterSplash/BasaltGullyLavaSplash.png new file mode 100644 index 0000000000..6fc3a83f98 Binary files /dev/null and b/Dusts/WaterSplash/BasaltGullyLavaSplash.png differ 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/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 42f0556052..66689a2269 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -164,7 +164,7 @@ namespace CalamityMod.Events ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), - new Boss(NPCID.EyeofCthulhu, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.ServantofCthulhu, ModContent.NPCType() }), + new Boss(NPCID.EyeofCthulhu, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.ServantofCthulhu }), new Boss(ModContent.NPCType(), TimeChangeContext.Day, type => { @@ -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(), @@ -213,8 +213,7 @@ namespace CalamityMod.Events { NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Spazmatism); NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Retinazer); - NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType()); - }, permittedNPCs: new int[] { NPCID.Retinazer, ModContent.NPCType() }), + }, permittedNPCs: new int[] { NPCID.Retinazer }), new Boss(ModContent.NPCType(), TimeChangeContext.Day, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), @@ -222,7 +221,7 @@ namespace CalamityMod.Events new Boss(ModContent.NPCType(), TimeChangeContext.Day, permittedNPCs: ModContent.NPCType()), - new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { ModContent.NPCType(), NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser, NPCID.Probe }), + new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser }), new Boss(ModContent.NPCType(), TimeChangeContext.Night, permittedNPCs: new int[] { 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/ExtraTextures/Bestiary/SlimeGod_Bestiary.png b/ExtraTextures/Bestiary/SlimeGod_Bestiary.png deleted file mode 100644 index dbe7056e82..0000000000 Binary files a/ExtraTextures/Bestiary/SlimeGod_Bestiary.png and /dev/null differ diff --git a/ExtraTextures/ChadPrime.png b/ExtraTextures/ChadPrime.png deleted file mode 100644 index 3bbc5902b0..0000000000 Binary files a/ExtraTextures/ChadPrime.png and /dev/null differ diff --git a/ExtraTextures/ChadPrimeHeadGlow.png b/ExtraTextures/ChadPrimeHeadGlow.png deleted file mode 100644 index e8b25ba236..0000000000 Binary files a/ExtraTextures/ChadPrimeHeadGlow.png and /dev/null differ diff --git a/ExtraTextures/ChadPrime_Head_Boss.png b/ExtraTextures/ChadPrime_Head_Boss.png deleted file mode 100644 index 313edebc2c..0000000000 Binary files a/ExtraTextures/ChadPrime_Head_Boss.png and /dev/null differ diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index ab359512cb..a39bd99b7c 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -20,10 +20,6 @@ namespace CalamityMod.ExtraTextures public static Asset DestroyerBodyGlowmask; public static Asset DestroyerTailGlowmask; - // Master Rev+ Skeletron Prime - public static Asset ChadPrime; - public static Asset ChadPrimeEyeGlowmask; - // WoF, These are not "exactly" the ExtraTextures. But public static Asset WallOfFleshEyeGlowmask; public static Asset WallOfFleshDemonSickleTexture; @@ -43,16 +39,6 @@ namespace CalamityMod.ExtraTextures public static Asset CircularSmearFire2; public static Asset CircularSmearFire3; - // Boss Heads - // I know it's not exactly a Texture2D but it belongs to ExtraTextures. - public static int BossHeadIndex_ChadPrime; - - public override void Load() - { - string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss"; - BossHeadIndex_ChadPrime = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1); - } - // TODO: - Every other ExtraTextures Reference could be move in here public override void OnModLoad() @@ -61,9 +47,6 @@ namespace CalamityMod.ExtraTextures DestroyerBodyGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); DestroyerTailGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); - ChadPrime = ModContent.Request("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad); - ChadPrimeEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad); - WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); diff --git a/ExtraTextures/SkeletronPrime2HeadGlow.png b/ExtraTextures/SkeletronPrime2HeadGlow.png deleted file mode 100644 index 7054e2945d..0000000000 Binary files a/ExtraTextures/SkeletronPrime2HeadGlow.png and /dev/null differ 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/Gores/BloodlettingServant1.png b/Gores/BloodlettingServant1.png deleted file mode 100644 index d7522171eb..0000000000 Binary files a/Gores/BloodlettingServant1.png and /dev/null differ diff --git a/Gores/BloodlettingServant2.png b/Gores/BloodlettingServant2.png deleted file mode 100644 index 391c59a4a7..0000000000 Binary files a/Gores/BloodlettingServant2.png and /dev/null differ diff --git a/Gores/BloodlettingServant3.png b/Gores/BloodlettingServant3.png deleted file mode 100644 index a4da81ae9f..0000000000 Binary files a/Gores/BloodlettingServant3.png and /dev/null differ diff --git a/Gores/BloodlettingServant4.png b/Gores/BloodlettingServant4.png deleted file mode 100644 index ddece78bac..0000000000 Binary files a/Gores/BloodlettingServant4.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png b/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png deleted file mode 100644 index 07f2e01333..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png b/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png deleted file mode 100644 index 303ac4ccde..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png deleted file mode 100644 index 860fd8b8c2..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png deleted file mode 100644 index 613ee6e5e1..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png and /dev/null differ diff --git a/Gores/WaterDroplet/BasaltGullyLavaDroplet.cs b/Gores/WaterDroplet/BasaltGullyLavaDroplet.cs new file mode 100644 index 0000000000..d11e87ee5d --- /dev/null +++ b/Gores/WaterDroplet/BasaltGullyLavaDroplet.cs @@ -0,0 +1,11 @@ +using Microsoft.Xna.Framework; + +namespace CalamityMod.Gores.WaterDroplet +{ + public class BasaltGullyLavaDroplet : LiquidDropletGore + { + public override bool lavaDroplet => true; + + public override Vector3 lavaColor => new Vector3(2.5f, 1.3f, 0.1f); + } +} diff --git a/Gores/WaterDroplet/BasaltGullyLavaDroplet.png b/Gores/WaterDroplet/BasaltGullyLavaDroplet.png new file mode 100644 index 0000000000..fa76dba55c Binary files /dev/null and b/Gores/WaterDroplet/BasaltGullyLavaDroplet.png differ diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 5018cee4bb..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; @@ -79,17 +81,6 @@ namespace CalamityMod.ILEditing } cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, 0.5f); // Decrease to 0.5f. - - // CIT 22SEP2024: Removed the edit intended to decrease Frog Leg's jump speed boost, - // as it was not doing anything due to vanilla changing how Frog Leg's jump speed boost is applied. - - // Remove the jump height addition from the Werewolf buff (Moon Charm). - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(2))) - { - LogFailure("Jump Height Boost Fixes", "Could not locate Moon Charm jump height boost value."); - return; - } - cursor.Next.Operand = 0; } private const float VanillaBaseJumpSpeed = 5.01f; @@ -115,16 +106,12 @@ namespace CalamityMod.ILEditing private static void RunSpeedAdjustments(ILContext il) { var cursor = new ILCursor(il); - float asphaltTopSpeedMultiplier = 1.75f; // +75%. Vanilla is +250% + float asphaltTopSpeedMultiplier = 2.25f; // +125%. Vanilla is +250% float asphaltSlowdown = 1f; // Vanilla is 2f. This should actually make asphalt faster. - // Dunerider Boots multiply all run stats by 1.75f in vanilla - float duneRiderBootsMultiplier = 1.25f; // Change to 1.25f - // Multiplied by 0.6 on frozen slime, for +26% acceleration // Multiplied by 0.7 on ice, for +47% acceleration float iceSkateAcceleration = 2.1f; - float iceSkateTopSpeed = 1f; // no boost at all // // ASPHALT @@ -153,22 +140,6 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldc_R4, asphaltSlowdown); } - // - // DUNERIDER BOOTS + SAND BLOCKS - // - { - // Find the multiplier for Dunerider Boots on Sand Blocks. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f))) - { - LogFailure("Run Speed Adjustments", "Could not locate the Dunerdier Boots multiplier."); - return; - } - - // Massively reduce the increased speed of Dunerider Boots while on Sand Blocks. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, duneRiderBootsMultiplier); - } - // // ICE SKATES + FROZEN SLIME BLOCKS // @@ -183,17 +154,6 @@ namespace CalamityMod.ILEditing // Massively reduce the acceleration bonus of Ice Skates on Frozen Slime Blocks. cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, iceSkateAcceleration); - - // Find the top speed multiplier of Ice Skates on Frozen Slime Blocks. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.25f))) - { - LogFailure("Run Speed Adjustments", "Could not locate Ice Skates + Frozen Slime Block top speed multiplier."); - return; - } - - // Make Ice Skates give no top speed boost whatsoever on Frozen Slime Blocks. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, iceSkateTopSpeed); } // @@ -210,17 +170,6 @@ namespace CalamityMod.ILEditing // Massively reduce the acceleration bonus of Ice Skates on Ice Blocks. cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, iceSkateAcceleration); - - // Find the top speed multiplier of Ice Skates on Ice Blocks. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.25f))) - { - LogFailure("Run Speed Adjustments", "Could not locate Ice Skates + Ice Block top speed multiplier."); - return; - } - - // Make Ice Skates give no top speed boost whatsoever on Ice Blocks. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, iceSkateTopSpeed); } } @@ -241,18 +190,7 @@ namespace CalamityMod.ILEditing } cursor.Next.Operand = BalancingConstants.SoaringInsigniaRunAccelerationMultiplier; - // Second: Magiluminescence. Find the check for whether it's equipped for run speeds. - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("hasMagiluminescence"))) - { - LogFailure("Run Acceleration Nerfs", "Could not locate the Magiluminescence bool."); - return; - } - - // - // Don't actually do anything. Magiluminescence is not intended to be nerfed by Calamity. - // - - // Third: Shadow Armor. Find the check for whether it's equipped for run speeds. + // Second: Shadow Armor. Find the check for whether it's equipped for run speeds. if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("shadowArmor"))) { LogFailure("Run Acceleration Nerfs", "Could not locate the Shadow Armor bool."); @@ -398,73 +336,15 @@ namespace CalamityMod.ILEditing orig(self, item); // Hard / Guarding / Armored / Warding give 0.25% / 0.5% / 0.75% / 1% DR if (item.prefix == PrefixID.Hard) - { - /* Prehardmode = 1 - * Hardmode = 2 - * Post-Moon Lord = 3 - * Post-DoG = 4 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; - self.endurance += 0.0025f; - } if (item.prefix == PrefixID.Guarding) - { - /* Prehardmode = 2 - * Hardmode = 3 - * Post-Moon Lord = 4 - * Post-DoG = 5 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; - self.endurance += 0.005f; - } if (item.prefix == PrefixID.Armored) - { - /* Prehardmode = 3 - * Hardmode = 4 - * Post-Moon Lord = 5 - * Post-DoG = 6 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; - self.endurance += 0.0075f; - } if (item.prefix == PrefixID.Warding) - { - /* Prehardmode = 4 - * Hardmode = 5 - * Post-Moon Lord = 6 - * Post-DoG = 7 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; self.endurance += 0.01f; - } + // Lucky prefix increases luck if (item.prefix == PrefixID.Lucky) self.Calamity().calamityBonusLuck += 0.05f; } @@ -501,7 +381,7 @@ namespace CalamityMod.ILEditing private static void VanillaBossResistChanges(ILContext il) { // This IL edit accomplishes two things: - // 1. Reduces Expert+ Eater of Worlds' resist to explosives from 80% to 60%. + // 1. Reduces Expert+ Eater of Worlds' resist to explosives from 80% to 66%. // 2. Effectively removes Lunatic Cultist's resistance to homing projectiles. var cursor = new ILCursor(il); @@ -514,17 +394,15 @@ namespace CalamityMod.ILEditing return; } } - if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchDiv())) + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR4(5f))) { LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor."); return; } - // Remove the division instruction, then pop the 5 off the stack to destroy it. Replace it with loading a 0.4 and then multiplying by it. - cursor.Remove(); + // Pop the 5 off the stack, and replace it with a 3. cursor.EmitPop(); - cursor.EmitLdcR4(0.4f); - cursor.EmitMul(); + cursor.EmitLdcR4(3f); // Now, move to the Cultist resist which is right below it. if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(typeof(ProjectileID.Sets), "CultistIsResistantTo"))) @@ -563,30 +441,13 @@ namespace CalamityMod.ILEditing #region UpdateBuffs Balancing Changes private static void UpdateBuffsBalancingChanges(ILContext il) { - // This IL edit accomplishes four things: - // 1. Nerf Sharpening Station's armor penetration boost from 12 to 5. - // 2. Nerf Beetle Scale Mail's set bonus Beetle Might melee speed from 10% per stack to 5%. - // 3. Nerf Nebula armor's Damage and Life Boosters (Mana Boosters are not handled in this method). - // 4. Remove the ability for Feral Bite to randomly inflict debuffs. + // This IL edit accomplishes three things: + // 1. Nerf Beetle Scale Mail's set bonus Beetle Might melee speed from 10% per stack to 5%. + // 2. Nerf Nebula armor's Damage and Life Boosters (Mana Boosters are not handled in this method). + // 3. Remove the vanilla implementation of Feral Bite inflicting random debuffs. var cursor = new ILCursor(il); - // First, find the code which applies Sharpened's armor penetration buff. - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.Sharpened))) - { - LogFailure("Sharpening Station Nerf", "Could not locate the Sharpened buff ID."); - return; - } - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(12f))) // The amount of armor penetration to grant. - { - LogFailure("Sharpening Station Nerf", "Could not locate the amount of armor penetration granted."); - return; - } - - // Replace the value entirely. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.SharpeningStationArmorPenetration); - - // Next, move to Beetle Scale Mail's melee speed boost from Beetle Might buff. + // First, move to Beetle Scale Mail's melee speed boost from Beetle Might buff. if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.BeetleMight1))) { LogFailure("Beetle Scale Mail Nerf", "Could not locate the Beetle Might buff ID."); @@ -642,7 +503,7 @@ namespace CalamityMod.ILEditing // There are multiple branches pointing to this instruction, so it cannot be removed. Instead, swap its value directly. cursor.Next.Operand = BalancingConstants.NebulaDamagePerBooster; - // Finally, removing Feral Bite's debuffs. + // Finally, removing Feral Bite's vanilla debuff infliction. // Find the random debuff duration multiplier for the debuffs inflicted by Feral Bite. if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.01f))) // The 0.01f random debuff duration multiplier. { @@ -651,14 +512,78 @@ namespace CalamityMod.ILEditing } // Remove and change to 0f, this makes the random debuffs from Feral Bite have 0 duration. + // Calamity reimplements a different version of this in CalamityGlobalBuff.Update cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, 0f); } #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 f972954fa5..7640305ef9 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -65,18 +65,18 @@ namespace CalamityMod.ILEditing // NPC behavior IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; - On_NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInBossRush; - On_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush; + IL_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush; IL_Player.CollectTaxes += MakeTaxCollectorUseful; // Mechanics / features - On_NPC.ApplyTileCollision += AllowTriggeredFallthrough; + On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand; IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom; 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; @@ -84,16 +84,11 @@ namespace CalamityMod.ILEditing On_Item.AffixName += IncorporateEnchantmentInAffix; On_Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float += IncorporateExtraProjectileVariables; On_Player.ApplyDamageToNPC += ApplyOldFashionedDamageToMiscHits; - // TODO -- This should be unnecessary. There is now a TML hook for platform collision for ModNPCs. - On_NPC.Collision_DecideFallThroughPlatforms += EnableCalamityBossPlatformCollision; IL_Wiring.HitWireSingle += AddTwinklersToStatue; On_Player.UpdateItemDye += FindCalamityItemDyeShader; On_AWorldListItem.GetDifficulty += GetDifficultyOverride; On_Item.GetShimmered += ShimmerEffectEdits; On_Player.Teleport += TPOverride; - On_NPC.SpawnBoss += TripletsSpawnTextOverride; - On_NPC.DoDeathEvents_BeforeLoot += PreventFoveanatorDefeatMessageIfNotKilledLast; - On_NPC.DoDeathEvents_CelebrateBossDeath += TripletsDefeatTextOverride; On_TileDrawing.DrawSingleTile += GlowMaskTileRender; On_Main.DoUpdate_HandleChat += SpawnPunchCard; On_Player.PlaceThing_CannonBall += AllowCannonJellyfishUse; @@ -177,7 +172,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; @@ -201,6 +195,8 @@ namespace CalamityMod.ILEditing On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; On_ShimmerTransforms.IsItemTransformLocked += AdjustShimmerRequirements; On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity; + IL_Projectile.AI_061_FishingBobber += WhitelistVictideBobber; + On_Player.ItemCheck_CheckFishingBobbers += PreventVictideBobberFromJamming; IL_Projectile.CanExplodeTile += MakeMeteoriteExplodable; IL_Main.UpdateWindyDayState += MakeWindyDayMusicPlayLessOften; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index ac861e5df4..faa7aa39ad 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; @@ -79,7 +80,7 @@ namespace CalamityMod.ILEditing //private static readonly MethodInfo textureGetValueMethod = typeof(Asset).GetMethod("get_Value", BindingFlags.Public | BindingFlags.Instance); #region Punch Card Spawning Command - private static void SpawnPunchCard(Terraria.On_Main.orig_DoUpdate_HandleChat orig) + private static void SpawnPunchCard(On_Main.orig_DoUpdate_HandleChat orig) { // Any of these conditions should result in normal behaviour if (!Main.drawingPlayerChat || Main.CurrentInputTextTakerOverride != null || Main.editSign || PlayerInput.UsingGamepad) @@ -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 @@ -282,7 +264,7 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldc_I4, 10 - BalancingConstants.ShieldOfCthulhuBonkNoCollideFrames); } - private static void ApplyDashKeybind(Terraria.On_Player.orig_DoCommonDashHandle orig, Player self, out int dir, out bool dashing, Player.DashStartAction dashStartAction) + private static void ApplyDashKeybind(On_Player.orig_DoCommonDashHandle orig, Player self, out int dir, out bool dashing, Player.DashStartAction dashStartAction) { // we feasting multiplayer bugs if (self.whoAmI != Main.myPlayer) @@ -331,46 +313,68 @@ namespace CalamityMod.ILEditing self.dashTime = 0; } } - #endregion - #region Allow Empress to Enrage in Boss Rush - private static bool AllowEmpressToEnrageInBossRush(Terraria.On_NPC.orig_ShouldEmpressBeEnraged orig) + private static void DisableDoubleTapOnConfig(On_Player.orig_KeyDoubleTap orig, Player self, int keyDir) { - if (BossRushEvent.BossRushActive) - return true; + if (self.whoAmI != Main.myPlayer) + { + orig(self, keyDir); + return; + } - return orig(); + 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 - private static void PreventVanillaBossDeathsInBossRush(On_NPC.orig_DoDeathEvents orig, NPC self, Player closestPlayer) + private static void PreventVanillaBossDeathsInBossRush(ILContext il) { - // Aside from setting the boss' downed bool, DoDeathEvents also handles the following tasks: - // Advancing Slime Rain, spawning Dungeon Spirits, advancing invasion kills, spawning Wall of Flesh's loot box, dropping boss potions and hearts, and sending the boss defeated message. - // The first three do not matter at all in Boss Rush. Wall of Flesh's loot box not spawning is also a positive, so that it doesn't clutter the Underworld. - // Dropping potions is worthless at this point, and Boss Rush is already a horribly balanced hellscape as is, so I'm not worried about hearts. - // As for the last one, well, if anyone actually notices that and cares about it, then I suppose we could make a more sophisticated IL edit. - if (BossRushEvent.BossRushActive) + // GOAL: Prevent vanilla boss defeated flags from getting set during Boss Rush. + // All of this is handled within a switch case directly in the DoDeathEvents function. + // Thus, the objective here is to add a branch past the entire switch case if it is Boss Rush. + var cursor = new ILCursor(il); + + // Move to the point right before the switch case. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("SpawnOnPlayer"))) + { + LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to before the switch case."); return; + } - orig(self, closestPlayer); + // Define a branch label, load the Boss Rush check, and create the branch if it is true. + var label = il.DefineLabel(); + cursor.Emit(OpCodes.Ldsfld, typeof(BossRushEvent).GetField("BossRushActive")); + cursor.Emit(OpCodes.Brtrue, label); + + // Move to after the switch case to place the label. + for (int i = 0; i < 2; i++) + { + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("SpawnBoss"))) + { + LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to after the switch case."); + return; + } + } + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdarg0())) + { + LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to after the switch case."); + return; + } + cursor.MarkLabel(label); } - #endregion Prevent Vanilla Bosses From Being Marked as Defeated in Boss Rush + #endregion - #region Enabling of Triggered NPC Platform Fallthrough - // Why this isn't a mechanism provided by TML itself or vanilla itself is beyond me. - private static void AllowTriggeredFallthrough(Terraria.On_NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight) + #region Enabling of Fusion Feeder Sand Digging + private static void AllowFusionFeederToDigThroughSand(On_NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight) { if (self.active && self.type == ModContent.NPCType()) { self.velocity = Collision.AdvancedTileCollision(TileID.Sets.ForAdvancedCollision.ForSandshark, cPosition, self.velocity, cWidth, cHeight, fall, fall, 1); return; } - var isNpcValid = self.TryGetGlobalNPC(out CalamityGlobalNPC npc); //why the fuck this errors is anybody's guess, it absolutely shouldn't and yet it does - if (isNpcValid && self.active && npc.ShouldFallThroughPlatforms) - fall = true; - orig(self, fall, cPosition, cWidth, cHeight); } #endregion @@ -398,7 +402,7 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ret); } - private static void AlterTownNPCSpawnRate(Terraria.On_Main.orig_UpdateTime_SpawnTownNPCs orig) + private static void AlterTownNPCSpawnRate(On_Main.orig_UpdateTime_SpawnTownNPCs orig) { double oldWorldRate = Main.desiredWorldTilesUpdateRate; Main.desiredWorldTilesUpdateRate *= CalamityServerConfig.Instance.TownNPCSpawnRateMultiplier; @@ -483,7 +487,7 @@ namespace CalamityMod.ILEditing #endregion #region Custom Gate Door Logic - private static bool OpenDoor_LabDoorOverride(Terraria.On_WorldGen.orig_OpenDoor orig, int i, int j, int direction) + private static bool OpenDoor_LabDoorOverride(On_WorldGen.orig_OpenDoor orig, int i, int j, int direction) { Tile tile = Main.tile[i, j]; @@ -499,7 +503,7 @@ namespace CalamityMod.ILEditing return orig(i, j, direction); } - private static bool CloseDoor_LabDoorOverride(Terraria.On_WorldGen.orig_CloseDoor orig, int i, int j, bool forced) + private static bool CloseDoor_LabDoorOverride(On_WorldGen.orig_CloseDoor orig, int i, int j, bool forced) { Tile tile = Main.tile[i, j]; @@ -516,20 +520,8 @@ namespace CalamityMod.ILEditing } #endregion - #region Platform Collision Checks for Grounded Bosses - private static bool EnableCalamityBossPlatformCollision(Terraria.On_NPC.orig_Collision_DecideFallThroughPlatforms orig, NPC self) - { - if ((self.type == ModContent.NPCType() || self.type == ModContent.NPCType() || self.type == ModContent.NPCType() || - self.type == ModContent.NPCType() || self.type == ModContent.NPCType()) && - self.target >= 0 && Main.player[self.target].position.Y > self.position.Y + self.height) - return true; - - return orig(self); - } - #endregion - #region Incorporate Enchantments in Item Names - private static string IncorporateEnchantmentInAffix(Terraria.On_Item.orig_AffixName orig, Item self) + private static string IncorporateEnchantmentInAffix(On_Item.orig_AffixName orig, Item self) { string result = orig(self); @@ -545,7 +537,7 @@ namespace CalamityMod.ILEditing #endregion #region Apply Projectile Variables Upon Creation - private static int IncorporateExtraProjectileVariables(Terraria.On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2) + private static int IncorporateExtraProjectileVariables(On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2) { // This is unfortunately not something that can be done via SetDefaults since owner is set // after that method is called. Doing it directly when the projectile is spawned appears to be the only reasonable way. @@ -613,7 +605,7 @@ namespace CalamityMod.ILEditing #endregion #region Apply Old Fashioned Damage to Miscellanous Hits - private static void ApplyOldFashionedDamageToMiscHits(Terraria.On_Player.orig_ApplyDamageToNPC orig, Player self, NPC npc, int damage, float knockback, int direction, bool crit = false, DamageClass? damageType = null, bool damageVariation = false) + private static void ApplyOldFashionedDamageToMiscHits(On_Player.orig_ApplyDamageToNPC orig, Player self, NPC npc, int damage, float knockback, int direction, bool crit = false, DamageClass? damageType = null, bool damageVariation = false) { if (self.Calamity().oldFashioned) damage = (int)(damage * OldFashioned.DamageBoostMultiplier); @@ -699,7 +691,7 @@ namespace CalamityMod.ILEditing #endregion #region Fire Cursor Effect for the Calamity Accessory - private static void UseCoolFireCursorEffect(Terraria.On_Main.orig_DrawCursor orig, Vector2 bonus, bool smart) + private static void UseCoolFireCursorEffect(On_Main.orig_DrawCursor orig, Vector2 bonus, bool smart) { Player player = Main.LocalPlayer; @@ -911,7 +903,7 @@ namespace CalamityMod.ILEditing #endregion #region General Particle Rendering - private static void DrawFusableParticles(Terraria.On_Main.orig_SortDrawCacheWorms orig, Main self) + private static void DrawFusableParticles(On_Main.orig_SortDrawCacheWorms orig, Main self) { DeathAshParticle.DrawAll(); @@ -921,7 +913,7 @@ namespace CalamityMod.ILEditing orig(self); } - private static void DrawForegroundParticles(Terraria.On_Main.orig_DrawInfernoRings orig, Main self) + private static void DrawForegroundParticles(On_Main.orig_DrawInfernoRings orig, Main self) { GeneralParticleHandler.DrawAllParticles(Main.spriteBatch); orig(self); @@ -1483,88 +1475,28 @@ namespace CalamityMod.ILEditing #endregion #region Statue Additions - /// - /// Change the following code sequence in Wiring.HitWireSingle - /// num8 = (int) Utils.SelectRandom(Main.rand, new short[2] - /// { - /// 355, - /// 358 - /// }); - /// - /// to - /// - /// var arr = new short[2] - /// { - /// 355, - /// 358 - /// }); - /// arr = arr.ToList().Add(id).ToArray(); - /// num8 = Utils.SelectRandom(Main.rand, arr); - /// - /// - /// private static void AddTwinklersToStatue(ILContext il) { - // obtain a cursor positioned before the first instruction of the method - // the cursor is used for navigating and modifying the il - var c = new ILCursor(il); + // Allow Twinklers to be spawned by the Firefly Statue. + var cursor = new ILCursor(il); - // the exact location for this hook is very complex to search for due to the hook instructions not being unique, and buried deep in control flow - // switch statements are sometimes compiled to if-else chains, and debug builds litter the code with no-ops and redundant locals - - // in general you want to search using structure and function rather than numerical constants which may change across different versions or compile settings - // using local variable indices is almost always a bad idea - - // we can search for - // switch (*) - // case 54: - // Utils.SelectRandom * - - // in general you'd want to look for a specific switch variable, or perhaps the containing switch (type) { case 105: - // but the generated IL is really variable and hard to match in this case - - // we'll just use the fact that there are no other switch statements with case 54, followed by a SelectRandom - - ILLabel[] targets = null; - while (c.TryGotoNext(i => i.MatchSwitch(out targets))) + // Move to the method which randomly selects an NPC for the Statue to spawn. This is the second call of the method in this function. + for (int i = 0; i < 2; i++) { - // some optimising compilers generate a sub so that all the switch cases start at 0 - // ldc.i4.s 51 - // sub - // switch - int offset = 0; - if (c.Prev.MatchSub() && c.Prev.Previous.MatchLdcI4(out offset)) + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCall(typeof(Utils), nameof(Utils.SelectRandom)))) { - ; + LogFailure("Add Twinkler to Firefly Statue", "Could not move to the SelectRandom method."); + return; } - - // get the label for case 54: if it exists - int case54Index = 54 - offset; - if (case54Index < 0 || case54Index >= targets.Length || !(targets[case54Index] is ILLabel target)) - { - continue; - } - - // move the cursor to case 54: - c.GotoLabel(target); - // there's lots of extra checks we could add here to make sure we're at the right spot, such as not encountering any branching instructions - c.GotoNext(i => i.MatchCall(typeof(Utils), nameof(Utils.SelectRandom))); - - // goto next positions us before the instruction we searched for, so we can insert our array modifying code right here - c.EmitDelegate>(arr => - { - // resize the array and add our custom firefly - Array.Resize(ref arr, arr.Length + 1); - arr[arr.Length - 1] = (short)ModContent.NPCType(); - return arr; - }); - - // hook applied successfully - return; } - // couldn't find the right place to insert - throw new Exception("Hook location not found, switch(*) { case 54: ..."); + // Emit a delegate which resizes the array and adds Twinkler to it. + cursor.EmitDelegate>(arr => + { + Array.Resize(ref arr, arr.Length + 1); + arr[arr.Length - 1] = (short)ModContent.NPCType(); + return arr; + }); } #endregion @@ -1624,7 +1556,7 @@ namespace CalamityMod.ILEditing /// /// Determines if the custom grapple movement should take place or not. Useful for hooks that only do movement tricks in some cases /// - private static void CustomGrappleMovementCheck(Terraria.On_Player.orig_GrappleMovement orig, Player self) + private static void CustomGrappleMovementCheck(On_Player.orig_GrappleMovement orig, Player self) { WulfrumPackPlayer mp = self.GetModPlayer(); @@ -1637,7 +1569,7 @@ namespace CalamityMod.ILEditing /// /// This is called right before the game decides wether or not to update the players velocity based on "real" physics (aka not tongued or hooked or with a pulley) /// - private static void CustomGrapplePreDefaultMovement(Terraria.On_Player.orig_UpdatePettingAnimal orig, Player self) + private static void CustomGrapplePreDefaultMovement(On_Player.orig_UpdatePettingAnimal orig, Player self) { orig(self); @@ -1661,7 +1593,7 @@ namespace CalamityMod.ILEditing /// Used before the player steps up a half tile. If we don't do that, players that are grappled but don't use hook movement won't be able to go over tiles. /// The hook cache is reset in PreUpdateMovement /// - private static void CustomGrapplePreStepUp(Terraria.On_Player.orig_SlopeDownMovement orig, Player self) + private static void CustomGrapplePreStepUp(On_Player.orig_SlopeDownMovement orig, Player self) { orig(self); @@ -1675,9 +1607,9 @@ namespace CalamityMod.ILEditing } /// - /// This is done to put the hook if it was cacehd during the frame instruction. + /// This is done to put the hook if it was cached during the frame instruction. /// - private static void CustomGrapplePostFrame(Terraria.On_Player.orig_PlayerFrame orig, Player self) + private static void CustomGrapplePostFrame(On_Player.orig_PlayerFrame orig, Player self) { orig(self); WulfrumPackPlayer mp = self.GetModPlayer(); @@ -1694,7 +1626,7 @@ namespace CalamityMod.ILEditing #region Find Calamity Item Dye Shader - internal static void FindCalamityItemDyeShader(Terraria.On_Player.orig_UpdateItemDye orig, Player self, bool isNotInVanitySlot, bool isSetToHidden, Item armorItem, Item dyeItem) + internal static void FindCalamityItemDyeShader(On_Player.orig_UpdateItemDye orig, Player self, bool isNotInVanitySlot, bool isSetToHidden, Item armorItem, Item dyeItem) { orig(self, isNotInVanitySlot, isSetToHidden, armorItem, dyeItem); if (armorItem.type == ModContent.ItemType()) @@ -1727,7 +1659,7 @@ namespace CalamityMod.ILEditing #endregion #region Custom world selection difficulties - internal static void GetDifficultyOverride(Terraria.GameContent.UI.Elements.On_AWorldListItem.orig_GetDifficulty orig, AWorldListItem self, out string expertText, out Color gameModeColor) + internal static void GetDifficultyOverride(On_AWorldListItem.orig_GetDifficulty orig, AWorldListItem self, out string expertText, out Color gameModeColor) { // Run the original code and pull out the original text and text color orig(self, out expertText, out gameModeColor); @@ -1762,7 +1694,7 @@ namespace CalamityMod.ILEditing #endregion #region Shimmer effect edits - public static void ShimmerEffectEdits(Terraria.On_Item.orig_GetShimmered orig, Item self) + public static void ShimmerEffectEdits(On_Item.orig_GetShimmered orig, Item self) { // Make Plagued Containment Bricks turn into Plagued Nanodroids if shimmered before defeating Golem if (self.type == ModContent.ItemType()) @@ -1805,7 +1737,7 @@ namespace CalamityMod.ILEditing #region Block Abyss from Teleportation Potions - public static void TPOverride(Terraria.On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0) + public static void TPOverride(On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0) { // Grab the tile from where the potion wants to teleport Tile t = CalamityUtils.ParanoidTileRetrieval(newPos.ToTileCoordinates().X, newPos.ToTileCoordinates().Y); @@ -1849,67 +1781,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Revengeance Master Mode Twins Shenanigans - public static void TripletsSpawnTextOverride(Terraria.On_NPC.orig_SpawnBoss orig, int x, int y, int type, int targetPlayerIndex) - { - if (CalamityWorld.death && type == NPCID.Retinazer) - { - int retinazerIndex = NPC.NewNPC(NPC.GetBossSpawnSource(targetPlayerIndex), x, y, type, 1); - if (retinazerIndex == 200) - { - return; - } - Main.npc[retinazerIndex].target = targetPlayerIndex; - Main.npc[retinazerIndex].timeLeft *= 20; - - if (Main.dedServ && retinazerIndex < 200) - { - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, retinazerIndex); - } - - AchievementsHelper.CheckMechaMayhem(); - - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.TripletsBossText", new Color(175, 75, 255)); - return; - } - else - { - orig(x, y, type, targetPlayerIndex); - } - } - - public static void PreventFoveanatorDefeatMessageIfNotKilledLast(On_NPC.orig_DoDeathEvents_BeforeLoot orig, NPC self, Player closestPlayer) - { - if (CalamityWorld.death && self.type == ModContent.NPCType() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer))) - { - self.value = 0f; - self.boss = false; - return; - } - else - { - orig(self, closestPlayer); - } - } - - public static void TripletsDefeatTextOverride(On_NPC.orig_DoDeathEvents_CelebrateBossDeath orig, NPC self, string typeName) - { - bool correctNPCType = self.type == NPCID.Retinazer || self.type == NPCID.Spazmatism || self.type == ModContent.NPCType(); - if (CalamityWorld.death && correctNPCType) - { - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", CalamityUtils.GetTextValue("Status.Boss.TripletsDefeatName")), 175, 75, 255); - else if (Main.dedServ) - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", NetworkText.FromKey("Mods.CalamityMod.Status.Boss.TripletsDefeatName")), new Color(175, 75, 255)); - return; - } - else - { - orig(self, typeName); - } - } - #endregion - #region Optimized GlowMask Rendering on Tile private static void GlowMaskTileRender(On_TileDrawing.orig_DrawSingleTile orig, TileDrawing self, TileDrawInfo drawData, bool solidLayer, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY) { @@ -1974,7 +1845,7 @@ namespace CalamityMod.ILEditing #endregion #region Allow Cannons to use jellyfish - public static void AllowCannonJellyfishUse(Terraria.On_Player.orig_PlaceThing_CannonBall orig, Player self) + public static void AllowCannonJellyfishUse(On_Player.orig_PlaceThing_CannonBall orig, Player self) { // Check if the player is holding a jelly if (self.HeldItem.type == ModContent.ItemType()) @@ -2085,7 +1956,7 @@ namespace CalamityMod.ILEditing #endregion #region Add Stohne to the Jungle - public static void AddStohne(Terraria.GameContent.Biomes.On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY) + public static void AddStohne(On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY) { int anchorX = oldX; int anchorY = oldY; @@ -2629,7 +2500,7 @@ namespace CalamityMod.ILEditing #endregion #region Make Celestial Onion give the Master Mode slot - public static bool MasterModeCelestialOnionCheck(Terraria.On_Player.orig_IsItemSlotUnlockedAndUsable orig, Player self, int slot) + public static bool MasterModeCelestialOnionCheck(On_Player.orig_IsItemSlotUnlockedAndUsable orig, Player self, int slot) { if ((slot == 9 || slot == 19) && self.Calamity().extraAccessoryML && !Main.gameMenu) { diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index d3f3c0cc40..83ee5fc55a 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -8,6 +8,7 @@ using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.Projectiles.Typeless; using CalamityMod.Walls; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -18,7 +19,7 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Drawing; -using Terraria.GameContent.Personalities; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.Graphics.Effects; @@ -154,7 +155,7 @@ namespace CalamityMod.ILEditing #endregion #region Prevention of Slime Rain Spawns When Near Bosses - private static void PreventBossSlimeRainSpawns(Terraria.On_NPC.orig_SlimeRainSpawns orig, int plr) + private static void PreventBossSlimeRainSpawns(On_NPC.orig_SlimeRainSpawns orig, int plr) { if (!Main.player[plr].Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen) orig(plr); @@ -307,13 +308,15 @@ namespace CalamityMod.ILEditing LogFailure("Prevent Fossil Shattering", "Could not locate the Desert Fossil Tile ID variable."); return; } + + // Remove this value and replace it with a large number that will never be a valid tile ID. cursor.Remove(); - cursor.Emit(OpCodes.Ldc_I4, TileID.PixelBox); // Change to Pixel Box because it cannot be obtained in-game without cheating. + cursor.Emit(OpCodes.Ldc_I4, 40000); } #endregion #region Remove Hellforge Pickaxe Requirement - private static int RemoveHellforgePickaxeRequirement(Terraria.On_Player.orig_GetPickaxeDamage orig, Player self, int x, int y, int pickPower, int hitBufferIndex, Tile tileTarget) + private static int RemoveHellforgePickaxeRequirement(On_Player.orig_GetPickaxeDamage orig, Player self, int x, int y, int pickPower, int hitBufferIndex, Tile tileTarget) { if (tileTarget.TileType == TileID.Hellforge) pickPower = 65; @@ -331,9 +334,58 @@ namespace CalamityMod.ILEditing } #endregion - #region Fix Chlorophyte Crystal Attacking Where it Shouldn't - // TODO -- Finish this - #endregion Fix Chlorophyte Crystal Attacking Where it Shouldn't + #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) @@ -367,7 +419,7 @@ namespace CalamityMod.ILEditing #endregion Prevent UFO Mount from Dismounting in Water #region Color Blighted Gel - private static void ColorBlightedGel(Terraria.GameContent.ItemDropRules.On_CommonCode.orig_ModifyItemDropFromNPC orig, NPC npc, int itemIndex) + private static void ColorBlightedGel(On_CommonCode.orig_ModifyItemDropFromNPC orig, NPC npc, int itemIndex) { orig(npc, itemIndex); @@ -393,7 +445,7 @@ namespace CalamityMod.ILEditing #endregion Color Blighted Gel #region Improve Angler Quest Rewards - private static void ImproveAnglerRewards(Terraria.On_Player.orig_GetAnglerReward orig, Player self, NPC angler, int questItemType) + private static void ImproveAnglerRewards(On_Player.orig_GetAnglerReward orig, Player self, NPC angler, int questItemType) { orig(self, angler, questItemType); @@ -1082,7 +1134,7 @@ namespace CalamityMod.ILEditing var cursor = new ILCursor(il); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("magmaStone"))) // Flag for if Magma Stone is equipped. Fire Gauntlet also uses this. { - LogFailure("Make Magma Stone & Fire Gauntlet Dust Toggleable", "Could not locate the magma stone variable."); + LogFailure("Make Magma Stone & Fire Gauntlet Dust Toggleable", "Could not locate the Magma Stone variable."); return; } // Load the player itself onto the stack so that it becomes an argument for the following delegate. @@ -1127,7 +1179,7 @@ namespace CalamityMod.ILEditing } // Remove the instruction and replace with 1 (true). This effectively removes the requirement for defeating Plantera. - // The only requirements for summoning Golems with Power Cells are now: 1) Golem is not alive, and 2) The world is in Hardmode. + // The only requirements for summoning Golem with Power Cells are now: 1) Golem is not alive, and 2) The world is in Hardmode. cursor.EmitPop(); cursor.Emit(OpCodes.Ldc_I4_1); } @@ -1180,7 +1232,7 @@ namespace CalamityMod.ILEditing return; } - // branch is used for exit condition. So setting ble.s opcode to nop will remove the condition + // Branch is used for exit condition. So setting ble.s opcode to nop will remove the condition cursor.Prev.OpCode = OpCodes.Nop; // After that we pop NPC.damage and 0 from stack @@ -1224,7 +1276,7 @@ namespace CalamityMod.ILEditing }*/ #endregion - #region Allow disabling gravity swap visual && allow gravity keybind + #region Allow Disabling Gravity Swap Visual and Allow Gravity Keybind private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player) { var cplay = Player.Calamity(); diff --git a/ILEditing/WorldgenILChanges.cs b/ILEditing/WorldgenILChanges.cs index 419d4c19f9..002c434ca3 100644 --- a/ILEditing/WorldgenILChanges.cs +++ b/ILEditing/WorldgenILChanges.cs @@ -8,6 +8,7 @@ using MonoMod.Cil; using Terraria; using Terraria.GameContent.UI.States; using Terraria.ID; +using Terraria.IO; using Terraria.WorldBuilding; namespace CalamityMod.ILEditing @@ -33,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) { @@ -66,7 +45,7 @@ namespace CalamityMod.ILEditing #endregion Fixing of Living Tree/Sulphurous Sea Interactions #region Removal of Hardmode Ore Generation from Evil Altars - private static void PreventSmashAltarCode(Terraria.On_WorldGen.orig_SmashAltar orig, int i, int j) + private static void PreventSmashAltarCode(On_WorldGen.orig_SmashAltar orig, int i, int j) { if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework) return; @@ -135,10 +114,8 @@ namespace CalamityMod.ILEditing return; } - // Pop original value off. + // Pop original value off. Push '2' to the stack. c.Emit(OpCodes.Pop); - - // Push '2' to the stack. c.Emit(OpCodes.Ldc_I4_2); // OBJECTIVE 2 @@ -181,13 +158,11 @@ namespace CalamityMod.ILEditing // Emit our new string "Mods.CalamityMod.UI.SmallWorldWarning". c.Emit(OpCodes.Ldstr, "Mods.CalamityMod.UI.SmallWorldWarning"); - - } #endregion #region Clear temporary modded tiles - private static void ClearModdedTempTiles(Terraria.IO.On_WorldFile.orig_ClearTempTiles orig) + private static void ClearModdedTempTiles(On_WorldFile.orig_ClearTempTiles orig) { orig(); diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index 17b15c0aba..6f2c4936cf 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -1,30 +1,29 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class AbyssalDivingSuit : ModItem, ILocalizedModType + public class AbyssalDivingSuit : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public static double PlatesAllDamageReduction = 0.15D; public static double PlatesHitDecay = 0.03D; - public override void Load() - { - // All code below runs only if we're not loading on a server - if (!Main.dedServ) - { - // Add equip textures - EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Head}", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Body}", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Legs}", EquipType.Legs, this); - } - } + public override string AssetPath => "CalamityMod/Items/Accessories/"; + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "AbyssalDivingSuit", null), + (EquipType.Body, "AbyssalDivingSuit", null), + (EquipType.Legs, "AbyssalDivingSuit", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; + + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.NPCHit4, 10); public override void SetDefaults() { @@ -33,32 +32,9 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; - - if (!Main.dedServ) - { - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } } - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.abyssalDivingSuit = true; - if (hideVisual) - modPlayer.abyssalDivingSuitHide = true; - } - - public override void UpdateVanity(Player player) - { - player.Calamity().abyssalDivingSuitHide = false; - player.Calamity().abyssalDivingSuitForce = true; - } + public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().abyssalDivingSuit = true; public override void AddRecipes() { diff --git a/Items/Accessories/AquaticHeart.cs b/Items/Accessories/AquaticHeart.cs index 5c5f1de826..25c761394a 100644 --- a/Items/Accessories/AquaticHeart.cs +++ b/Items/Accessories/AquaticHeart.cs @@ -1,45 +1,30 @@ -using System; -using System.Collections.Generic; -using CalamityMod.CalPlayer; +using System.Collections.Generic; +using CalamityMod.Items.BaseItems; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { [LegacyName("SirensHeart")] - public class AquaticHeart : ModItem, ILocalizedModType + public class AquaticHeart : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public static float WaterSpeedBoost = 0.15f; public static double IceShieldAllDamageReduction = 0.2D; - public override void Load() - { - // All code below runs only if we're not loading on a server - if (!Main.dedServ) - { - // Add equip textures - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Legs", EquipType.Legs, this); - } - } + public override string AssetPath => "CalamityMod/Items/Accessories/"; + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "AquaticTrans", null), + (EquipType.Body, "AquaticTrans", null), + (EquipType.Legs, "AquaticTrans", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; - public override void SetStaticDefaults() - { - if (!Main.dedServ) - { - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } - } + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.FemaleHit, 10); public override void SetDefaults() { @@ -50,19 +35,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.LightRed; } - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.aquaticHeart = true; - if (hideVisual) - modPlayer.aquaticHeartHide = true; - } - - public override void UpdateVanity(Player player) - { - player.Calamity().aquaticHeartHide = false; - player.Calamity().aquaticHeartForce = true; - } + public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().aquaticHeart = true; public override void ModifyTooltips(List tooltips) { 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/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/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/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/GloveofPrecision.cs b/Items/Accessories/GloveofPrecision.cs index 9cb6f21173..81a152d40d 100644 --- a/Items/Accessories/GloveofPrecision.cs +++ b/Items/Accessories/GloveofPrecision.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.gloveOfPrecision = true; player.GetDamage() += 0.10f; - player.GetCritChance() += 15; + player.GetCritChance() += 10; modPlayer.rogueVelocity += 0.15f; player.GetAttackSpeed() -= 0.15f; } 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/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 6ed93531bb..955e945460 100644 --- a/Items/Accessories/InkBomb.cs +++ b/Items/Accessories/InkBomb.cs @@ -21,6 +21,9 @@ 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; } } } 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/Nanotech.cs b/Items/Accessories/Nanotech.cs index d2137c38ed..8d9774a8a0 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Items.Accessories { public class Nanotech : ModItem, ILocalizedModType { + //The stealth damage boost is handled in CalamityPlayer for some reason, maybe someone didn't want em to stack? public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { 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 a62a6fa4f7..e1c0f21cfd 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -5,7 +5,9 @@ using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.Summon.Whips; using CalamityMod.CalPlayer; using CalamityMod.DataStructures; +using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using CalamityMod.Projectiles.Summon; @@ -23,10 +25,10 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { //Developer item, dedicatee: Mishiro Usui/Amber Sienna - public class ProfanedSoulCrystal : ModItem, ILocalizedModType, IDyeableShaderRenderer + 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); @@ -104,7 +106,7 @@ namespace CalamityMod.Items.Accessories if (ignoreNoBuffs && (!DownedBossSystem.downedCalamitas || !DownedBossSystem.downedExoMechs || (player.maxMinions - player.slotsMinions) < maxMinionRequirement) || - player.Calamity().profanedCrystalForce || !player.HasBuff()) + player.Transformation().Type == ModContent.ItemType() || !player.HasBuff()) { return ProfanedSoulCrystalState.Vanity; //failsafe for vanity } @@ -178,28 +180,22 @@ namespace CalamityMod.Items.Accessories * Projectiles transformed are ONLY affected by alldamage and summon damage bonuses, likewise the weapon's base damage/usetime is NOT taken into account. * The on-hit effect for the whip is in globalnpc */ - public override void Load() + public override string AssetPath => "CalamityMod/Items/Accessories/"; + + public override (EquipType Type, string AssetName, string EquipName)[] EquipSlots => + [ + (EquipType.Head, "ProfanedSoulTrans", null), + (EquipType.Body, "ProfanedSoulTrans", null), + (EquipType.Legs, "ProfanedSoulTrans", null), + (EquipType.Wings, "ProfanedSoulTrans", null), + (EquipType.Head, "ProfanedSoulTransNight", "PscNightHead"), + (EquipType.Legs, "ProfanedSoulTransNight", "PscNightLegs"), + (EquipType.Wings, "ProfanedSoulTransNight", "PscNightWings"), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; + + public override void ArmorIDSets() { - if (Main.dedServ) - return; - - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHead", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHeadNight", EquipType.Head, this, "PscNightHead"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransBody", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegs", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegsNight", EquipType.Legs, this, "PscNightLegs"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWings", EquipType.Wings, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWingsNight", EquipType.Wings, this, "PscNightWings"); - } - - public override void SetStaticDefaults() - { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); - ItemID.Sets.AnimatesAsSoul[Type] = true; - - if (Main.dedServ) - return; - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; @@ -213,6 +209,16 @@ namespace CalamityMod.Items.Accessories ArmorIDs.Legs.Sets.OverridesLegs[equipSlotNightLegs] = true; } + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (p.Calamity().pSoulShieldDurability > 0 ? ProfanedGuardianDefender.ShieldDeathSound : Providence.HurtSound, 20); + + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; + + base.SetStaticDefaults(); + } + public override void SetDefaults() { SummonTag.TagItem = Item.type; @@ -225,10 +231,7 @@ namespace CalamityMod.Items.Accessories Item.Calamity().devItem = true; } - public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) - { - return incomingItem.type != ModContent.ItemType(); - } + public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) => incomingItem.type != ModContent.ItemType(); public override void ModifyTooltips(List tooltips) { @@ -260,12 +263,30 @@ namespace CalamityMod.Items.Accessories } } + public override bool CustomSetEquipType(Player player, EquipType type, Mod mod, string name) + { + switch (type) + { + case EquipType.Legs: + player.legs = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightLegs", type); + return true; + case EquipType.Head: + player.head = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightHead", type); + return true; + case EquipType.Wings: + player.wings = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightWings", type); + return true; + } + return false; + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.pSoulArtifact = true; modPlayer.profanedCrystal = true; + if (!modPlayer.profanedCrystalPrevious && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) { modPlayer.pSoulShieldDurability = 1; @@ -275,23 +296,15 @@ namespace CalamityMod.Items.Accessories if (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs) player.Calamity().profanedSoulRelicBuff = true; - modPlayer.profanedCrystalHide = hideVisual || modPlayer.profanedCrystalAnim > 0; modPlayer.pSoulShieldVisible = !hideVisual; DetermineTransformationEligibility(player); } - public override void UpdateVanity(Player player) - { - player.Calamity().profanedCrystalHide = false; - player.Calamity().profanedCrystalForce = true; - } - internal static void DetermineTransformationEligibility(Player player) { //short circuit immediately if profanedcrystalbuffs has already been set - - if (!player.Calamity().profanedCrystalBuffs && player.Calamity().profanedCrystalAnim == -1 && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && !player.Calamity().profanedCrystalForce && player.HasBuff()) + if (!player.Calamity().profanedCrystalBuffs && player.Calamity().profanedCrystalAnim == -1 && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && player.HasBuff()) { player.Calamity().profanedCrystalBuffs = true; player.Calamity().pscState = (int)GetPscStateFor(player); //update psc state, default is 0 which is the same as the int value of vanity @@ -535,6 +548,86 @@ namespace CalamityMod.Items.Accessories return false; } + public override void TransformFrameEffects(Player player) + { + bool enrage = player.Calamity().pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged; + + if (profanedCrystalWingCounter.Value == 0) + { + int key = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 8); + } + + player.wingFrame = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1); + player.armorEffectDrawOutlines = true; + if (player.Calamity().profanedCrystalBuffs) + { + player.armorEffectDrawShadow = true; + if (enrage) + { + player.armorEffectDrawOutlinesForbidden = true; + } + } + } + + public KeyValuePair profanedCrystalWingCounter = new KeyValuePair(1, 10); + public KeyValuePair profanedCrystalAnimCounter = new KeyValuePair(0, 10); + + private bool IsValidTransitionFrame(AnimationType currentAnim, AnimationType newAnim, int frame, int counter) //this exists so it doesn't loop through the entire walk/idle anim just to find one frame for switching. + { + bool result = newAnim != AnimationType.Jump && currentAnim != AnimationType.Jump; + if (currentAnim == AnimationType.Walk && newAnim == AnimationType.Idle) + { + result = counter <= 0 && (frame == 11 || frame == 15 || frame == 19); + } + else if (currentAnim == AnimationType.Idle && newAnim == AnimationType.Walk) + { + result = counter <= 0 && (frame == 2 || frame == 6); + } + return currentAnim != newAnim && result; //swapping to jumps should be instant, no need to check the counter here + } + + private int HandlePSCAnimationFrames(Player player, AnimationType newType) + { + int key = profanedCrystalAnimCounter.Key; //0-based indexing + int value = profanedCrystalAnimCounter.Value - 1; + AnimationType currentType = key < 8 ? AnimationType.Idle : key == 8 ? AnimationType.Jump : AnimationType.Walk; + + bool isInvalidTransFrame = !IsValidTransitionFrame(currentType, newType, key, value); //to make the transition between walk and idle frames less jarring and smoother + AnimationType type = isInvalidTransFrame ? newType : currentType; + int frameCount = type == AnimationType.Walk || (player.Calamity().profanedCrystal && player.statLife <= (int)(player.statLifeMax2 * 0.5)) ? 7 : 10; + int lowerRange = type == AnimationType.Idle ? 0 : type == AnimationType.Jump ? 8 : 9; + int upperRange = type == AnimationType.Idle ? 7 : type == AnimationType.Jump ? 8 : 22; + if (value <= 0 || !isInvalidTransFrame) + { + value = frameCount; + if (key >= lowerRange && key < upperRange) + key++; + else + key = lowerRange; + } + profanedCrystalAnimCounter = new KeyValuePair(key, value); + return profanedCrystalAnimCounter.Key; + } + + public override void TransformPostUpdate(Player player) + { + bool validEquipSlot = player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) || + player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs); + if (player.Transformation().Type == ModContent.ItemType() && validEquipSlot) + { + bool usingCarpet = player.carpetTime > 0 && player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground + AnimationType animType = AnimationType.Walk; + if ((player.sliding || player.velocity.Y != 0 || player.mount.Active || (player.grappling[0] != -1 || !player.CheckSolidGround()) || player.GoingDownWithGrapple) && !usingCarpet) + animType = AnimationType.Jump; + else if (player.velocity.X == 0 || usingCarpet) + animType = AnimationType.Idle; + int frame = HandlePSCAnimationFrames(player, animType); + player.legFrame.Y = player.legFrame.Height * frame; + } + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Accessories/ProfanedSoulTransHeadNight.png b/Items/Accessories/ProfanedSoulTransNight_Head.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransHeadNight.png rename to Items/Accessories/ProfanedSoulTransNight_Head.png diff --git a/Items/Accessories/ProfanedSoulTransLegsNight.png b/Items/Accessories/ProfanedSoulTransNight_Legs.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransLegsNight.png rename to Items/Accessories/ProfanedSoulTransNight_Legs.png diff --git a/Items/Accessories/Wings/ProfanedSoulTransWingsNight.png b/Items/Accessories/ProfanedSoulTransNight_Wings.png similarity index 100% rename from Items/Accessories/Wings/ProfanedSoulTransWingsNight.png rename to Items/Accessories/ProfanedSoulTransNight_Wings.png diff --git a/Items/Accessories/ProfanedSoulTransBody.png b/Items/Accessories/ProfanedSoulTrans_Body.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransBody.png rename to Items/Accessories/ProfanedSoulTrans_Body.png diff --git a/Items/Accessories/ProfanedSoulTransHead.png b/Items/Accessories/ProfanedSoulTrans_Head.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransHead.png rename to Items/Accessories/ProfanedSoulTrans_Head.png diff --git a/Items/Accessories/ProfanedSoulTransLegs.png b/Items/Accessories/ProfanedSoulTrans_Legs.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransLegs.png rename to Items/Accessories/ProfanedSoulTrans_Legs.png diff --git a/Items/Accessories/Wings/ProfanedSoulTransWings.png b/Items/Accessories/ProfanedSoulTrans_Wings.png similarity index 100% rename from Items/Accessories/Wings/ProfanedSoulTransWings.png rename to Items/Accessories/ProfanedSoulTrans_Wings.png 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/Regenator.cs b/Items/Accessories/Regenerator.cs similarity index 85% rename from Items/Accessories/Regenator.cs rename to Items/Accessories/Regenerator.cs index f8bdcbf180..ea319a1373 100644 --- a/Items/Accessories/Regenator.cs +++ b/Items/Accessories/Regenerator.cs @@ -9,7 +9,8 @@ using System; namespace CalamityMod.Items.Accessories { - public class Regenator : ModItem, ILocalizedModType + [LegacyName("Regenator")] + public class Regenerator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() @@ -24,14 +25,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.regenator = true; + modPlayer.regenerator = true; player.longInvince = true; // Gives better iframes because god help you if you end up getting hit twice } public override void ModifyTooltips(List list) { if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", (Main.LocalPlayer.Calamity().regenatorDamage).ToPercent()); + list.FindAndReplace("[DAMAGE]", (Main.LocalPlayer.Calamity().regeneratorDamage).ToPercent()); } } } diff --git a/Items/Accessories/Regenator.png b/Items/Accessories/Regenerator.png similarity index 100% rename from Items/Accessories/Regenator.png rename to Items/Accessories/Regenerator.png diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index e92c7f11de..02c781c7df 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -35,13 +35,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimstoneWaifu = true; + modPlayer.brimElemental = true; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { @@ -58,13 +58,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimstoneWaifuVanity = true; + modPlayer.brimElementalVanity = true; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/RottenDogtooth.cs b/Items/Accessories/RottenDogtooth.cs index 7dad00cdc3..d38dba206d 100644 --- a/Items/Accessories/RottenDogtooth.cs +++ b/Items/Accessories/RottenDogtooth.cs @@ -8,7 +8,6 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; internal const int ArmorCrunchDebuffTime = 150; - internal const float StealthStrikeDamageMultiplier = 0.08f; public override void SetDefaults() { Item.width = 14; @@ -21,7 +20,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().rottenDogTooth = true; - player.Calamity().bonusStealthDamage += StealthStrikeDamageMultiplier; } } } diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index 1289b42d86..bc9c49a36c 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -27,9 +27,6 @@ namespace CalamityMod.Items.Accessories public static int ShieldDurabilityMax = 20; public static int ShieldRechargeTime = CalamityUtils.SecondsToFrames(10); - // While active, Rover Drive gives 10 defense - public static int ShieldDefenseBoost = 10; - // Interface stuff. public int OwnerPlayer { get; set; } public float RenderDepth => IDyeableShaderRenderer.RoverDriveDepth; @@ -78,9 +75,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/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index cacb484ead..798f0c4020 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -73,8 +73,10 @@ namespace CalamityMod.Items.Accessories continue; // Inflict Riptide on empowered parries. + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds if (empowered) - npc.AddBuff(ModContent.BuffType(), 300); + npc.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); // If the NPC can be moved, violently shove them away. Make them susceptible to fall damage on empowered parries. // Otherwise, simply deal a large amount of damage to them if empowered. 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/StatMeter.cs b/Items/Accessories/StatMeter.cs index 931dd0c47e..10edb5b418 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -223,7 +223,6 @@ namespace CalamityMod.Items.Accessories // Detailed Abyss stats only render if the player is in the Abyss. string stats4 = "\n" + (!modPlayer.ZoneAbyss ? this.GetLocalizedValue("AbyssStatsHidden") : this.GetLocalization("AbyssStats").Format( player.GetCurrentAbyssLightLevel(), - TwoPlaces(modPlayer.abyssBreathLossStat), TwoPlaces(modPlayer.abyssBreathLossRateStat), modPlayer.abyssLifeLostAtZeroBreathStat, modPlayer.abyssDefenseLossStat)); diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index 2b2e35e978..a054aba516 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -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..6c1c3ee7e9 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -32,12 +32,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 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; + // While active, The Sponge gives 10% DR public static float ShieldActiveDamageReduction = 0.1f; public int OwnerPlayer { get; set; } @@ -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/VampiricTalisman.cs b/Items/Accessories/VampiricTalisman.cs index d5d2f6e118..eb0800a9db 100644 --- a/Items/Accessories/VampiricTalisman.cs +++ b/Items/Accessories/VampiricTalisman.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Items.Accessories { internal const int ArmorCrunchDebuffTime = 150; internal const int HeavyBleedingDebuffTime = 300; - internal const float StealthStrikeDamageMultiplier = 0.08f; public const float RaiderBonus = 15f; public bool ShowExtensionIndicator => false; @@ -36,7 +35,6 @@ namespace CalamityMod.Items.Accessories modPlayer.vampiricTalisman = true; modPlayer.raiderTalisman = true; modPlayer.rottenDogTooth = true; - player.Calamity().bonusStealthDamage += StealthStrikeDamageMultiplier; //get fixed boi funny if (Main.zenithWorld) diff --git a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs index ae04d03443..abcdf74751 100644 --- a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs +++ b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs @@ -1,8 +1,6 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; using Terraria; using Terraria.Audio; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -20,35 +18,19 @@ namespace CalamityMod.Items.Accessories.Vanity [LegacyName("WulfrumHeadMelee")] [LegacyName("WulfrumHood")] [LegacyName("WulfrumHeadMagic")] - public class AbandonedWulfrumHelmet : ModItem, ILocalizedModType + public class AbandonedWulfrumHelmet : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_HeadSet", EquipType.Head, name: "WulfrumOldSetHead"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_Legs", EquipType.Legs, this); - } - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "AbandonedWulfrumHelmetTrans", "WulfrumOldSetHead"), + (EquipType.Body, "AbandonedWulfrumHelmet", null), + (EquipType.Legs, "AbandonedWulfrumHelmet", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; + public override bool ShouldHideAccessories => true; - public override void SetStaticDefaults() - { - - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, "WulfrumOldSetHead", EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.NPCHit4, 10); public override void SetDefaults() { @@ -62,7 +44,6 @@ namespace CalamityMod.Items.Accessories.Vanity public override void UpdateVanity(Player player) { - player.GetModPlayer().transformationActive = true; player.GetModPlayer().vanityEquipped = true; } @@ -70,7 +51,6 @@ namespace CalamityMod.Items.Accessories.Vanity { if (!hideVisual) { - player.GetModPlayer().transformationActive = true; player.GetModPlayer().vanityEquipped = true; } } @@ -79,53 +59,10 @@ namespace CalamityMod.Items.Accessories.Vanity public class WulfrumTransformationPlayer : ModPlayer { public bool vanityEquipped = false; - public bool transformationActive = false; - public bool forceHelmetOn = false; public override void ResetEffects() { vanityEquipped = false; - transformationActive = false; - forceHelmetOn = false; - } - - public override void FrameEffects() - { - if (forceHelmetOn || transformationActive) - { - Player.head = EquipLoader.GetEquipSlot(Mod, "WulfrumOldSetHead", EquipType.Head); - Player.face = -1; - } - - if (transformationActive) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Body); - - Player.HideAccessories(); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (forceHelmetOn || transformationActive) - { - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "WulfrumOldSetHead", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - drawInfo.drawPlayer.face = -1; - } - - if (transformationActive) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Body); - drawInfo.bodyGlowMask = -1; - - drawInfo.drawPlayer.HideAccessories(); - } } } } 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/GhostBracelet.cs b/Items/Accessories/Vanity/GhostBracelet.cs index 18bb48b9c6..d1b42b67f9 100644 --- a/Items/Accessories/Vanity/GhostBracelet.cs +++ b/Items/Accessories/Vanity/GhostBracelet.cs @@ -1,38 +1,20 @@ -using Terraria; +using CalamityMod.Items.BaseItems; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { [LegacyName("RedBow")] - public class GhostBracelet : ModItem, ILocalizedModType + public class GhostBracelet : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Dandy", null), + (EquipType.Body, "Dandy", null), + (EquipType.Legs, "Dandy", null), + ]; public override void SetDefaults() { @@ -45,19 +27,6 @@ namespace CalamityMod.Items.Accessories.Vanity Item.Calamity().devItem = true; } - public override void UpdateVanity(Player player) - { - player.Calamity().ghostBracelet = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.Calamity().ghostBracelet = true; - } - } - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Accessories/Vanity/GoldenBomb.cs b/Items/Accessories/Vanity/GoldenBomb.cs index dca2e3d2a2..8bf02da708 100644 --- a/Items/Accessories/Vanity/GoldenBomb.cs +++ b/Items/Accessories/Vanity/GoldenBomb.cs @@ -1,39 +1,19 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class GoldenBomb : ModItem, ILocalizedModType + public class GoldenBomb : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mihaii_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mihaii_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mihaii_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Mihaii", null), + (EquipType.Body, "Mihaii", null), + (EquipType.Legs, "Mihaii", null), + ]; public override void SetDefaults() { @@ -45,53 +25,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.vanity = true; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class GoldenBombPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Head); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/HapuFruit.cs b/Items/Accessories/Vanity/HapuFruit.cs index 0461d330f8..97163ad111 100644 --- a/Items/Accessories/Vanity/HapuFruit.cs +++ b/Items/Accessories/Vanity/HapuFruit.cs @@ -1,43 +1,20 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class HapuFruit : ModItem, ILocalizedModType + public class HapuFruit : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Legs", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Back", EquipType.Back, this); - } - } - - public override void SetStaticDefaults() - { - - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Heart", null), + (EquipType.Body, "Heart", null), + (EquipType.Legs, "Heart", null), + (EquipType.Back, "Heart", null) + ]; public override void SetDefaults() { @@ -49,56 +26,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.vanity = true; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class HapuFruitPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.back = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Back); - Player.legs = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Head); - - //Player.HideAccessories(); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.back = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Back); - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Body); - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/LucisSight.cs b/Items/Accessories/Vanity/LucisSight.cs index 0afdc9724c..df711e8b14 100644 --- a/Items/Accessories/Vanity/LucisSight.cs +++ b/Items/Accessories/Vanity/LucisSight.cs @@ -1,22 +1,18 @@ -using Terraria; +using CalamityMod.Items.BaseItems; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - [AutoloadEquip(EquipType.Face)] - public class LucisSight : ModItem, ILocalizedModType + public class LucisSight : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void SetStaticDefaults() - { - if (!Main.dedServ) - { - int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face); - ArmorIDs.Face.Sets.DrawInFaceUnderHairLayer[equipSlot] = true; - } - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Face, "LucisSight", null), + ]; public override void SetDefaults() { diff --git a/Items/Accessories/Vanity/OracleHeadphones.cs b/Items/Accessories/Vanity/OracleHeadphones.cs index eb87fecceb..b75989ac4e 100644 --- a/Items/Accessories/Vanity/OracleHeadphones.cs +++ b/Items/Accessories/Vanity/OracleHeadphones.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -6,36 +7,16 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class OracleHeadphones : ModItem, ILocalizedModType + public class OracleHeadphones : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Legs", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Back", EquipType.Back, this); - } - } - - public override void SetStaticDefaults() - { - - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Mishiro", null), + (EquipType.Body, "Mishiro", null), + (EquipType.Legs, "Mishiro", null), + (EquipType.Back, "Mishiro", null) + ]; public override void SetDefaults() { @@ -47,57 +28,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.vanity = true; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class OracleHeadphonesPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.back = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Back); - Player.legs = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Head); - - //Player.HideAccessories(); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.back = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Back); - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index 66fe6d0f3c..54b35ec96a 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -1,36 +1,22 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class Popo : ModItem, ILocalizedModType + public class Popo : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/PopoNoseless_Head", EquipType.Head, name: "PopoNoseless"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Popo", null), + (EquipType.Head, "PopoNoseless", "PopoNoseless"), + (EquipType.Body, "Popo", null), + (EquipType.Legs, "Popo", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; public override void SetDefaults() { @@ -42,20 +28,14 @@ namespace CalamityMod.Items.Accessories.Vanity Item.Calamity().devItem = true; } - public override void UpdateVanity(Player player) + public override bool CustomSetEquipType(Player player, EquipType type, Mod mod, string name) { - player.Calamity().snowmanHide = false; - player.Calamity().snowmanForce = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.snowman = true; - if (hideVisual) + if (type == EquipType.Head) { - modPlayer.snowmanHide = true; + player.head = EquipLoader.GetEquipSlot(Mod, player.Calamity().snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head); + return true; } + return false; } } } diff --git a/Items/Accessories/Vanity/PunchCard.cs b/Items/Accessories/Vanity/PunchCard.cs index 40ac2b7d48..23840ecacf 100644 --- a/Items/Accessories/Vanity/PunchCard.cs +++ b/Items/Accessories/Vanity/PunchCard.cs @@ -1,38 +1,20 @@ -using CalamityMod.UI; +using CalamityMod.Items.BaseItems; +using CalamityMod.UI; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class PunchCard : ModItem, ILocalizedModType + public class PunchCard : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Shayy", null), + (EquipType.Body, "Shayy", null), + (EquipType.Legs, "Shayy", null), + ]; public override void SetDefaults() { @@ -53,18 +35,5 @@ namespace CalamityMod.Items.Accessories.Vanity PopupGUIManager.FlipActivityOfGUIWithType(typeof(PunchCardGUI)); return true; } - - public override void UpdateVanity(Player player) - { - player.Calamity().punchCard = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.Calamity().punchCard = true; - } - } } } diff --git a/Items/Accessories/Vanity/SharkyPlush.cs b/Items/Accessories/Vanity/SharkyPlush.cs index 521c319e7a..0edbbc3b6f 100644 --- a/Items/Accessories/Vanity/SharkyPlush.cs +++ b/Items/Accessories/Vanity/SharkyPlush.cs @@ -1,42 +1,20 @@ -using Microsoft.Xna.Framework; -using System; +using CalamityMod.Items.BaseItems; using Terraria; -using Terraria.DataStructures; -using Terraria.Graphics.Renderers; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class SharkyPlush : ModItem, ILocalizedModType + public class SharkyPlush : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shark_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shark_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shark_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Shark", null), + (EquipType.Body, "Shark", null), + (EquipType.Legs, "Shark", null), + ]; public override void SetDefaults() { @@ -48,53 +26,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class SharkyPlushPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Head); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/Xyk_Body2.png b/Items/Accessories/Vanity/Xyk2_Body.png similarity index 100% rename from Items/Accessories/Vanity/Xyk_Body2.png rename to Items/Accessories/Vanity/Xyk2_Body.png diff --git a/Items/Accessories/Vanity/Xyk_Head2.png b/Items/Accessories/Vanity/Xyk2_Head.png similarity index 100% rename from Items/Accessories/Vanity/Xyk_Head2.png rename to Items/Accessories/Vanity/Xyk2_Head.png diff --git a/Items/Accessories/Vanity/Xyk_Legs2.png b/Items/Accessories/Vanity/Xyk2_Legs.png similarity index 100% rename from Items/Accessories/Vanity/Xyk_Legs2.png rename to Items/Accessories/Vanity/Xyk2_Legs.png diff --git a/Items/Accessories/Vanity/XyksBlessingBlue.cs b/Items/Accessories/Vanity/XyksBlessingBlue.cs index 0ebe73db84..703f134c42 100644 --- a/Items/Accessories/Vanity/XyksBlessingBlue.cs +++ b/Items/Accessories/Vanity/XyksBlessingBlue.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -8,35 +9,17 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class XyksBlessingBlue : ModItem, ILocalizedModType + public class XyksBlessingBlue : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Legs", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Projectiles/InvisibleProj", EquipType.Wings, this); - } - } - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = false; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Xyk", null), + (EquipType.Body, "Xyk", null), + (EquipType.Legs, "Xyk", null), + (EquipType.Wings, null, null), //results in setting this equip slot to -1 + ]; public override void SetDefaults() { @@ -55,7 +38,6 @@ namespace CalamityMod.Items.Accessories.Vanity } public override void UpdateVanity(Player player) { - player.GetModPlayer().vanityEquipped = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.XykVisualsBlue = true; } @@ -64,46 +46,9 @@ namespace CalamityMod.Items.Accessories.Vanity { if (!hideVisual) { - player.GetModPlayer().vanityEquipped = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.XykVisualsBlue = true; } } } - - public class XyksBlessingBluePlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Head); - Player.wings = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Wings); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingBlue", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } - } } diff --git a/Items/Accessories/Vanity/XyksBlessingOrange.cs b/Items/Accessories/Vanity/XyksBlessingOrange.cs index 9e20a49940..3afa978e68 100644 --- a/Items/Accessories/Vanity/XyksBlessingOrange.cs +++ b/Items/Accessories/Vanity/XyksBlessingOrange.cs @@ -1,43 +1,24 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class XyksBlessingOrange : ModItem, ILocalizedModType + public class XyksBlessingOrange : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Head2", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Body2", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Legs2", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Projectiles/InvisibleProj", EquipType.Wings, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = true; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = false; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Xyk2", null), + (EquipType.Body, "Xyk2", null), + (EquipType.Legs, "Xyk2", null), + (EquipType.Wings, null, null), //results in setting this equip slot to -1 + ]; public override void SetDefaults() { @@ -56,7 +37,6 @@ namespace CalamityMod.Items.Accessories.Vanity } public override void UpdateVanity(Player player) { - player.GetModPlayer().vanityEquipped = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.XykVisualsOrange = true; } @@ -65,46 +45,9 @@ namespace CalamityMod.Items.Accessories.Vanity { if (!hideVisual) { - player.GetModPlayer().vanityEquipped = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.XykVisualsOrange = true; } } } - - public class XyksBlessingOrangePlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Head); - Player.wings = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Wings); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } - } } diff --git a/Items/Accessories/WarbanneroftheRighteous.cs b/Items/Accessories/WarbanneroftheRighteous.cs index cd6a16258e..04e2b9b36d 100644 --- a/Items/Accessories/WarbanneroftheRighteous.cs +++ b/Items/Accessories/WarbanneroftheRighteous.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Items.Accessories float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f) + 100; // Adds some room so max bonus isnt when you're ON the hitbox float intensity = Utils.Remap(Utils.Distance(player.Center, nPC.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 1, 3, true); // We have to have this seperate from bonus, otherwise all effected enemies take damage based on the closest enemy - if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType()) && nPC.CanBeChasedBy()) + if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType()) && !nPC.dontTakeDamage) { float minDamageMult = 0.35f; int maxTargets = 25; diff --git a/Items/Accessories/Wings/BaseWings.cs b/Items/Accessories/Wings/BaseWings.cs index 7637d61087..f7417150bb 100644 --- a/Items/Accessories/Wings/BaseWings.cs +++ b/Items/Accessories/Wings/BaseWings.cs @@ -2,7 +2,6 @@ using System.Linq; using System.Text; using CalamityMod.Balancing; -using Microsoft.Xna.Framework.Input; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -80,7 +79,7 @@ namespace CalamityMod.Items.Accessories.Wings sb.Append('\n'); sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (MaxAscentSpeed * baseJumpSpeed).ToMph())); sb.Append('\n'); - if (Main.keyState.IsKeyDown(Keys.LeftShift)) + if (Main.keyState.PressingShift()) { sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), BaseAscent.ToMphps(), (BaseAscent + BonusAscentWhileRising).ToMphps(), (RisingSpeedThreshold * baseJumpSpeed).ToMph(), diff --git a/Items/Accessories/WulfrumAcrobaticsPack.cs b/Items/Accessories/WulfrumAcrobaticsPack.cs index aab707da5b..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); + } } } @@ -624,7 +627,7 @@ namespace CalamityMod.Items.Accessories SoundEngine.PlaySound(WulfrumAcrobaticsPack.ReleaseSound, p.Center); p.Kill(); - + Player.grapCount = 0; } } 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/Ammo/SproutingArrow.cs b/Items/Ammo/SproutingArrow.cs index d8006c98eb..5b6cf0d8c0 100644 --- a/Items/Ammo/SproutingArrow.cs +++ b/Items/Ammo/SproutingArrow.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 22; Item.height = 36; - Item.damage = 15; + Item.damage = 14; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; 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/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index 1601c041ce..9045e3c7aa 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void UpdateEquip(Player player) { - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; player.GetDamage() += 0.13f; player.GetCritChance() += 7; player.statManaMax2 += 60; 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 7d7bcd3c06..650289817d 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -27,12 +27,19 @@ 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 FlatDamageBonus = 1; - 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 = 100; + public static int BonusDamageCap = 200; public static bool ShroudedInSmoke(Player player, out CooldownInstance cd) { @@ -41,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(); @@ -78,8 +66,10 @@ namespace CalamityMod.Items.Armor.DesertProwler public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(FlatDamageBonus); //More gets edited in elsewhere - player.GetDamage().Flat += FlatDamageBonus; + Color AbilityBriefColor = Color.Lerp(new Color(255, 229, 156), new Color(233, 225, 198), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), FreeCrit, BonusDamageCap, LightsOutReset.FramesToSeconds()); //More gets edited in elsewhere + player.Calamity().wearingRogueArmor = true; + player.Calamity().rogueStealthMax += SetBonusRogueStealth; DesertProwlerPlayer armorPlayer = player.GetModPlayer(); armorPlayer.desertProwlerSet = true; @@ -89,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++) @@ -155,37 +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; - player.ammoCost80 = true; - } + 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; @@ -381,7 +343,7 @@ namespace CalamityMod.Items.Armor.DesertProwler { if (projectile.damage > 0 && !Main.gameMenu) { - if (projectile.owner >= 0 && DesertProwlerHat.ShroudedInSmoke(Main.player[projectile.owner], out var cd) && projectile.DamageType.CountsAsClass(DamageClass.Ranged)) + if (projectile.owner >= 0 && DesertProwlerHat.ShroudedInSmoke(Main.player[projectile.owner], out var cd) && projectile.DamageType.CountsAsClass(RogueDamageClass.Instance)) { int critPool = DesertProwlerHat.FreeCrit; diff --git a/Items/Armor/Empyrean/EmpyreanCloak.cs b/Items/Armor/Empyrean/EmpyreanCloak.cs index bf80cf38b8..d776dddcfb 100644 --- a/Items/Armor/Empyrean/EmpyreanCloak.cs +++ b/Items/Armor/Empyrean/EmpyreanCloak.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Armor.Empyrean public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; player.GetCritChance() += 7; player.GetDamage() += 0.07f; } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs index 33257e3b8b..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; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + 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 5902d4e52b..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,43 +33,37 @@ 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; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + 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; } modPlayer.fathomSwarmerVisage = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.3f, 0.9f, 1.35f); } diff --git a/Items/Armor/Fearmonger/FearmongerGreathelm.cs b/Items/Armor/Fearmonger/FearmongerGreathelm.cs index 27838ccc22..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) @@ -67,7 +67,6 @@ namespace CalamityMod.Items.Armor.Fearmonger ModContent.BuffType(), BuffID.Chilled, BuffID.Frozen, - ModContent.BuffType(), }; for (var i = 0; i < immuneDebuffs.Length; ++i) player.buffImmune[immuneDebuffs[i]] = true; diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index f5566fca6f..4a18ff0e3d 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor @@ -9,9 +10,20 @@ 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 StormManaCost = 60; + public static int StormCooldown = 45; + public static int StormDamage = 80; + public static float StormKB = 1f; + public static int EaterSpawnCount = 6; + public static int EaterSpawnCooldown = 15; + public static int EaterDamage = 40; public override void SetStaticDefaults() { @@ -30,10 +42,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 +52,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/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index eaebeaac2c..3c860e87a8 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -8,7 +8,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Microsoft.Xna.Framework.Input.Keys; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Armor.GemTech @@ -94,7 +93,7 @@ namespace CalamityMod.Items.Armor.GemTech tooltips[setBonusIndex].Text = CalamityUtils.GetTextValueFromModItem("AbilityBrief"); tooltips[setBonusIndex].OverrideColor = Color.Lerp(Color.White, Main.DiscoColor, 0.3f); - if (!Main.keyState.IsKeyDown(LeftShift)) + if (!Main.keyState.PressingShift()) { TooltipLine briefDescription = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextValueFromModItem("AbilityDescription")); briefDescription.OverrideColor = Color.Lerp(Color.White, Main.DiscoColor, 0.5f); 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..c2c9737405 100644 --- a/Items/Armor/Hydrothermic/HydrothermicArmor.cs +++ b/Items/Armor/Hydrothermic/HydrothermicArmor.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; player.GetDamage() += 0.08f; player.GetCritChance() += 4; } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index 6bf014726a..de2335fbb7 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic modPlayer.ataxiaBlaze = true; modPlayer.ataxiaMage = true; player.GetDamage() += 0.05f; - player.manaCost *= 0.85f; + player.manaCost -= 0.15f; } public override void UpdateEquip(Player player) 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..ba3cdb9a84 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -37,8 +37,7 @@ namespace CalamityMod.Items.Armor.PlagueReaper 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 modPlayer = player.Calamity(); modPlayer.plagueReaper = true; player.ammoCost75 = true; diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index 92ed645a33..97e4d4197b 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { player.GetDamage() += 0.15f; - player.statLifeMax2 += 20; } public override bool IsArmorSet(Item head, Item body, Item legs) 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/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index 116c8e422e..1e99bdc685 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.Reaver modPlayer.wearingRogueArmor = true; player.findTreasure = true; player.aggro -= 200; - if (player.IsUnderwater()) + if (player.Calamity().countsAsAnyWet) player.gills = true; if (player.whoAmI == Main.myPlayer) diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index 0aff26f2c8..cfed218502 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor.Reaver player.thorns += 0.33f; player.moveSpeed -= 0.3f; player.statDefense += 10; - player.lifeRegen += 3; + player.lifeRegen += 10; player.aggro += 600; modPlayer.reaverDefense = true; modPlayer.wearingRogueArmor = true; @@ -54,7 +54,6 @@ namespace CalamityMod.Items.Armor.Reaver { player.GetDamage() -= 0.3f; player.endurance += 0.15f; - player.Calamity().reaverRegen = true; player.statLifeMax2 += 50; } diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index 4b4f5a5f6d..7d1f5a9221 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Armor.Reaver public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; player.GetDamage() += 0.09f; player.GetCritChance() += 4; } 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 c9cc263a73..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; @@ -35,18 +39,16 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 4; //9 + Item.defense = 5; //12 } - public override void UpdateEquip(Player player) - { - player.GetCritChance() += 3; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { CreateRecipe(). - AddRecipeGroup("AnySnowBlock", 60). + AddIngredient(ItemID.BorealWood, 20). + AddIngredient(ItemID.Silk, 6). AddIngredient(ItemID.FlinxFur, 2). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs b/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs index 5e4137d56e..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,24 +9,26 @@ 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; Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 3; //9 + Item.defense = 4; //12 } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.05f; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { CreateRecipe(). - AddRecipeGroup("AnySnowBlock", 40). + AddIngredient(ItemID.BorealWood, 15). + AddIngredient(ItemID.Silk, 5). AddIngredient(ItemID.FlinxFur). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/SnowRuffian/SnowRuffianMask.cs b/Items/Armor/SnowRuffian/SnowRuffianMask.cs index c05014c4cb..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,70 +32,33 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 2; //9 + 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; - modPlayer.rogueStealthMax += 0.5f; - player.setBonus = this.GetLocalizedValue("SetBonus"); - player.GetDamage() += 0.05f; - player.Calamity().wearingRogueArmor = true; - - 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() { CreateRecipe(). - AddRecipeGroup("AnySnowBlock", 20). + AddIngredient(ItemID.BorealWood, 10). + AddIngredient(ItemID.Silk, 4). AddIngredient(ItemID.FlinxFur). AddTile(TileID.Anvils). SortBeforeFirstRecipesOf(ModContent.ItemType()). 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..d335715a55 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,18 @@ 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 int SetBonusHurtDamageThreshold = 100; + public static int SetBonusIFrameExtension = 30; + public static float SetBonusJumpSpeedBoost = 0.6f; + public static float SetBonusJumpHeightPercentBoost = 0.3334f; + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -31,14 +41,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..26acf35900 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; @@ -28,20 +36,20 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, 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 +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/StatigelHeadMelee.cs b/Items/Armor/Statigel/StatigelHeadMelee.cs index 078d4805df..a6d3b93c8d 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; @@ -28,20 +38,21 @@ namespace CalamityMod.Items.Armor.Statigel 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.SetBonusHurtDamageThreshold, 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 +60,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..f587500f24 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; @@ -28,18 +34,18 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, 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 +53,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..25d42aaf34 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; @@ -28,21 +38,22 @@ namespace CalamityMod.Items.Armor.Statigel 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.SetBonusHurtDamageThreshold, 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 +61,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..865e54846e 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -16,6 +16,12 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float SummonKBBoost = 1.5f; + + // Set Bonus + public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.18f; public static int SlimeDamage = 18; public override void SetDefaults() @@ -34,15 +40,16 @@ namespace CalamityMod.Items.Armor.Statigel 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(StatigelArmor.SetBonusHurtDamageThreshold, 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; + player.maxMinions += SetBonusMinionSlotBoost; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); @@ -64,17 +71,14 @@ namespace CalamityMod.Items.Armor.Statigel } } - public override void UpdateEquip(Player player) - { - player.GetKnockback() += 1.5f; - } + public override void UpdateEquip(Player player) => player.GetKnockback() += SummonKBBoost; public override void AddRecipes() { 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 2f3b5b0f9f..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,20 +39,18 @@ 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; - if (player.IsUnderwater()) + 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 ada7ef2a1b..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 += Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 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 9c7ec9190b..a836fe3c1c 100644 --- a/Items/Armor/Vanity/GodSlayerHornedHelm.cs +++ b/Items/Armor/Vanity/GodSlayerHornedHelm.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Armor.GodSlayer; using CalamityMod.Rarities; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Vanity @@ -15,7 +16,7 @@ namespace CalamityMod.Items.Armor.Vanity Item.height = 18; Item.vanity = true; Item.value = Item.buyPrice(gold: 8); // Sold by Clothier - Item.rare = ModContent.RarityType(); + Item.rare = ItemRarityID.Blue; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/Armor/Vanity/GodSlayerVisage.cs b/Items/Armor/Vanity/GodSlayerVisage.cs index 70e25934fb..c9b7d49835 100644 --- a/Items/Armor/Vanity/GodSlayerVisage.cs +++ b/Items/Armor/Vanity/GodSlayerVisage.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Armor.GodSlayer; using CalamityMod.Rarities; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Vanity @@ -15,7 +16,7 @@ namespace CalamityMod.Items.Armor.Vanity Item.height = 18; Item.vanity = true; Item.value = Item.buyPrice(gold: 8); // Sold by Clothier - Item.rare = ModContent.RarityType(); + Item.rare = ItemRarityID.Blue; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/Armor/Vanity/SilvaHelm.cs b/Items/Armor/Vanity/SilvaHelm.cs index bf60aa6d1b..99539418de 100644 --- a/Items/Armor/Vanity/SilvaHelm.cs +++ b/Items/Armor/Vanity/SilvaHelm.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.Vanity Item.height = 20; Item.vanity = true; Item.value = Item.buyPrice(gold: 8); // Sold by Clothier - Item.rare = ModContent.RarityType(); + Item.rare = ItemRarityID.Blue; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/Armor/Vanity/SilvaHornedHelm.cs b/Items/Armor/Vanity/SilvaHornedHelm.cs index a5f5bbd114..573b5948fd 100644 --- a/Items/Armor/Vanity/SilvaHornedHelm.cs +++ b/Items/Armor/Vanity/SilvaHornedHelm.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.Vanity Item.height = 24; Item.vanity = true; Item.value = Item.buyPrice(gold: 8); // Sold by Clothier - Item.rare = ModContent.RarityType(); + Item.rare = ItemRarityID.Blue; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/Armor/Vanity/SilvaMask.cs b/Items/Armor/Vanity/SilvaMask.cs index 0b57bd0662..2c61760d43 100644 --- a/Items/Armor/Vanity/SilvaMask.cs +++ b/Items/Armor/Vanity/SilvaMask.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.Vanity Item.height = 26; Item.vanity = true; Item.value = Item.buyPrice(gold: 8); // Sold by Clothier - Item.rare = ModContent.RarityType(); + Item.rare = ItemRarityID.Blue; } public override bool IsArmorSet(Item head, Item body, Item legs) 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 43e1c6649b..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 (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - 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 6e96d6af32..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 += Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 0.3f : 0.08f; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Victide/VictideHeadBarrier.cs b/Items/Armor/Victide/VictideHeadBarrier.cs new file mode 100644 index 0000000000..0cd59efdd7 --- /dev/null +++ b/Items/Armor/Victide/VictideHeadBarrier.cs @@ -0,0 +1,76 @@ +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Victide +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("VictideMask", "VictideHeadMagic")] + public class VictideHeadBarrier : ModItem, ILocalizedModType // Defense/Mobility set + { + public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RegenBoost = 2; + public static float RunAccelerationMult = 1.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), RunAccelerationMult.Round()); + + // Set Bonus + public static int BarrierCooldown = CalamityUtils.SecondsToFrames(8); + public static int BarrierDefenseBoost = 8; + public static float BarrierDamageAbsorptionPercent = 0.1f; + public static int BarrierDamage = 50; + public static float BarrierExplosionKB = 8f; + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + Item.defense = 7; // 16 + } + + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + + public override void UpdateArmorSet(Player player) + { + Color AbilityBriefColor = Color.Lerp(new Color(97, 200, 255), new Color(255, 170, 204), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), BarrierDefenseBoost, BarrierDamageAbsorptionPercent.ToPercent(), CalamityUtils.GetArmorSetBonusKey(), BarrierCooldown.FramesToSeconds()); + player.Calamity().victideBarrierSet = true; + + if (!player.HasCooldown(WardingWave.ID)) + { + player.statDefense += BarrierDefenseBoost; + + if (player.whoAmI == Main.myPlayer && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + { + // Damage will be set once explosion goes off + var source = player.GetSource_ItemUse(Item); + Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + } + } + } + + public override void UpdateEquip(Player player) + { + player.lifeRegen += RegenBoost; + player.Calamity().victideBarrierHead = true; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(3). + AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). + Register(); + } + } +} diff --git a/Items/Armor/Victide/VictideHeadMagic.png b/Items/Armor/Victide/VictideHeadBarrier.png similarity index 100% rename from Items/Armor/Victide/VictideHeadMagic.png rename to Items/Armor/Victide/VictideHeadBarrier.png diff --git a/Items/Armor/Victide/VictideHeadMagic_Head.png b/Items/Armor/Victide/VictideHeadBarrier_Head.png similarity index 100% rename from Items/Armor/Victide/VictideHeadMagic_Head.png rename to Items/Armor/Victide/VictideHeadBarrier_Head.png diff --git a/Items/Armor/Victide/VictideHeadBurrow.cs b/Items/Armor/Victide/VictideHeadBurrow.cs new file mode 100644 index 0000000000..beb9f5767b --- /dev/null +++ b/Items/Armor/Victide/VictideHeadBurrow.cs @@ -0,0 +1,64 @@ +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Victide +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("VictideHeadgear", "VictideHeadRogue")] + public class VictideHeadBurrow : ModItem, ILocalizedModType // Mobility/Utility set + { + public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MoveSpeedAccelerationBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedAccelerationBoost.ToPercent()); + + // Set Bonus + public static float BaseBurrowSpeed = 9f; // 46 mph + public static float SubmergedBurrowSpeed = 12f; // 61 mph + public static float BaseAcceleration = 0.4f; // For reference, base player running acceleration is 0.08 + public static int BurrowDuration = CalamityUtils.SecondsToFrames(8); + public static int BurrowCooldown = CalamityUtils.SecondsToFrames(30); + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + Item.defense = 5; // 14 + } + + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + + public override void UpdateArmorSet(Player player) + { + Color AbilityBriefColor = Color.Lerp(new Color(97, 200, 255), new Color(255, 170, 204), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), BurrowDuration.FramesToSeconds(), BurrowCooldown.FramesToSeconds()); + player.Calamity().victideBurrowSet = true; + player.ignoreWater = true; + } + + public override void UpdateEquip(Player player) + { + player.Calamity().victideBurrowHead = true; + player.moveSpeed += MoveSpeedAccelerationBoost; + if (player.IsUnderwater()) + player.gills = true; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(3). + AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). + Register(); + } + } +} diff --git a/Items/Armor/Victide/VictideHeadRogue.png b/Items/Armor/Victide/VictideHeadBurrow.png similarity index 100% rename from Items/Armor/Victide/VictideHeadRogue.png rename to Items/Armor/Victide/VictideHeadBurrow.png diff --git a/Items/Armor/Victide/VictideHeadRogue_Head.png b/Items/Armor/Victide/VictideHeadBurrow_Head.png similarity index 100% rename from Items/Armor/Victide/VictideHeadRogue_Head.png rename to Items/Armor/Victide/VictideHeadBurrow_Head.png diff --git a/Items/Armor/Victide/VictideHeadMagic.cs b/Items/Armor/Victide/VictideHeadMagic.cs deleted file mode 100644 index 87d322f52f..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 (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - 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 9c97518add..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 (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - 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 068abd2914..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 (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - 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 1ebfa59ea6..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 (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - 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..7b82692256 --- /dev/null +++ b/Items/Armor/Victide/VictideHeadSnail.cs @@ -0,0 +1,70 @@ +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); + + 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 3d2d7683ce..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 (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - 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 2b9dcc9d35..f27d55f4a1 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -11,7 +11,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using static Microsoft.Xna.Framework.Input.Keys; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Armor.Wulfrum @@ -36,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. @@ -58,8 +62,7 @@ namespace CalamityMod.Items.Armor.Wulfrum EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_FemaleHead", EquipType.Head, name: "WulfrumHatFemale"); } - Terraria.On_Player.KeyDoubleTap += ActivateSetBonus; - Terraria.On_Main.DrawPendingMouseText += SpoofMouseItem; + On_Main.DrawPendingMouseText += SpoofMouseItem; } public override void Unload() @@ -68,42 +71,15 @@ namespace CalamityMod.Items.Armor.Wulfrum DummyCannon = null; } - private void ActivateSetBonus(Terraria.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(Terraria.On_Main.orig_DrawPendingMouseText orig) + private void SpoofMouseItem(On_Main.orig_DrawPendingMouseText orig) { var player = Main.LocalPlayer; if (DummyCannon.IsAir && !Main.gameMenu) DummyCannon.SetDefaults(ItemType()); - if (IsPartOfSet(Main.HoverItem) && HasArmorSet(player) && Main.keyState.IsKeyDown(LeftShift)) + if (IsPartOfSet(Main.HoverItem) && HasArmorSet(player) && Main.keyState.PressingShift()) { Main.HoverItem = DummyCannon.Clone(); Main.hoverItemName = DummyCannon.Name; @@ -118,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(); @@ -133,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) @@ -143,12 +121,13 @@ 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. + //Can't account for previous fullbody transformations but at this point, whatever + bool transformed = player.Transformation().Type == ItemType(); Item headItem = player.armor[10].type != ItemID.None ? player.armor[10] : player.armor[0]; - bool hatVisible = !transformationPlayer.transformationActive && headItem.type == ItemType(); + bool hatVisible = !transformed && headItem.type == ItemType(); //Spawn the hat if (cd.timeLeft == BastionCooldown + BastionTime - (int)(BastionBuildTime * 0.9f) && hatVisible) @@ -159,11 +138,9 @@ namespace CalamityMod.Items.Armor.Wulfrum //Visuals if (cd.timeLeft < BastionCooldown + BastionTime - BastionBuildTime) - player.GetModPlayer().transformationActive = true; - else if (cd.timeLeft <= BastionCooldown + BastionTime - (int)(BastionBuildTime * 0.9f)) - player.GetModPlayer().forceHelmetOn = true; + player.Transformation().Type = ItemType(); - //Swapping the arm. + //Swapping the arm if (DummyCannon.IsAir) DummyCannon.SetDefaults(ItemType()); @@ -176,7 +153,7 @@ namespace CalamityMod.Items.Armor.Wulfrum Main.mouseItem = DummyCannon; } - //Slot 58 is the "fake" slot thats used for the item the player is holding in their mouse. + //Slot 58 is the "fake" slot thats used for the item the player is holding in their mouse player.inventory[58] = DummyCannon; player.selectedItem = 58; } @@ -188,6 +165,9 @@ namespace CalamityMod.Items.Armor.Wulfrum Main.mouseItem = new Item(); DummyCannon.TurnToAir(); + + if (player.Transformation().Type == ItemType() && player.Transformation().currentTransformation.IsForced) + player.Transformation().currentTransformation.IsForced = false; } } @@ -195,8 +175,8 @@ namespace CalamityMod.Items.Armor.Wulfrum { SoundEngine.PlaySound(SetActivationSound); - //Do'nt do the effect ifthe player is already using the wulfrum vanity lol. - bool transformedAlready = player.GetModPlayer().transformationActive; + //Don't do the effect if the player is already using the wulfrum vanity lol + bool transformedAlready = player.Transformation().Type == ItemType(); if (!transformedAlready) { @@ -221,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.IsKeyDown(LeftShift)) - { - 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() { @@ -272,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) @@ -291,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() { @@ -310,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; @@ -324,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() { @@ -343,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() @@ -365,7 +310,7 @@ namespace CalamityMod.Items.Armor.Wulfrum { SetBonusEndEffect(true); if (!Player.GetModPlayer().vanityEquipped) - Player.GetModPlayer().transformationActive = false; + Player.Transformation().currentTransformation = null; } } diff --git a/Items/BaseItems/TransformationAccessory.cs b/Items/BaseItems/TransformationAccessory.cs new file mode 100644 index 0000000000..f929462815 --- /dev/null +++ b/Items/BaseItems/TransformationAccessory.cs @@ -0,0 +1,289 @@ +using Terraria.DataStructures; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using System.Linq; +using System; +using Microsoft.Xna.Framework; +using Terraria.Audio; + +namespace CalamityMod.Items.BaseItems +{ + public abstract class TransformationAccessory : ModItem + { + public bool IsForced = false; + + public virtual string AssetPath => "CalamityMod/Items/Accessories/Vanity/"; + + public virtual (EquipType Type, string AssetName, string EquipName)[] EquipSlots => []; + + public virtual float Priority => 1; + + public virtual Func ShouldTransform => (player) => true; + + public virtual bool ShouldHideAccessories => false; + + public virtual (SoundStyle sound, int delay)? HurtSound(Player p) => null; + + public virtual void ModifyDrawInfo(ref PlayerDrawSet drawInfo) { } + + public virtual void ArmorIDSets() + { + if (EquipSlots.Any(s => s.Type == EquipType.Head)) + { + string name = EquipSlots.First(s => s.Type == EquipType.Head).EquipName; + int equipSlotHead = EquipLoader.GetEquipSlot(Mod, name ?? Name, EquipType.Head); + ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; + } + + if (EquipSlots.Any(s => s.Type == EquipType.Body)) + { + string name = EquipSlots.First(s => s.Type == EquipType.Body).EquipName; + int equipSlotBody = EquipLoader.GetEquipSlot(Mod, name ?? Name, EquipType.Body); + ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; + ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; + } + + if (EquipSlots.Any(s => s.Type == EquipType.Legs)) + { + string name = EquipSlots.First(s => s.Type == EquipType.Legs).EquipName; + int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, name ?? Name, EquipType.Legs); + ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; + } + } + + public virtual bool CustomSetEquipType(Player player, EquipType type, Mod mod, string name) => false; + + public virtual void TransformFrameEffects(Player player) { } + + public virtual void TransformPostUpdate(Player player) { } + + public override void Load() + { + if (Main.netMode != NetmodeID.Server) + { + foreach (var v in EquipSlots) + { + if (v.AssetName == null) + continue; + EquipLoader.AddEquipTexture(Mod, AssetPath + v.AssetName + "_" + v.Type.ToString(), v.Type, this, v.EquipName); + } + } + } + + public override void SetStaticDefaults() + { + if (Main.netMode == NetmodeID.Server) + return; + + ArmorIDSets(); + } + } + + public class TransformationPlayer : ModPlayer + { + public override void Load() + { + On_Player.ResetVisibleAccessories += ResetTransformation; + On_Player.UpdateVisibleAccessory += SetTransformationItem; + } + + internal TransformationAccessory currentTransformation = null; + int previousHighest = -1; + int currentHighest = -1; + + public int Type + { + get => currentTransformation == null ? -1 : currentTransformation.Type; + + set + { + ModItem item = ModContent.GetModItem(value); + if (item != null && item is TransformationAccessory trans) + { + currentTransformation = trans; + currentTransformation.IsForced = true; + } + else + currentTransformation = null; + } + } + + 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 (item.ModItem is TransformationAccessory transformation && transformation.ShouldTransform.Invoke(self) && (currentTransformation == null || transformation.Priority >= currentTransformation.Priority)) + self.Transformation().currentTransformation = transformation; + } + + 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]; + foreach (var (Type, AssetName, EquipName) in trans.EquipSlots) + { + string name = AssetName == null ? null : EquipName ?? trans.Name; + if (!trans.CustomSetEquipType(self, Type, Mod, name) && !list[(int)Type]) + { + SetEquipSlot(self, Type, Mod, name); + list[(int)Type] = true; + } + } + if (trans.ShouldHideAccessories) + self.HideAccessories(); + } + } + + public override void UpdateAutopause() + { + if (currentTransformation != null) + { + if (!currentTransformation.CustomSetEquipType(Player, EquipType.Head, Mod, currentTransformation.Name)) + { + var (Type, AssetName, EquipName) = currentTransformation.EquipSlots.First(v => v.Type == EquipType.Head); + string name = (EquipName == null && AssetName == null) ? null : EquipName ?? currentTransformation.Name; + SetEquipSlot(Player, EquipType.Head, Mod, name); + } + } + + Reset(Player); + } + + public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) + { + if (currentTransformation != null) + { + currentTransformation.ModifyDrawInfo(ref drawInfo); + + if (currentTransformation.EquipSlots.Any(s => s.Type == EquipType.Head)) + { + drawInfo.headGlowMask = -1; + drawInfo.helmetOffset = Vector2.Zero; + } + + if (currentTransformation.EquipSlots.Any(s => s.Type == EquipType.Body)) + { + drawInfo.bodyGlowMask = -1; + } + + if (currentTransformation.EquipSlots.Any(s => s.Type == EquipType.Legs)) + { + drawInfo.legsGlowMask = -1; + drawInfo.legsOffset = Vector2.Zero; + } + } + } + + public override void FrameEffects() + { + if (currentTransformation != null) + { + currentTransformation.TransformFrameEffects(Player); + + if (currentTransformation.ShouldHideAccessories) + Player.HideAccessories(); + } + } + + public override void PostUpdate() + { + currentTransformation?.TransformPostUpdate(Player); + } + + public static void SetEquipSlot(Player player, EquipType type, Mod mod, string name) + { + switch (type) + { + case EquipType.Head: + player.head = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Body: + player.body = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Legs: + player.legs = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.HandsOn: + player.handon = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.HandsOff: + player.handoff = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Back: + player.back = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Front: + player.front = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Shoes: + player.shoe = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Waist: + player.waist = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Wings: + player.wings = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Shield: + player.shield = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Neck: + player.neck = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Face: + player.face = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Balloon: + player.balloon = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Beard: + player.beard = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + } + } + + public static int GetEquipSlot(Player player, EquipType type) => type switch + { + EquipType.Head => player.head, + EquipType.Body => player.body, + EquipType.Legs => player.legs, + EquipType.HandsOn => player.handon, + EquipType.HandsOff => player.handoff, + EquipType.Back => player.back, + EquipType.Front => player.front, + EquipType.Shoes => player.shoe, + EquipType.Waist => player.waist, + EquipType.Wings => player.wings, + EquipType.Shield => player.shield, + EquipType.Neck => player.neck, + EquipType.Face => player.face, + EquipType.Balloon => player.balloon, + EquipType.Beard => player.beard, + _ => -1, + }; + + public static EquipTexture GetEquipTexture(Player p, EquipType type) => EquipLoader.GetEquipTexture(type, GetEquipSlot(p, type)); + } +} diff --git a/Items/BrimstoneLocus.cs b/Items/BrimstoneLocus.cs index b1b7641013..5572578b6c 100644 --- a/Items/BrimstoneLocus.cs +++ b/Items/BrimstoneLocus.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items { Item.width = 20; Item.height = 20; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = 0; } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 9f576d015c..228f54cc79 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -461,21 +461,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) @@ -676,11 +661,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 @@ -714,41 +696,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) @@ -827,6 +774,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)) { @@ -895,7 +846,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; } @@ -1207,6 +1158,11 @@ namespace CalamityMod.Items player.GetCritChance() -= 15; break; + case ItemID.ShroomiteBreastplate: + player.GetDamage() -= 0.05f; + player.GetCritChance() -= 5; + break; + case ItemID.SquireAltHead: player.GetDamage() += 0.05f; player.GetDamage() += 0.05f; @@ -1480,9 +1436,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; @@ -1557,6 +1510,10 @@ namespace CalamityMod.Items if (player.Calamity().reaverExplore) grabRange += 246; + // Victide utility set provides a lesser boost of 102 (2.625 + 6.375 = 9 tiles) + if (player.Calamity().victideSnailSet) + grabRange += 102; + // Nebula boosters have greater pickup range while using Nebula Mantle. if (player.wingsLogic == (int)VanillaWingID.WingsNebula && ItemID.Sets.NebulaPickup[item.type]) grabRange *= 2; @@ -1655,7 +1612,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 diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index bdf23947ce..c9be425662 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -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; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index c336178001..09a3a86061 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -21,7 +21,6 @@ using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Input; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -181,7 +180,7 @@ namespace CalamityMod.Items // Original code lifted from Iban's extended armor tooltips. if (item.ModItem is IHoldShiftTooltipItem holdShiftItem) { - bool holdingShift = Main.keyState.IsKeyDown(Keys.LeftShift); + bool holdingShift = Main.keyState.PressingShift(); // If holding SHIFT, actually display the extended tooltip. if (holdingShift && firstTooltipIndex != -1) @@ -416,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); } @@ -573,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%")); @@ -614,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 @@ -780,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")); @@ -895,7 +887,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) @@ -928,10 +920,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%")); @@ -981,63 +969,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) @@ -1066,7 +1006,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}")); @@ -1093,6 +1033,10 @@ namespace CalamityMod.Items if (item.type == ItemID.TitaniumMask) EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9%", "14%")); + // Shroomite + if (item.type == ItemID.ShroomiteBreastplate) + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("13%", "8%")); + // Solar Flare if (item.type == ItemID.SolarFlareHelmet) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("26%", "20%")); @@ -1206,18 +1150,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 @@ -1290,7 +1230,7 @@ namespace CalamityMod.Items sb.Append('\n'); sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (tMax * baseJumpSpeed).ToMph())); sb.Append('\n'); - if (Main.keyState.IsKeyDown(Keys.LeftShift)) + if (Main.keyState.PressingShift()) { sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), asc.ToMphps(), (asc + rise).ToMphps(), (rMax * baseJumpSpeed).ToMph(), (asc + fall).ToMphps())); if (hover) @@ -1549,20 +1489,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 f31c8b237b..e63cd845f2 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -26,11 +26,13 @@ namespace CalamityMod.Items internal static void LoadTweaks() { - // Various shorthands for items which receive very simple changes, such as setting one flag. + // Various shorthands for items which receive very simple changes, or are repeated multiple times. IItemTweak[] trueMelee = Do(TrueMelee); IItemTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); IItemTweak[] autoReuse = Do(AutoReuse); IItemTweak[] nonConsumableBossSummon = Do(MaxStack(1), NotConsumable, UseTimeExact(10)); + IItemTweak[] phaseblade = Do(AutoReuse, UseTurn, DamageExact(36)); + IItemTweak[] phasesaber = Do(DamageExact(132)); // SORTING NOTES: // 1. Sort tweaks by categories first, then sort by the internal name in alphabetical order. Navigate through categories and names using the search function. @@ -58,8 +60,8 @@ namespace CalamityMod.Items { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, { ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) }, { ItemID.Blowgun, Do(DamageExact(40), ShootSpeedExact(15f)) }, - { ItemID.BluePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.BluePhasesaber, Do(DamageExact(132)) }, + { 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 @@ -80,6 +82,7 @@ namespace CalamityMod.Items { 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)) }, @@ -97,9 +100,10 @@ namespace CalamityMod.Items { 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.DeathSickle, Do(UseMeleeSpeed, DamageExact(82), ShootSpeedExact(15f)) }, + { ItemID.DeadlySphereStaff, Do(AutoReuse, UseExact(20), DamageExact(50)) }, + { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(70), ShootSpeedExact(15f)) }, { ItemID.DemonBow, Do(DamageExact(12), AutoReuse) }, - { ItemID.DemonScythe, Do(AutoReuse, DamageExact(33)) }, + { ItemID.DemonScythe, Do(AutoReuse, DamageExact(28)) }, { ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar { ItemID.ElectrosphereLauncher, Do(DamageExact(44)) }, { ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) }, @@ -108,11 +112,11 @@ namespace CalamityMod.Items { ItemID.EnchantedBoomerang, Do(DamageExact(24)) }, { ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) }, { ItemID.EndlessMusketPouch, Do(DamageExact(8)) }, - { ItemID.Excalibur, Do(TrueMelee, DamageExact(220), UseExact(24)) }, + { ItemID.Excalibur, Do(TrueMelee, DamageExact(205), UseExact(24)) }, { ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow { ItemID.FalconBlade, Do(UseTurn, UseExact(13)) }, { ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration - { ItemID.Flamarang, Do(DamageExact(40)) }, + { ItemID.Flamarang, Do(DamageExact(37)) }, { ItemID.Flamelash, Do(DamageExact(40)) }, { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f), DamageRatio(0.7f)) }, // Uses ratios due to remix seed @@ -125,10 +129,10 @@ namespace CalamityMod.Items { ItemID.GoldShortsword, Do(AutoReuse, TrueMelee, DamageExact(17)) }, { ItemID.GolemFist, Do(DamageExact(150)) }, { ItemID.Gradient, Do(AutoReuse, DamageExact(39)) }, - { ItemID.GreenPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.GreenPhasesaber, Do(DamageExact(132)) }, - { ItemID.GrenadeLauncher, Do(DamageExact(112)) }, - { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(7f)) }, + { ItemID.GreenPhaseblade, phaseblade }, + { ItemID.GreenPhasesaber, phasesaber }, + { ItemID.GrenadeLauncher, Do(DamageExact(105)) }, + { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(132), ShootSpeedExact(7f)) }, { ItemID.HallowedRepeater, Do(UseExact(12)) }, { ItemID.Handgun, Do(UseExact(20)) }, { ItemID.HellwingBow, Do(DamageExact(16)) }, @@ -142,22 +146,22 @@ namespace CalamityMod.Items { ItemID.IchorArrow, Do(DamageExact(13)) }, { ItemID.IchorBullet, Do(DamageExact(11)) }, { ItemID.ImpStaff, Do(AutoReuse, UseExact(30), DamageExact(25)) }, - { ItemID.InfernoFork, Do(DamageExact(99), ShootSpeedExact(11)) }, + { ItemID.InfernoFork, Do(DamageExact(83), ShootSpeedExact(11)) }, { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, { ItemID.IronShortsword, Do(AutoReuse, TrueMelee, DamageExact(10)) }, { ItemID.Keybrand, Do(UseTurn) }, - { ItemID.Kraken, Do(AutoReuse, DamageExact(85)) }, + { ItemID.Kraken, Do(AutoReuse, DamageExact(65)) }, { ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // Uses ratios due to remix seed { ItemID.LaserMachinegun, Do(DamageExact(49)) }, { ItemID.LaserRifle, Do(DamageExact(46), UseExact(10), ManaExact(4)) }, { ItemID.LastPrism, Do(DamageExact(57), ManaExact(10)) }, { ItemID.LeadShortsword, Do(AutoReuse, TrueMelee, DamageExact(11)) }, - { ItemID.LightDisc, Do(DamageExact(98), ShootSpeedExact(18)) }, + { ItemID.LeafBlower, Do(DamageExact(61)) }, + { ItemID.LightDisc, Do(DamageExact(80), ShootSpeedExact(18)) }, { ItemID.LunarFlareBook, Do(DamageExact(120)) }, { 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.MagnetSphere, Do(DamageExact(52)) }, { ItemID.Marrow, Do(DamageExact(69)) }, { ItemID.MedusaHead, Do(ManaExact(6), DamageExact(48)) }, { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, @@ -165,7 +169,7 @@ namespace CalamityMod.Items { ItemID.MiniNukeI, Do(DamageExact(90)) }, { ItemID.MiniNukeII, Do(DamageExact(90)) }, { ItemID.Minishark, Do(DamageExact(4)) }, - { ItemID.MoltenFury, Do(UseExact(29), AutoReuse) }, + { 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,16 +181,17 @@ namespace CalamityMod.Items { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, { ItemID.MythrilRepeater, Do(UseExact(16)) }, { ItemID.MythrilSword, Do(UseTurn, DamageExact(70), UseExact(8)) }, - { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(70)) }, + { ItemID.NailGun, Do(DamageExact(77)) }, + { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(65)) }, { ItemID.NightsEdge, Do(TrueMelee, DamageExact(45)) }, { ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed) }, - { ItemID.OrangePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.OrangePhasesaber, Do(DamageExact(132)) }, + { ItemID.OrangePhaseblade, phaseblade }, + { ItemID.OrangePhasesaber, phasesaber }, { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, { ItemID.OrichalcumRepeater, Do(DamageExact(48)) }, { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, { ItemID.PainterPaintballGun, Do(DamageExact(8)) }, - { ItemID.PaladinsHammer, Do(DamageExact(100), ShootSpeedExact(23)) }, + { ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) }, { ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, { ItemID.PalladiumRepeater, Do(DamageExact(45)) }, { ItemID.PalladiumSword, Do(UseTurn, DamageExact(150)) }, @@ -195,18 +200,16 @@ namespace CalamityMod.Items { ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) }, { ItemID.Phantasm, Do(DamageExact(48)) }, { ItemID.PhoenixBlaster, Do(AutoReuse, UseExact(20)) }, - { ItemID.PiranhaGun, Do(DamageExact(48)) }, { ItemID.PlatinumBow, Do(DamageExact(12)) }, - { ItemID.PlatinumCoin, Do(DamageExact(150)) }, // For Coin Gun { ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) }, { ItemID.PoisonStaff, Do(DamageExact(57)) }, { ItemID.PossessedHatchet, Do(DamageExact(135)) }, - { ItemID.PrincessWeapon, Do(DamageExact(90)) }, // Resonance Scepter + { ItemID.PrincessWeapon, Do(DamageExact(80)) }, // Resonance Scepter { ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageExact(200)) }, { ItemID.PurpleClubberfish, Do(UseTurn, KnockbackExact(10f)) }, - { ItemID.PurplePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.PurplePhasesaber, Do(DamageExact(132)) }, - { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(70)) }, + { ItemID.PurplePhaseblade, phaseblade }, + { ItemID.PurplePhasesaber, phasesaber }, + { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(63)) }, { ItemID.QuadBarrelShotgun, Do(DamageExact(11)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, { ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13), KnockbackExact(8f)) }, @@ -214,14 +217,15 @@ namespace CalamityMod.Items { ItemID.RavenStaff, Do(AutoReuse, UseExact(20), DamageExact(36)) }, { ItemID.RazorbladeTyphoon, Do(DamageExact(103)) }, { ItemID.Razorpine, Do(DamageExact(40)) }, - { ItemID.RedPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.RedPhasesaber, Do(DamageExact(132)) }, + { ItemID.RedPhaseblade, phaseblade }, + { ItemID.RedPhasesaber, phasesaber }, { 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(70)) }, + { ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) }, { ItemID.Sandgun, Do(DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, - { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(75), ShootSpeedDelta(+4f)) }, + { ItemID.ScourgeoftheCorruptor, Do(DamageExact(63)) }, + { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(45), ShootSpeedExact(16)) }, { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, { ItemID.ShadowFlameBow, Do(DamageExact(55)) }, { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, @@ -234,29 +238,30 @@ namespace CalamityMod.Items { 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(DamageExact(215)) }, + { ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) }, { ItemID.SolarEruption, Do(DamageExact(122)) }, { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain - { ItemID.SpaceGun, Do(DamageExact(25)) }, + { ItemID.SpaceGun, Do(DamageExact(23)) }, { ItemID.Spear, Do(AutoReuse, TrueMelee, DamageExact(14)) }, - { ItemID.SpectreStaff, Do(DamageExact(78)) }, + { ItemID.SpectreStaff, Do(DamageExact(72)) }, { ItemID.SpiritFlame, Do(UseExact(20), ManaExact(11), ShootSpeedExact(2f)) }, { ItemID.StaffofEarth, Do(DamageExact(150)) }, - { ItemID.StarCannon, Do(DamageExact(25)) }, + { ItemID.StarCannon, Do(DamageExact(25), UseExact(15)) }, { ItemID.StardustDragonStaff, Do(AutoReuse, DamageExact(20), UseExact(19)) }, { ItemID.StormTigerStaff, Do(AutoReuse, DamageExact(49), UseExact(20)) }, // Desert Tiger Staff { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(21)) }, // Stylish Scissors { ItemID.Stynger, Do(DamageExact(75)) }, + { ItemID.SuperStarCannon, Do(DamageExact(55)) }, { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, - { ItemID.TacticalShotgun, Do(DamageExact(41)) }, + { ItemID.TacticalShotgun, Do(DamageExact(34)) }, { ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane { ItemID.TendonBow, Do(DamageExact(17), AutoReuse) }, - { ItemID.TerraBlade, Do(DamageExact(92)) }, + { ItemID.TerraBlade, Do(DamageExact(95)) }, { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously, // Terrarian is extremely overpowered and requires a heavy nerf. { ItemID.Terrarian, Do(AutoReuse, DamageExact(90)) }, - { ItemID.TheEyeOfCthulhu, Do(AutoReuse, DamageExact(90)) }, + { ItemID.TheEyeOfCthulhu, Do(AutoReuse, DamageExact(80)) }, { ItemID.TheMeatball, Do(DamageExact(24)) }, { ItemID.TheRottedFork, Do(AutoReuse, TrueMelee, DamageExact(20)) }, { ItemID.TheUndertaker, Do(AutoReuse, DamageExact(15)) }, @@ -266,6 +271,7 @@ namespace CalamityMod.Items { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, { ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, { ItemID.TopazStaff, Do(ManaExact(2)) }, + { ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33), ManaExact(20)) }, { ItemID.Toxikarp, Do(UseExact(9)) }, { ItemID.Trident, Do(AutoReuse, TrueMelee, DamageExact(20)) }, { ItemID.Trimarang, Do(DamageExact(24)) }, @@ -279,50 +285,27 @@ namespace CalamityMod.Items { 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(DamageExact(55)) }, - { ItemID.VenusMagnum, Do(DamageExact(65)) }, - { ItemID.WaspGun, Do(UseExact(11), DamageExact(58)) }, + { ItemID.VenomStaff, Do(UseExact(27)) }, + { ItemID.WaspGun, Do(DamageExact(44)) }, { ItemID.WaterBolt, Do(DamageExact(23)) }, - { ItemID.WhitePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.WhitePhasesaber, Do(DamageExact(132)) }, + { ItemID.WhitePhaseblade, phaseblade }, + { ItemID.WhitePhasesaber, phasesaber }, { ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) }, { ItemID.Yelets, Do(AutoReuse, DamageExact(53)) }, - { ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.YellowPhasesaber, Do(DamageExact(132)) }, + { ItemID.YellowPhaseblade, phaseblade }, + { ItemID.YellowPhasesaber, phasesaber }, { ItemID.Zenith, Do(DamageExact(210)) }, { ItemID.ZombieArm, Do(AutoReuse, UseTurn, KnockbackExact(12f)) }, #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)) }, @@ -332,106 +315,99 @@ namespace CalamityMod.Items #region CATEGORY 3: Tool Balancing { ItemID.AcornAxe, Do(AxePower(100)) }, // Axe of Regrowth - { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) }, - { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) }, - { ItemID.AdamantitePickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, + { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), TileBoostExact(+0), DamageExact(75)) }, + { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, TileBoostExact(+1), DamageExact(32)) }, + { ItemID.AdamantitePickaxe, Do(TileBoostExact(+1)) }, { ItemID.AdamantiteWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.BonePickaxe, Do(PickPower(55), UseTimeExact(6)) }, - { ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0)) }, + { ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13)) }, + { ItemID.BonePickaxe, Do(UseTimeExact(6)) }, + { ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11)) }, + { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+0)) }, { ItemID.CactusPickaxe, Do(PickPower(34), UseTimeExact(9)) }, - { ItemID.CnadyCanePickaxe, Do(PickPower(55), UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe - { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0), DamageExact(112)) }, - { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, PickPower(200), UseTimeExact(4), TileBoostExact(+2), DamageExact(43)) }, - { ItemID.ChlorophyteGreataxe, Do(AxePower(165), UseTimeExact(7), TileBoostExact(+2)) }, - { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, HammerPower(90), UseTimeExact(5), TileBoostExact(+0)) }, - { ItemID.ChlorophytePickaxe, Do(PickPower(200), UseTimeExact(7), TileBoostExact(+2)) }, - { ItemID.ChlorophyteWarhammer, Do(HammerPower(90), UseTimeExact(8), TileBoostExact(+2)) }, - { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) }, + { ItemID.CnadyCanePickaxe, Do(UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe + { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), DamageExact(112)) }, + { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, TileBoostExact(+2), DamageExact(43)) }, + { ItemID.ChlorophyteGreataxe, Do(AxePower(165), TileBoostExact(+2)) }, + { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, UseTimeExact(5)) }, + { ItemID.ChlorophytePickaxe, Do(TileBoostExact(+2)) }, + { ItemID.ChlorophyteWarhammer, Do(UseTimeExact(8), TileBoostExact(+2)) }, + { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(4), DamageExact(51)) }, { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) }, { ItemID.CobaltPickaxe, Do(PickPower(130), UseTimeExact(9)) }, - { ItemID.CobaltWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) }, + { ItemID.CobaltWaraxe, Do(AxePower(125), UseTimeExact(12)) }, { ItemID.CopperAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) }, - { ItemID.CopperHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) }, - { ItemID.CopperPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.DeathbringerPickaxe, Do(PickPower(70), UseTimeExact(10)) }, - { ItemID.Drax, Do(TrueMeleeNoSpeed, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1), DamageExact(80)) }, - { ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9), TileBoostExact(+0)) }, - { ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.GoldAxe, Do(AxePower(80), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.GoldHammer, Do(HammerPower(60), UseTimeExact(9), TileBoostExact(+0)) }, - { ItemID.GoldPickaxe, Do(PickPower(55), UseTimeExact(9)) }, - { ItemID.Hammush, Do(HammerPower(85), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.IronAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) }, - { ItemID.IronHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.IronPickaxe, Do(PickPower(40), UseTimeExact(8)) }, + { ItemID.CopperHammer, Do(UseTimeExact(12), TileBoostExact(+0)) }, + { ItemID.CopperPickaxe, Do(UseTimeExact(10), TileBoostExact(+0)) }, + { ItemID.DeathbringerPickaxe, Do(UseTimeExact(10)) }, + { ItemID.Drax, Do(TrueMeleeNoSpeed, TileBoostExact(+1), DamageExact(80)) }, + { ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9)) }, + { ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13)) }, + { ItemID.GoldAxe, Do(AxePower(80), UseTimeExact(14)) }, + { ItemID.GoldHammer, Do(HammerPower(60), UseTimeExact(9)) }, + { ItemID.GoldPickaxe, Do(UseTimeExact(9)) }, + { ItemID.Hammush, Do(UseTimeExact(10), TileBoostExact(+1)) }, + { ItemID.IronAxe, Do(AxePower(60), UseTimeExact(15)) }, + { ItemID.IronHammer, Do(HammerPower(45), UseTimeExact(11)) }, + { ItemID.IronPickaxe, Do(UseTimeExact(8)) }, { ItemID.LaserDrill, Do(PickPower(220), AxePower(120), UseTimeExact(4), DamageExact(54)) }, - { ItemID.LeadAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) }, - { ItemID.LeadHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) }, + { ItemID.LeadAxe, Do(AxePower(60), UseTimeExact(15)) }, + { ItemID.LeadHammer, Do(HammerPower(45), UseTimeExact(11)) }, { ItemID.LeadPickaxe, Do(PickPower(40), UseTimeExact(8)) }, - { ItemID.LucyTheAxe, Do(AxePower(150), UseExact(13), TileBoostExact(+1)) }, - { ItemID.LunarHamaxeNebula, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.LunarHamaxeSolar, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.LunarHamaxeStardust, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.LunarHamaxeVortex, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.MeteorHamaxe, Do(HammerPower(70), AxePower(100), UseTimeExact(16), TileBoostExact(+0)) }, - { ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.MoltenPickaxe, Do(PickPower(100), UseTimeExact(10)) }, - { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) }, + { ItemID.LucyTheAxe, Do(UseExact(13), TileBoostExact(+1)) }, + { ItemID.LunarHamaxeNebula, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.LunarHamaxeSolar, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.LunarHamaxeStardust, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.LunarHamaxeVortex, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.MeteorHamaxe, Do(HammerPower(70)) }, + { ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125)) }, + { ItemID.MoltenPickaxe, Do(UseTimeExact(10)) }, + { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), DamageExact(63)) }, { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, { ItemID.MythrilPickaxe, Do(PickPower(160), UseTimeExact(8)) }, - { ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.NebulaPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, + { ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11)) }, + { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, { ItemID.NightmarePickaxe, Do(PickPower(66), UseTimeExact(9)) }, - { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) }, + { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), DamageExact(63)) }, { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, { ItemID.OrichalcumPickaxe, Do(PickPower(160), UseTimeExact(8)) }, - { ItemID.OrichalcumWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) }, - { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) }, - { ItemID.PalladiumPickaxe, Do(PickPower(130), UseTimeExact(9)) }, - { ItemID.PalladiumWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) }, - { ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.PearlwoodHammer, Do(HammerPower(25), UseTimeExact(4), UseAnimationExact(20), DamageExact(36), TileBoostExact(+0)) }, - { ItemID.PickaxeAxe, Do(PickPower(200), AxePower(110), UseTimeExact(7), TileBoostExact(+1)) }, - { ItemID.Picksaw, Do(PickPower(210), AxePower(125), UseTimeExact(6), TileBoostExact(+1)) }, - { ItemID.PlatinumAxe, Do(AxePower(80), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.PlatinumHammer, Do(HammerPower(60), UseTimeExact(9), TileBoostExact(+0)) }, + { ItemID.OrichalcumWaraxe, Do(AxePower(140), UseTimeExact(11)) }, + { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), DamageExact(51)) }, + { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, UseTimeExact(5), DamageExact(21)) }, + { ItemID.PalladiumPickaxe, Do(UseTimeExact(9)) }, + { ItemID.PalladiumWaraxe, Do(AxePower(125)) }, + { ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11)) }, + { ItemID.PearlwoodHammer, Do(HammerPower(25), UseTimeExact(4), UseAnimationExact(20), DamageExact(36)) }, + { ItemID.PickaxeAxe, Do(TileBoostExact(+1)) }, + { ItemID.PlatinumAxe, Do(AxePower(80), UseTimeExact(14)) }, + { ItemID.PlatinumHammer, Do(HammerPower(60), UseTimeExact(9)) }, { ItemID.PlatinumPickaxe, Do(PickPower(55), UseTimeExact(9)) }, - { ItemID.Pwnhammer, Do(HammerPower(80), UseTimeExact(11), TileBoostExact(+1)) }, + { ItemID.Pwnhammer, Do(UseTimeExact(11), TileBoostExact(+1)) }, { ItemID.ReaverShark, Do(PickPower(65), UseTimeExact(16)) }, - { ItemID.RichMahoganyHammer, Do(HammerPower(25), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.Rockfish, Do(HammerPower(50), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.SawtoothShark, Do(TrueMeleeNoSpeed, AxePower(45), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.ShadewoodHammer, Do(HammerPower(25), UseTimeExact(9), TileBoostExact(+0)) }, - { ItemID.ShroomiteDiggingClaw, Do(PickPower(200), AxePower(125), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.SilverAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.SilverHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.SilverPickaxe, Do(PickPower(50), UseTimeExact(11)) }, - { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.SolarFlarePickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, - { ItemID.SpectreHamaxe, Do(HammerPower(90), AxePower(170), TileBoostExact(+4)) }, - { ItemID.SpectrePickaxe, Do(PickPower(200), TileBoostExact(+4)) }, - { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.StardustPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, - { ItemID.TheAxe, Do(HammerPower(100), AxePower(175), UseTimeExact(7), TileBoostExact(+1)) }, - { ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.TinAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) }, - { ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) }, - { ItemID.TinPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) }, - { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) }, + { ItemID.RichMahoganyHammer, Do(HammerPower(25), UseTimeExact(10)) }, + { ItemID.Rockfish, Do(HammerPower(50), UseTimeExact(10)) }, + { ItemID.SawtoothShark, Do(TrueMeleeNoSpeed, AxePower(45)) }, + { ItemID.ShadewoodHammer, Do(HammerPower(25), UseTimeExact(9)) }, + { ItemID.SilverAxe, Do(AxePower(70), UseTimeExact(14)) }, + { ItemID.SilverHammer, Do(HammerPower(55), UseTimeExact(10)) }, + { ItemID.SilverPickaxe, Do(PickPower(50)) }, + { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, + { ItemID.SpectreHamaxe, Do(AxePower(170), TileBoostExact(+4)) }, + { ItemID.SpectrePickaxe, Do(TileBoostExact(+4)) }, + { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, + { ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13)) }, + { ItemID.TinAxe, Do(AxePower(50), UseTimeExact(16)) }, + { ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12)) }, + { ItemID.TinPickaxe, Do(UseTimeExact(10)) }, + { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), TileBoostExact(+0), DamageExact(75)) }, + { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), TileBoostExact(+1), DamageExact(32)) }, { ItemID.TitaniumPickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, { ItemID.TitaniumWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.TungstenAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.TungstenHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.TungstenPickaxe, Do(PickPower(50), UseTimeExact(11)) }, - { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.VortexPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, - { ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.WoodenHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, + { ItemID.TungstenAxe, Do(AxePower(70), UseTimeExact(14)) }, + { ItemID.TungstenHammer, Do(HammerPower(55), UseTimeExact(10)) }, + { ItemID.TungstenPickaxe, Do(UseTimeExact(11)) }, + { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, + { ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13)) }, + { ItemID.WoodenHammer, Do(UseTimeExact(11), TileBoostExact(+0)) }, #endregion #region CATEGORY 4: True Melee support @@ -470,7 +446,6 @@ namespace CalamityMod.Items { ItemID.DD2LightningAuraT1Popper, autoReuse }, // Lightning Aura Tier 1 { ItemID.DD2LightningAuraT2Popper, Do(AutoReuse, UseExact(25)) }, // Lightning Aura Tier 2 { ItemID.DD2LightningAuraT3Popper, Do(AutoReuse, UseExact(20)) }, // Lightning Aura Tier 3 - { ItemID.DeadlySphereStaff, Do(AutoReuse, UseExact(20)) }, { ItemID.FireWhip, autoReuse }, // Firecracker { ItemID.FlinxStaff, Do(AutoReuse, UseExact(35)) }, { ItemID.MaceWhip, autoReuse }, // Morning Star @@ -1343,15 +1318,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/DisgustingMeat.cs b/Items/DisgustingMeat.cs index e383ac2bbe..9a635b1bec 100644 --- a/Items/DisgustingMeat.cs +++ b/Items/DisgustingMeat.cs @@ -22,26 +22,61 @@ namespace CalamityMod.Items public override bool AltFunctionUse(Player player) => true; public override bool? UseItem(Player player) { - var calPlayer = player.Calamity(); - if (player.altFunctionUse == 2) + if (player.ItemTimeIsZero) { - TryDropBoosterItem(player, ref calPlayer.rageBoostOne, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.rageBoostTwo, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.rageBoostThree, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.adrenalineBoostOne, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.adrenalineBoostTwo, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.adrenalineBoostThree, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.nimbleBounderBoost, ModContent.ItemType()); - } - else - { - TryDropBoosterItem(player, ref calPlayer.sTangerine, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.mFruit, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.tCloudberry, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.sStrawberry, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.cShard, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.eCore, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.pHeart, ModContent.ItemType()); + var calPlayer = player.Calamity(); + if (player.altFunctionUse == 2) + { + TryDropBoosterItem(player, ref calPlayer.rageBoostOne, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.rageBoostTwo, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.rageBoostThree, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.adrenalineBoostOne, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.adrenalineBoostTwo, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.adrenalineBoostThree, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.nimbleBounderBoost, ModContent.ItemType()); + } + else + { + if (calPlayer.sTangerine || calPlayer.mFruit || calPlayer.tCloudberry || calPlayer.sStrawberry) + { + TryDropBoosterItem(player, ref calPlayer.sTangerine, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.mFruit, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.tCloudberry, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.sStrawberry, ModContent.ItemType()); + } + else + { + for (int i = 0; i < player.ConsumedLifeFruit; i++) + { + int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, ItemID.LifeFruit); + Main.item[drop].noGrabDelay = 100; + } + player.ConsumedLifeFruit = 0; + for (int j = 0; j < player.ConsumedLifeCrystals; j++) + { + int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, ItemID.LifeCrystal); + Main.item[drop].noGrabDelay = 100; + } + player.ConsumedLifeCrystals = 0; + } + + if (calPlayer.cShard || calPlayer.eCore || calPlayer.pHeart) + { + TryDropBoosterItem(player, ref calPlayer.cShard, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.eCore, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.pHeart, ModContent.ItemType()); + } + else + { + for (int k = 0; k < player.ConsumedManaCrystals; k++) + { + int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, ItemID.ManaCrystal); + Main.item[drop].noGrabDelay = 100; + } + player.ConsumedManaCrystals = 0; + } + } + return true; } return null; diff --git a/Items/DraedonMisc/EncryptedSchematicJungle.cs b/Items/DraedonMisc/EncryptedSchematicJungle.cs index 21ea505af7..0f3fb5688e 100644 --- a/Items/DraedonMisc/EncryptedSchematicJungle.cs +++ b/Items/DraedonMisc/EncryptedSchematicJungle.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.DraedonMisc rangedDisplay.OverrideColor = new Color(236, 255, 31); list.Insert(insertIndex + 2, rangedDisplay); - int mageItem = ModContent.ItemType(); + int mageItem = ModContent.ItemType(); TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{mageItem}] {CalamityUtils.GetItemName(mageItem)}"); mageDisplay.OverrideColor = new Color(255, 64, 31); list.Insert(insertIndex + 3, mageDisplay); diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index fb7e5cccf1..c5d36826ae 100644 --- a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -59,12 +59,12 @@ namespace CalamityMod.Items.DraedonMisc meleeDisplay.OverrideColor = new Color(31, 242, 245); list.Insert(insertIndex + 1, meleeDisplay); - int rangedItem = ModContent.ItemType(); + int rangedItem = ModContent.ItemType(); TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{rangedItem}] {CalamityUtils.GetItemName(rangedItem)}"); rangedDisplay.OverrideColor = new Color(149, 243, 43); list.Insert(insertIndex + 2, rangedDisplay); - int mageItem = ModContent.ItemType(); + int mageItem = ModContent.ItemType(); TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{mageItem}] {CalamityUtils.GetItemName(mageItem)}"); mageDisplay.OverrideColor = new Color(236, 255, 31); list.Insert(insertIndex + 3, mageDisplay); 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/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/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 9f73c7efe0..6b89b76f91 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public static int RegenTimeBoost = 10; 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/IHoldShiftTooltipItem.cs b/Items/IHoldShiftTooltipItem.cs index 8ef0a22b79..28938b7a60 100644 --- a/Items/IHoldShiftTooltipItem.cs +++ b/Items/IHoldShiftTooltipItem.cs @@ -2,7 +2,7 @@ namespace CalamityMod.Items { - // This interface is used on items where you can hold Left SHIFT for an expanded tooltip. + // This interface is used on items where you can hold SHIFT for an expanded tooltip. // All actual implementation of this behavior is done in CalamityGlobalItemTooltip. public interface IHoldShiftTooltipItem { @@ -52,7 +52,7 @@ namespace CalamityMod.Items #endregion /// - /// Whether holding Left SHIFT for the tooltip extension hides the normal tooltip. Typically this is false. + /// Whether holding SHIFT for the tooltip extension hides the normal tooltip. Typically this is false. /// public virtual bool HidesNormalTooltip => false; diff --git a/Items/LoreItems/LoreCynosure.cs b/Items/LoreItems/LoreCynosure.cs index 314bb4f7ea..2e916362f6 100644 --- a/Items/LoreItems/LoreCynosure.cs +++ b/Items/LoreItems/LoreCynosure.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.LoreItems Item.width = 20; Item.height = 20; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void AddRecipes() diff --git a/Items/LoreItems/LoreDevourerofGods.cs b/Items/LoreItems/LoreDevourerofGods.cs index 04ca63eed8..360f4c90bb 100644 --- a/Items/LoreItems/LoreDevourerofGods.cs +++ b/Items/LoreItems/LoreDevourerofGods.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.LoreItems Item.width = 20; Item.height = 20; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void AddRecipes() diff --git a/Items/LoreItems/LoreYharon.cs b/Items/LoreItems/LoreYharon.cs index ee0dc0feab..25e5910e76 100644 --- a/Items/LoreItems/LoreYharon.cs +++ b/Items/LoreItems/LoreYharon.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.LoreItems Item.width = 20; Item.height = 20; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void AddRecipes() 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/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/Mounts/OnyxExcavator.cs b/Items/Mounts/OnyxExcavator.cs index 402c49a00d..41bb443dd8 100644 --- a/Items/Mounts/OnyxExcavator.cs +++ b/Items/Mounts/OnyxExcavator.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Mounts MountData.buff = ModContent.BuffType(); // Horizontal movement - MountData.runSpeed = 5.5f; + MountData.runSpeed = 4.5f; MountData.swimSpeed = 0.5f; - MountData.acceleration = 0.2f; + MountData.acceleration = 0.1f; // Vertical movement MountData.fallDamage = 0f; diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index 974b0cbc05..ce2efc22de 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(5). AddIngredient(12). AddTile(TileID.MythrilAnvil). diff --git a/Items/PermanentBoosters/SacredStrawberry.cs b/Items/PermanentBoosters/SacredStrawberry.cs index e22276385a..94cb0bf4ed 100644 --- a/Items/PermanentBoosters/SacredStrawberry.cs +++ b/Items/PermanentBoosters/SacredStrawberry.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(5). AddIngredient(). AddTile(). diff --git a/Items/PermanentBoosters/SanguineTangerine.cs b/Items/PermanentBoosters/SanguineTangerine.cs index 1348fda9fe..7fa60d5666 100644 --- a/Items/PermanentBoosters/SanguineTangerine.cs +++ b/Items/PermanentBoosters/SanguineTangerine.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(10). AddIngredient(ItemID.SoulofFright, 5). AddIngredient(ItemID.SoulofMight, 5). diff --git a/Items/PermanentBoosters/TaintedCloudberry.cs b/Items/PermanentBoosters/TaintedCloudberry.cs index 56fc3b45ac..f78a25b857 100644 --- a/Items/PermanentBoosters/TaintedCloudberry.cs +++ b/Items/PermanentBoosters/TaintedCloudberry.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(10). AddIngredient(8). AddTile(TileID.MythrilAnvil). diff --git a/Items/Placeables/Astral/CelestialRemains.cs b/Items/Placeables/Astral/CelestialRemains.cs index 5c5a398db9..1ac5969a51 100644 --- a/Items/Placeables/Astral/CelestialRemains.cs +++ b/Items/Placeables/Astral/CelestialRemains.cs @@ -108,32 +108,32 @@ namespace CalamityMod.Items.Placeables.Astral resultType = ItemID.Amber; resultStack = Main.rand.Next(1, 21); } - else if (val < 81.78f) + else if (val < 81.78f && Main.hardMode) { resultType = ItemID.PalladiumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 83.03f) + else if (val < 83.03f && Main.hardMode) { resultType = ItemID.CobaltOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 85.03f) + else if (val < 85.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre : ItemID.MythrilOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 87.03f) + else if (val < 87.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre : ItemID.OrichalcumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 88.78f) + else if (val < 88.78f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre : ItemID.AdamantiteOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 89.53f) + else if (val < 89.53f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); diff --git a/Items/Placeables/Astral/NovaeSlag.cs b/Items/Placeables/Astral/NovaeSlag.cs index b78942be81..116e17712e 100644 --- a/Items/Placeables/Astral/NovaeSlag.cs +++ b/Items/Placeables/Astral/NovaeSlag.cs @@ -97,32 +97,32 @@ namespace CalamityMod.Items.Placeables.Astral resultType = ItemID.Amber; resultStack = Main.rand.Next(1, 21); } - else if (val < 78.78f) + else if (val < 78.78f && Main.hardMode) { resultType = ItemID.PalladiumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 81.03f) + else if (val < 81.03f && Main.hardMode) { resultType = ItemID.CobaltOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 83.03f) + else if (val < 83.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre : ItemID.MythrilOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 85.03f) + else if (val < 85.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre : ItemID.OrichalcumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 86.78f) + else if (val < 86.78f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre : ItemID.AdamantiteOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 88.53f) + else if (val < 88.53f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index 3d465cc42d..372f45c854 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -4,7 +4,6 @@ using CalamityMod.Tiles.Furniture.DevPaintings; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Microsoft.Xna.Framework.Input.Keys; namespace CalamityMod.Items.Placeables.Furniture.DevPaintings { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings public override void ModifyTooltips(List tooltips) { - if (!Main.keyState.IsKeyDown(LeftShift)) + if (!Main.keyState.PressingShift()) return; string tooltip = ""; @@ -52,11 +51,11 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings public static IList devList = new List() { "Altix", - "Angel", "apotofkoolaid", "AquaSG", "Atalya", "Ben-TK", + "Big E", "CDMusic", "Cei", "CongratsIsTrash", @@ -65,6 +64,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "CrabBar", "Dandy", "Dia", + "Done", "dozezoze", "Eddie Spaghetti", "ENNWAY", @@ -73,7 +73,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "fryzahh", "HaguriHat", "Heart Plus Up!", - "Hugekraken", "LordMetarex", "Memes", "Mercutio 'Merkalto' Takle", @@ -90,6 +89,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Shayy", "Spider Prov", "StipulateVenus", + "Sunny", "Tobias", "Tomat", "Triangle", @@ -118,7 +118,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "DarkTiny", "Demik", "DM Dokuro", - "Done", "Doog", "drh", "dwshin", @@ -137,6 +136,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Graydee", "Grox the Great", "Hectique", + "Hugekraken", "Huggles", "Ian-1KV", "IbanPlay", 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/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/VoidTorch.cs b/Items/Placeables/Furniture/VoidTorch.cs index 8f1d5467ba..e759ca8304 100644 --- a/Items/Placeables/Furniture/VoidTorch.cs +++ b/Items/Placeables/Furniture/VoidTorch.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { + [LegacyName("AbyssTorch")] public class VoidTorch : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; 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/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/EutrophicTable.cs b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicTable.cs rename to Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs index e615b230a4..3bea3df35d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicTable.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 EutrophicTable : 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/EutrophicBench.cs b/Items/Placeables/FurnitureNavystone/NavystoneTable.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicBench.cs rename to Items/Placeables/FurnitureNavystone/NavystoneTable.cs index 20f4da4428..009034c1dd 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBench.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 EutrophicBench : 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/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/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index 91606786c4..0404bafdb8 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(30, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(6), true); + Item.DefaultToFood(30, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/SupremeHealingPotion.cs b/Items/Potions/SupremeHealingPotion.cs index 8d2d5d7d74..a6be404eb4 100644 --- a/Items/Potions/SupremeHealingPotion.cs +++ b/Items/Potions/SupremeHealingPotion.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Potions { Item.DefaultToHealingPotion(26, 38, 250); Item.value = Item.sellPrice(silver: 60); - Item.rare = ItemRarityID.Purple; + Item.rare = ModContent.RarityType(); } public override void AddRecipes() 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/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/SuperDummy.cs b/Items/SuperDummy.cs index c6055399d2..47958aa978 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items } } } - else if (player.whoAmI == Main.myPlayer) + else if (player.whoAmI == Main.myPlayer && NPC.CountNPCS(ModContent.NPCType()) < 50) { int x = (int)Main.MouseWorld.X - 9; int y = (int)Main.MouseWorld.Y - 20; 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/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 08b9c7558d..29a16a9229 100644 --- a/Items/TreasureBags/CalamitasCloneBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.TreasureBags // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); itemLoot.Add(ModContent.ItemType()); - itemLoot.Add(ModContent.ItemType(), 10); + itemLoot.Add(ModContent.ItemType(), 10); itemLoot.AddRevBagAccessories(); // Vanity 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/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 index 478e6ceca6..f284793d44 100644 --- a/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public const int DelayBetweenHeals = 270; - public const int BaseDamageToEnemies = 250; + public const int BaseDamageToEnemies = 220; public override void UpdateSetBonusText(ref string setBonusText) { 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 94f7ed96f4..2226f8afe5 100644 --- a/Items/VanillaArmorChanges/EskimoArmorSetChange.cs +++ b/Items/VanillaArmorChanges/EskimoArmorSetChange.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyArmorSetBonus(Player player) { player.Calamity().eskimoSet = true; + player.Calamity().ColdDebuffMultiplier += 0.25f; player.buffImmune[BuffID.Frostburn] = true; - player.buffImmune[ModContent.BuffType()] = 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/CountermeasureMitt.cs b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.cs new file mode 100644 index 0000000000..f364289272 --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.DraedonsArsenal; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + [LegacyName("GatlingLaser")] + public class CountermeasureMitt : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public override void SetDefaults() + { + CalamityGlobalItem modItem = Item.Calamity(); + + Item.width = 54; + Item.height = 56; + Item.DamageType = DamageClass.Magic; + Item.mana = 3; + Item.damage = 45; + Item.knockBack = 4f; + Item.useAnimation = Item.useTime = 11; + Item.autoReuse = true; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.channel = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; + + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 24f; + } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + 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 void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow").Value); + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + float gunType = 0; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && player.Calamity().arsenalCooldown <= 0) + gunType = 5; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, gunType); + + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(15). + AddIngredient(5). + AddIngredient(10). + AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Func condition), condition). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/CountermeasureMitt.png b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.png new file mode 100644 index 0000000000..ea23481c15 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.png differ diff --git a/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow.png b/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow.png new file mode 100644 index 0000000000..3c119c3088 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow.png differ diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs deleted file mode 100644 index 17fb58acf7..0000000000 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using CalamityMod.CustomRecipes; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.DraedonsArsenal; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.DraedonsArsenal -{ - public class GatlingLaser : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/GatlingLaserFireStart"); - public static readonly SoundStyle FireLoopSound = new("CalamityMod/Sounds/Item/GatlingLaserFireLoop"); - public static readonly SoundStyle FireEndSound = new("CalamityMod/Sounds/Item/GatlingLaserFireEnd"); - - - // This is the amount of charge consumed every time the holdout projectile fires a laser. - public const float HoldoutChargeUse = 0.0075f; - - public override void SetDefaults() - { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.width = 43; - Item.height = 24; - Item.DamageType = DamageClass.Magic; - Item.damage = 43; - Item.knockBack = 1f; - Item.useTime = 2; - Item.useAnimation = 2; - Item.noUseGraphic = true; - Item.autoReuse = false; - Item.channel = true; - Item.mana = 4; - - Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = FireSound; - Item.noMelee = true; - - Item.value = CalamityGlobalItem.RarityYellowBuyPrice; - Item.rare = ItemRarityID.Yellow; - - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 24f; - - modItem.UsesCharge = true; - modItem.MaxCharge = 135f; - modItem.ChargePerUse = 0f; // This weapon is a holdout. Charge is consumed by the holdout projectile. - } - - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - - public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); - - public override Vector2? HoldoutOffset() => new Vector2(-20, 0); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(15). - AddIngredient(15). - AddIngredient(5). - AddIngredient(10). - AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Func condition), condition). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} 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/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs deleted file mode 100644 index 445df79e74..0000000000 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using CalamityMod.CustomRecipes; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.DraedonsArsenal; -using CalamityMod.Sounds; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.DraedonsArsenal -{ - public class GaussPistol : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - public override void SetDefaults() - { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.width = 40; - Item.height = 22; - Item.DamageType = DamageClass.Magic; - Item.mana = 6; - Item.damage = 150; - Item.knockBack = 11f; - Item.useAnimation = Item.useTime = 20; - Item.autoReuse = true; - - Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = CommonCalamitySounds.GaussWeaponFire; - Item.noMelee = true; - - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; - Item.rare = ItemRarityID.Pink; - - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 14f; - - modItem.MaxCharge = 85f; - modItem.UsesCharge = true; - modItem.ChargePerUse = 0.05f; - } - - public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(12). - AddIngredient(8). - AddRecipeGroup("AnyMythrilBar", 10). - AddIngredient(ItemID.SoulofMight, 20). - AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Func condition), condition). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.png b/Items/Weapons/DraedonsArsenal/GaussPistol.png deleted file mode 100644 index d68e739419..0000000000 Binary files a/Items/Weapons/DraedonsArsenal/GaussPistol.png and /dev/null differ diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs b/Items/Weapons/DraedonsArsenal/HolofibreImmolator.cs similarity index 92% rename from Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs rename to Items/Weapons/DraedonsArsenal/HolofibreImmolator.cs index a260077562..50f7d1ee74 100644 --- a/Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs +++ b/Items/Weapons/DraedonsArsenal/HolofibreImmolator.cs @@ -14,7 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { [LegacyName("MatterModulator")] - public class HolofiberImmolator : ModItem, ILocalizedModType + public class HolofibreImmolator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; public static readonly SoundStyle PlasmaSound = new("CalamityMod/Sounds/Item/PlasmaSmall"); @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; } @@ -48,11 +48,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; 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/HolofiberImmolatorGlow").Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow").Value); } 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, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolator.png b/Items/Weapons/DraedonsArsenal/HolofibreImmolator.png similarity index 100% rename from Items/Weapons/DraedonsArsenal/HolofiberImmolator.png rename to Items/Weapons/DraedonsArsenal/HolofibreImmolator.png diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow.png b/Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow.png similarity index 100% rename from Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow.png rename to Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow.png 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/Vulcan.cs b/Items/Weapons/DraedonsArsenal/Vulcan.cs new file mode 100644 index 0000000000..5c7a7f9f4f --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/Vulcan.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +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 +{ + [LegacyName("GaussPistol")] + public class Vulcan : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public override void SetDefaults() + { + Item.width = 28; + Item.height = 34; + Item.DamageType = DamageClass.Magic; + Item.mana = 11; + Item.damage = 40; + Item.knockBack = 11f; + Item.useAnimation = Item.useTime = 11; + Item.autoReuse = true; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.channel = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; + + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 14f; + } + + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + 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 void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/VulcanGlow").Value); + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + float gunType = 0; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && player.Calamity().arsenalCooldown <= 0) + gunType = 5; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, gunType); + + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(12). + AddIngredient(8). + AddRecipeGroup("AnyMythrilBar", 10). + AddIngredient(ItemID.SoulofMight, 20). + AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Func condition), condition). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/Vulcan.png b/Items/Weapons/DraedonsArsenal/Vulcan.png new file mode 100644 index 0000000000..975227e30f Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/Vulcan.png differ diff --git a/Items/Weapons/DraedonsArsenal/VulcanGlow.png b/Items/Weapons/DraedonsArsenal/VulcanGlow.png new file mode 100644 index 0000000000..8a4e160b58 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/VulcanGlow.png differ 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 154e914af3..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,12 +21,15 @@ 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; Item.height = 50; - Item.damage = 127; + Item.damage = 65; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useTime = 22; @@ -58,8 +63,8 @@ namespace CalamityMod.Items.Weapons.Magic if (nonReleasedMusicNotes >= musicNoteCap) { - Main.musicPitch = -0.5f; - SoundEngine.PlaySound(CapSound with { Volume = 0.8f }, player.Center); + if (!Main.zenithWorld) + SoundEngine.PlaySound(CapSound with { Volume = 0.8f }, player.Center); return false; } else diff --git a/Items/Weapons/Magic/ArcticBearPaw.cs b/Items/Weapons/Magic/ArcticBearPaw.cs index 467f1d0c4b..66ea5e090c 100644 --- a/Items/Weapons/Magic/ArcticBearPaw.cs +++ b/Items/Weapons/Magic/ArcticBearPaw.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 28; Item.height = 24; - Item.damage = 90; + Item.damage = 80; Item.DamageType = DamageClass.Magic; Item.mana = 18; Item.useTime = 28; diff --git a/Items/Weapons/Magic/AstralachneaStaff.cs b/Items/Weapons/Magic/AstralachneaStaff.cs index 8ffa9448aa..27113d25e3 100644 --- a/Items/Weapons/Magic/AstralachneaStaff.cs +++ b/Items/Weapons/Magic/AstralachneaStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 52; Item.height = 52; - Item.damage = 50; + Item.damage = 55; Item.DamageType = DamageClass.Magic; Item.mana = 19; Item.useTime = 21; @@ -39,38 +39,18 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - int i = Main.myPlayer; - float fangSpeed = Item.shootSpeed; float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - int spikeAmount = 4; - if (Main.rand.NextBool(3)) - { - spikeAmount++; - } - if (Main.rand.NextBool(4)) - { - spikeAmount++; - } - if (Main.rand.NextBool(5)) - { - spikeAmount += 2; - } + + int spikeAmount = Main.rand.Next(3, 4+1); for (int j = 0; j < spikeAmount; j++) { - float fangSpawnX = mouseXDist; - float fangSpawnY = mouseYDist; - float offsetDampener = 0.05f * (float)j; - fangSpawnX += (float)Main.rand.Next(-400, 400) * offsetDampener; - fangSpawnY += (float)Main.rand.Next(-400, 400) * offsetDampener; - float fangDistance = (float)Math.Sqrt((double)(fangSpawnX * fangSpawnX + fangSpawnY * fangSpawnY)); - fangDistance = fangSpeed / fangDistance; - fangSpawnX *= fangDistance; - fangSpawnY *= fangDistance; - float x2 = realPlayerPos.X; - float y2 = realPlayerPos.Y; - Projectile.NewProjectile(source, x2, y2, fangSpawnX, fangSpawnY, ModContent.ProjectileType(), damage, knockback, i, 0f, 0f); + Vector2 fangSpawn = new Vector2(mouseXDist, mouseYDist); + fangSpawn.X += Main.rand.NextFloat(-20f, 20f) * j; + fangSpawn.Y += Main.rand.NextFloat(-20f, 20f) * j; + fangSpawn = fangSpawn.SafeNormalize(Vector2.UnitX) * Item.shootSpeed; + + Projectile.NewProjectile(source, realPlayerPos, fangSpawn, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Magic/Atlantis.cs b/Items/Weapons/Magic/Atlantis.cs index ffa9afe85a..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,13 +17,14 @@ 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 = 28; Item.height = 30; - Item.damage = 88; + Item.damage = 81; Item.DamageType = DamageClass.Magic; Item.mana = 12; Item.useTime = 25; 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/EvergladeSpray.cs b/Items/Weapons/Magic/EvergladeSpray.cs index d073842bf8..4f43c5ad4f 100644 --- a/Items/Weapons/Magic/EvergladeSpray.cs +++ b/Items/Weapons/Magic/EvergladeSpray.cs @@ -13,14 +13,14 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 34; Item.height = 30; - Item.damage = 28; + Item.damage = 65; Item.DamageType = DamageClass.Magic; - Item.mana = 8; + Item.mana = 7; Item.useTime = 6; Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 4.5f; + Item.knockBack = 2f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item13; 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/HadalUrn.cs b/Items/Weapons/Magic/HadalUrn.cs index 1a30b38322..22c98c5b65 100644 --- a/Items/Weapons/Magic/HadalUrn.cs +++ b/Items/Weapons/Magic/HadalUrn.cs @@ -21,8 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 37; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.useTime = 16; - Item.useAnimation = 16; + Item.useTime = Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.75f; diff --git a/Items/Weapons/Magic/HellwingStaff.cs b/Items/Weapons/Magic/HellwingStaff.cs index 11717fe7c5..964464d8d0 100644 --- a/Items/Weapons/Magic/HellwingStaff.cs +++ b/Items/Weapons/Magic/HellwingStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 70; Item.height = 60; - Item.damage = 22; + Item.damage = 21; Item.DamageType = DamageClass.Magic; Item.mana = 18; Item.useTime = 30; @@ -39,48 +39,18 @@ 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) { - float projSpeed = velocity.Length(); - Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float mouseXDist = (float)Main.mouseX + Main.screenPosition.X + realPlayerPos.X; - float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y + realPlayerPos.Y; - if (player.gravDir == -1f) - { - mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + realPlayerPos.Y; - } - float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f)) - { - mouseXDist = (float)player.direction; - mouseYDist = 0f; - mouseDistance = projSpeed; - } - else - { - mouseDistance = projSpeed / mouseDistance; - } - for (int i = 0; i < 4; i++) { - realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y); - realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - realPlayerPos.Y -= (float)(100 * i); - mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - if (mouseYDist < 0f) - { - mouseYDist *= -1f; - } - if (mouseYDist < 20f) - { - mouseYDist = 20f; - } - mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - mouseDistance = projSpeed / mouseDistance; - mouseXDist *= mouseDistance; - mouseYDist *= mouseDistance; - float speedX4 = mouseXDist + (float)Main.rand.Next(-40, 41) * 0.02f; - float speedY5 = mouseYDist + (float)Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI); + Vector2 realPlayerPos = new Vector2((player.MountedCenter.X + Main.mouseX + Main.screenPosition.X - player.position.X + player.Center.X) / 2f, player.MountedCenter.Y - (100f * i)); + + Vector2 mouseDist = new Vector2(Main.mouseX + Main.screenPosition.X - realPlayerPos.X, Math.Abs(Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y)); + if (mouseDist.Y < 20f) + mouseDist.Y = 20f; + mouseDist = mouseDist.SafeNormalize(Vector2.UnitX) * velocity.Length(); + mouseDist.X += Main.rand.NextFloat(-0.4f, 0.4f); + mouseDist.Y += Main.rand.NextFloat(-0.4f, 0.4f); + + Projectile.NewProjectile(source, realPlayerPos, mouseDist, type, damage, knockback, player.whoAmI); } return false; } 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/Keelhaul.cs b/Items/Weapons/Magic/Keelhaul.cs index 5929c99224..770e8029e4 100644 --- a/Items/Weapons/Magic/Keelhaul.cs +++ b/Items/Weapons/Magic/Keelhaul.cs @@ -12,11 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 42; Item.height = 42; Item.damage = 55; - Item.mana = 50; + Item.mana = 40; Item.DamageType = DamageClass.Magic; Item.noMelee = true; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = Item.useAnimation = 30; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 2f; 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/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/Photosynthesis.cs b/Items/Weapons/Magic/Photosynthesis.cs index dc4e32d222..47d1882e66 100644 --- a/Items/Weapons/Magic/Photosynthesis.cs +++ b/Items/Weapons/Magic/Photosynthesis.cs @@ -22,11 +22,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 78; Item.height = 78; - Item.damage = 60; + Item.damage = 74; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.useTime = 24; - Item.useAnimation = 24; + Item.useTime = Item.useAnimation = 21; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4f; 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/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index 0e5ae09073..ba48da9d4b 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 = 4500; Item.DamageType = DamageClass.Magic; Item.mana = 95; Item.useTime = 78; diff --git a/Items/Weapons/Magic/PrimordialEarth.cs b/Items/Weapons/Magic/PrimordialEarth.cs index 55fcdc89a0..f0f2663dd6 100644 --- a/Items/Weapons/Magic/PrimordialEarth.cs +++ b/Items/Weapons/Magic/PrimordialEarth.cs @@ -21,11 +21,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 36; Item.height = 42; - Item.damage = 300; + Item.damage = 205; Item.DamageType = DamageClass.Magic; Item.mana = 48; - Item.useTime = 68; - Item.useAnimation = 68; + Item.useTime = Item.useAnimation = 68; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 10; 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/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index a4eff61271..563b1c809a 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 124; Item.height = 52; - Item.damage = 110; + Item.damage = 97; Item.DamageType = DamageClass.Magic; Item.mana = 15; Item.useAnimation = Item.useTime = 60; 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/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index c3c932f9a3..7ba0f2ac67 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -20,16 +20,17 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 58; Item.height = 56; - Item.damage = 205; + Item.damage = 285; Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.useTime = 12; - Item.useAnimation = 12; + Item.mana = 15; + Item.useTime = 8; + Item.useAnimation = 24; + Item.reuseDelay = 30; + Item.useLimitPerAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.UseSound = SoundID.Item72; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5f; diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index 6c97761796..d0fa9deba3 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { Item.width = Item.height = 58; - Item.damage = 76; + Item.damage = 81; Item.knockBack = 5f; Item.useAnimation = Item.useTime = 30; Item.mana = 20; 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/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/TearsofHeaven.cs b/Items/Weapons/Magic/TearsofHeaven.cs index 6e31eef359..babeb02a00 100644 --- a/Items/Weapons/Magic/TearsofHeaven.cs +++ b/Items/Weapons/Magic/TearsofHeaven.cs @@ -18,11 +18,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 38; Item.height = 48; - Item.damage = 45; + Item.damage = 43; Item.DamageType = DamageClass.Magic; - Item.mana = 18; - Item.useTime = 20; - Item.useAnimation = 20; + Item.mana = 15; + Item.useTime = Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.5f; @@ -38,9 +37,9 @@ namespace CalamityMod.Items.Weapons.Magic { for (int index = 0; index < 2; ++index) { - float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); + float SpeedX = velocity.X + Main.rand.NextFloat(-2f, 2f); + float SpeedY = velocity.Y + Main.rand.NextFloat(-2f, 2f); + Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), type, damage, knockback, player.whoAmI); } return false; } diff --git a/Items/Weapons/Magic/TheCauldron.cs b/Items/Weapons/Magic/TheCauldron.cs index d3b57adcb1..065b00b449 100644 --- a/Items/Weapons/Magic/TheCauldron.cs +++ b/Items/Weapons/Magic/TheCauldron.cs @@ -25,12 +25,11 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 46; Item.height = 46; - Item.damage = 59; + Item.damage = 56; Item.noMelee = true; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useAnimation = 60; - Item.useTime = 60; + Item.useTime = Item.useAnimation = 60; Item.knockBack = 8f; Item.mana = 18; Item.UseSound = SoundID.DD2_MonkStaffSwing; diff --git a/Items/Weapons/Magic/UndinesRetribution.cs b/Items/Weapons/Magic/UndinesRetribution.cs index 1ffeebf364..3b0c0a2a62 100644 --- a/Items/Weapons/Magic/UndinesRetribution.cs +++ b/Items/Weapons/Magic/UndinesRetribution.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 64; Item.height = 64; - Item.damage = 46; + Item.damage = 44; Item.DamageType = DamageClass.Magic; Item.mana = 15; Item.useTime = 18; diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 9c8c4765fe..5174f80dbc 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -10,11 +10,11 @@ namespace CalamityMod.Items.Weapons.Magic public class ValkyrieRay : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - // The base use time of the weapon is 47: 28 charge frames + 19 cooldown frames. + // The base use time of the weapon is 28: 18 charge frames + 10 cooldown frames. // The rate at which it progresses through its charge and discharge cycle is dynamically sped up by reforges. // This math is handled in its holdout projectile, ValkyrieRayStaff. - public const int ChargeFrames = 28; - public const int CooldownFrames = 19; + public const int ChargeFrames = 18; + public const int CooldownFrames = 10; public const float GemDistance = 18f; public static readonly Color LightColor = new Color(235, 40, 121); @@ -27,14 +27,14 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 54; Item.height = 52; - Item.damage = 53; + Item.damage = 115; Item.knockBack = 8.5f; Item.DamageType = DamageClass.Magic; - Item.mana = 26; + Item.mana = 17; Item.useTime = ChargeFrames + CooldownFrames; Item.useAnimation = ChargeFrames + CooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundID.NPCDeath7; + Item.UseSound = SoundID.NPCDeath7 with { Volume = 0.7f }; Item.useTurn = false; Item.noMelee = true; Item.noUseGraphic = true; @@ -45,6 +45,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; } + public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11; + public override void AddRecipes() { CreateRecipe(). 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/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/Magic/WintersFury.cs b/Items/Weapons/Magic/WintersFury.cs index 73d7bf6a5e..6e35c1d79c 100644 --- a/Items/Weapons/Magic/WintersFury.cs +++ b/Items/Weapons/Magic/WintersFury.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 36; Item.height = 40; - Item.damage = 70; + Item.damage = 65; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useTime = 12; @@ -32,16 +32,14 @@ namespace CalamityMod.Items.Weapons.Magic Item.UseSound = SoundID.Item9; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 15f; + Item.shootSpeed = 16f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (!Main.rand.NextBool(4)) { - Vector2 speed = velocity.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-15, 16))); - speed.Normalize(); - speed *= 15f; + Vector2 speed = velocity.RotatedByRandom(MathHelper.Pi / 12f); speed.Y -= Math.Abs(speed.X) * 0.2f; int p = Projectile.NewProjectile(source, position, speed, ModContent.ProjectileType(), damage, knockback, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) @@ -52,8 +50,8 @@ namespace CalamityMod.Items.Weapons.Magic SoundEngine.PlaySound(SoundID.Item1, position); Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 1.2f, velocity.Y * 1.2f, ModContent.ProjectileType(), damage, knockback * 2f, player.whoAmI); } - velocity.X += Main.rand.Next(-40, 41) * 0.05f; - velocity.Y += Main.rand.Next(-40, 41) * 0.05f; + velocity.X += Main.rand.NextFloat(-2f, 2f); + velocity.Y += Main.rand.NextFloat(-2f, 2f); return true; } } diff --git a/Items/Weapons/Melee/AbsoluteZero.cs b/Items/Weapons/Melee/AbsoluteZero.cs index de9f7969e6..1b9615ad9c 100644 --- a/Items/Weapons/Melee/AbsoluteZero.cs +++ b/Items/Weapons/Melee/AbsoluteZero.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { target.AddBuff(BuffID.Frostburn2, 300); - target.AddBuff(ModContent.BuffType(), 60); var source = player.GetSource_ItemUse(Item); int p = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), Item.damage, 12f, player.whoAmI); Main.projectile[p].Kill(); diff --git a/Items/Weapons/Melee/AbyssBlade.cs b/Items/Weapons/Melee/AbyssBlade.cs index 71525139dd..83ea8d665e 100644 --- a/Items/Weapons/Melee/AbyssBlade.cs +++ b/Items/Weapons/Melee/AbyssBlade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 74; Item.height = 74; - Item.damage = 140; + Item.damage = 123; Item.knockBack = 7.5f; Item.useTime = 65; Item.useAnimation = 65; 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/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index deda0bf7d1..93f04e9e1d 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 114; Item.height = 122; - Item.damage = 150; + Item.damage = 120; Item.DamageType = DamageClass.Melee; Item.useAnimation = 19; Item.useTime = 19; 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/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 127c76be64..695c21e84c 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee public static float MaxThrowReach = 760; public static float SnapDamageMultiplier = 1.2f; //Extra damage from making the scissors snap - public static float MaxCharge = 15f; // Maximum charge value AKA how much charge you get from a parry + public static float MaxCharge = 16f; // Maximum charge value AKA how much charge you get from a parry public static float chargeDamageMultiplier = 1.35f; //Extra damage from charge public static float chainDamageMultiplier = 0.1f; public static float SnapBoltsDamageMultiplier = 0.1f; @@ -235,7 +235,7 @@ namespace CalamityMod.Items.Weapons.Melee var barBG = Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; var barFG = Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; - float barScale = 3f; + float barScale = 4f; Vector2 barOrigin = barBG.Size() * 0.5f; float yOffset = 50f; Vector2 drawPos = position + Vector2.UnitY * scale * (frame.Height - yOffset); 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/BladecrestOathsword.cs b/Items/Weapons/Melee/BladecrestOathsword.cs index e88d676e19..ab15acffd1 100644 --- a/Items/Weapons/Melee/BladecrestOathsword.cs +++ b/Items/Weapons/Melee/BladecrestOathsword.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 56; Item.height = 56; - Item.damage = 50; + Item.damage = 42; Item.knockBack = 3f; Item.useTime = 53; Item.useAnimation = 53; diff --git a/Items/Weapons/Melee/BlightedCleaver.cs b/Items/Weapons/Melee/BlightedCleaver.cs index cf51e42102..5b1abeecab 100644 --- a/Items/Weapons/Melee/BlightedCleaver.cs +++ b/Items/Weapons/Melee/BlightedCleaver.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 88; Item.height = 88; - Item.damage = 92; + Item.damage = 90; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 28; Item.useStyle = ItemUseStyleID.Swing; @@ -74,14 +74,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - player.AddBuff(ModContent.BuffType(), 180); target.AddBuff(BuffID.Venom, 240); target.AddBuff(BuffID.OnFire3, 240); } public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { - player.AddBuff(ModContent.BuffType(), 180); target.AddBuff(BuffID.Venom, 240); target.AddBuff(BuffID.OnFire3, 240); } diff --git a/Items/Weapons/Melee/BotanicPiercer.cs b/Items/Weapons/Melee/BotanicPiercer.cs index 25f5f5eb42..1d67b9f7ff 100644 --- a/Items/Weapons/Melee/BotanicPiercer.cs +++ b/Items/Weapons/Melee/BotanicPiercer.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 112; Item.height = 112; - Item.damage = 88; + Item.damage = 110; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; 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/Brimlash.cs b/Items/Weapons/Melee/Brimlash.cs index 2107039480..39a841fea3 100644 --- a/Items/Weapons/Melee/Brimlash.cs +++ b/Items/Weapons/Melee/Brimlash.cs @@ -15,10 +15,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 72; - Item.damage = 70; + Item.damage = 60; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 30; - Item.useTime = 30; + Item.useTime = Item.useAnimation = 30; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; 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/DefiledGreatsword.cs b/Items/Weapons/Melee/DefiledGreatsword.cs index b5f9b9150a..306271d675 100644 --- a/Items/Weapons/Melee/DefiledGreatsword.cs +++ b/Items/Weapons/Melee/DefiledGreatsword.cs @@ -119,14 +119,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - player.AddBuff(ModContent.BuffType(), 300); target.AddBuff(BuffID.Venom, 360); target.AddBuff(BuffID.OnFire3, 360); } public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { - player.AddBuff(ModContent.BuffType(), 300); target.AddBuff(BuffID.Venom, 360); target.AddBuff(BuffID.OnFire3, 360); } 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/Excelsus.cs b/Items/Weapons/Melee/Excelsus.cs index ad3d886059..33959b6463 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,6 +13,10 @@ 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; diff --git a/Items/Weapons/Melee/Floodtide.cs b/Items/Weapons/Melee/Floodtide.cs index 67930b7773..515e863bfd 100644 --- a/Items/Weapons/Melee/Floodtide.cs +++ b/Items/Weapons/Melee/Floodtide.cs @@ -16,10 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 80; Item.height = 92; - Item.damage = 91; + Item.damage = 85; Item.DamageType = DamageClass.Melee; - Item.useTime = 21; - Item.useAnimation = 21; + Item.useTime = Item.useAnimation = 24; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index 93ba5d4a87..1e376464e4 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 144; Item.height = 146; - Item.damage = 828; + Item.damage = 185; Item.DamageType = DamageClass.Melee; Item.useAnimation = 27; Item.useStyle = ItemUseStyleID.Swing; @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item105; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.rare = ModContent.RarityType(); - Item.shoot = ModContent.ProjectileType(); + Item.rare = RarityType(); + Item.shoot = ProjectileType(); Item.shootSpeed = 13f; Item.scale = 0.75f; } @@ -99,7 +99,7 @@ namespace CalamityMod.Items.Weapons.Melee { Vector2 clampedMouse = player.ClampedMouseWorld(); Vector2 spawnSpot = new Vector2(clampedMouse.X, player.Center.Y) + new Vector2(Main.rand.NextFloat(-850, 850), Main.rand.NextFloat(-750, -1250)); - Projectile comet = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), spawnSpot, Utils.DirectionTo(spawnSpot, player.Calamity().mouseWorld + Main.rand.NextVector2Circular(50, 50)) * Item.shootSpeed, Item.shoot, Item.damage / 3, Item.knockBack, player.whoAmI); + Projectile comet = Projectile.NewProjectileDirect(player.GetSource_ItemUse(Item), spawnSpot, Utils.DirectionTo(spawnSpot, player.Calamity().mouseWorld + Main.rand.NextVector2Circular(50, 50)) * Item.shootSpeed, Item.shoot, Item.damage, Item.knockBack, player.whoAmI); comet.extraUpdates = Main.rand.Next(2, 3 + 1); } spawnProj = false; 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 ce68ea8fc9..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; @@ -20,16 +22,19 @@ namespace CalamityMod.Items.Weapons.Melee internal const int TotalRows = 2; - internal const int TotalTeeth = 4; + internal const int TotalTeeth = 3; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 62; Item.height = 62; - Item.damage = 97; + Item.damage = 81; Item.DamageType = DamageClass.Melee; - Item.useTime = 27; - Item.useAnimation = 27; + Item.useTime = Item.useAnimation = 30; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 7f; @@ -46,17 +51,19 @@ namespace CalamityMod.Items.Weapons.Melee } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - for (int i = 0; i < 2; ++i) + for (int i = -2; i <= 2; i++) { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.RotatedBy(-0.1f * (i + 1)).RotatedByRandom(0.06f) * (1 - i * 0.3f), type, (int)(damage * 0.5f), knockback / 3, player.whoAmI, 1f, 0f); + if (i == 0) + { + Projectile strongTooth = Projectile.NewProjectileDirect(source, position, velocity * 1.2f, type, damage, knockback, player.whoAmI, 2f, 0f); + strongTooth.penetrate = -1; + strongTooth.timeLeft = 150; + } + else + { + Projectile.NewProjectile(source, position, velocity.RotatedBy(0.1f * i).RotatedByRandom(0.06f) * (1 - (Math.Abs(i) - 1) * 0.3f), type, (int)(damage * 0.5f), knockback / 3, player.whoAmI, 1f, 0f); + } } - for (int i = 0; i < 2; ++i) - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.RotatedBy(0.1f * (i + 1)).RotatedByRandom(0.06f) * (1 - i * 0.3f), type, (int)(damage * 0.5f), knockback / 3, player.whoAmI, 1f, 0f); - } - Projectile strongTooth = Projectile.NewProjectileDirect(source, position, velocity * 1.2f, type, (int)(damage), knockback, player.whoAmI, 2f, 0f); - strongTooth.penetrate = -1; - strongTooth.timeLeft = 150; return false; } @@ -81,20 +88,16 @@ namespace CalamityMod.Items.Weapons.Melee int teethDamage = player.CalcIntDamage((int)(Item.damage * 0.1f)); float teethKnockback = Item.knockBack * 0.2f; - bool evenNumberOfProjectiles = TotalTeeth % 2 == 0; - float amountToAdd = evenNumberOfProjectiles ? 0.5f : 0f; int centralProjectile = TotalTeeth / 2; - int otherCentralProjectile = centralProjectile - 1; float teethXVelocityReduction = 0.9f; float minVelocityAdjustment = 0.8f; float maxVelocityAdjustment = 1f; - float velocityAdjustment = minVelocityAdjustment; for (int i = 0; i < TotalRows; i++) { bool topTeeth = i == 0; for (int j = 0; j < TotalTeeth; j++) { - velocityAdjustment = ((j == centralProjectile || j == otherCentralProjectile) && evenNumberOfProjectiles) ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs((j + amountToAdd) - centralProjectile) / (float)centralProjectile); + float velocityAdjustment = j == centralProjectile ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs(j + 0.5f - centralProjectile) / (float)centralProjectile); if (topTeeth) { position.X += MathHelper.Lerp(-HalvedTeethSpread * 0.3f, HalvedTeethSpread * 0.3f, j / (float)(TotalTeeth - 1)); @@ -131,22 +134,18 @@ namespace CalamityMod.Items.Weapons.Melee Vector2 secondVelocity = (destination - secondPosition).SafeNormalize(Vector2.UnitY) * ShootSpeed; Vector2 secondCachedVelocity = secondVelocity; - int teethDamage = player.CalcIntDamage((int)(Item.damage * 0.5)); + int teethDamage = player.CalcIntDamage((int)(Item.damage * 0.1f)); float teethKnockback = Item.knockBack * 0.2f; - bool evenNumberOfProjectiles = TotalTeeth % 2 == 0; - float amountToAdd = evenNumberOfProjectiles ? 0.5f : 0f; int centralProjectile = TotalTeeth / 2; - int otherCentralProjectile = centralProjectile - 1; float teethXVelocityReduction = 0.9f; float minVelocityAdjustment = 0.8f; float maxVelocityAdjustment = 1f; - float velocityAdjustment = minVelocityAdjustment; for (int i = 0; i < TotalRows; i++) { bool topTeeth = i == 0; for (int j = 0; j < TotalTeeth; j++) { - velocityAdjustment = ((j == centralProjectile || j == otherCentralProjectile) && evenNumberOfProjectiles) ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs((j + amountToAdd) - centralProjectile) / (float)centralProjectile); + float velocityAdjustment = j == centralProjectile ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs(j + 0.5f - centralProjectile) / (float)centralProjectile); if (topTeeth) { position.X += MathHelper.Lerp(-HalvedTeethSpread, HalvedTeethSpread, j / (float)(TotalTeeth - 1)); @@ -173,7 +172,7 @@ namespace CalamityMod.Items.Weapons.Melee { Vector2 dustVel = Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(0.9f, 1.5f); if (Main.rand.NextBool(3)) - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 102, dustVel.X, dustVel.Y); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Water_Desert, dustVel.X, dustVel.Y); } } } diff --git a/Items/Weapons/Melee/HellionFlowerSpear.cs b/Items/Weapons/Melee/HellionFlowerSpear.cs index d89110439a..94a013896c 100644 --- a/Items/Weapons/Melee/HellionFlowerSpear.cs +++ b/Items/Weapons/Melee/HellionFlowerSpear.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 64; Item.height = 64; - Item.damage = 135; + Item.damage = 85; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index e3954b3dff..5cb216baa4 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 795; + Item.damage = 760; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 71; Item.useTurn = true; 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/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index a23c35ba04..187f17e51e 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 30; Item.height = 26; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 152; + Item.damage = 115; Item.knockBack = 7f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/LifehuntScythe.cs b/Items/Weapons/Melee/LifehuntScythe.cs index 488dc49969..eea043bf64 100644 --- a/Items/Weapons/Melee/LifehuntScythe.cs +++ b/Items/Weapons/Melee/LifehuntScythe.cs @@ -38,25 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.CursedTorch); } - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - if (player.moonLeech || player.lifeSteal <= 0f || target.lifeMax <= 5) - return; - - int heal = 5; - player.lifeSteal -= heal; - player.HealPlayer(heal); - } - - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - if (player.moonLeech || player.lifeSteal <= 0f) - return; - - int heal = 5; - player.lifeSteal -= heal; - player.HealPlayer(heal); - } + public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) => player.DoLifestealDirect(target, 5, 0.5f); public override void AddRecipes() { diff --git a/Items/Weapons/Melee/MantisClaws.cs b/Items/Weapons/Melee/MantisClaws.cs index e088461822..828860755b 100644 --- a/Items/Weapons/Melee/MantisClaws.cs +++ b/Items/Weapons/Melee/MantisClaws.cs @@ -1,17 +1,8 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; +using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; -using CalamityMod.Items.BaseItems; using Terraria.ModLoader; -using CalamityMod.Projectiles.BaseProjectiles; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using CalamityMod.Balancing; -using Terraria.Audio; -using CalamityMod.Projectiles.Melee; -using System; -using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Melee { @@ -20,10 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - base.SetDefaults(); Item.width = 26; Item.height = 20; - Item.damage = 111; + Item.damage = 75; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 25; Item.knockBack = 0.25f; 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/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 b6c96a6a50..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,11 +12,15 @@ 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; Item.height = 16; - Item.damage = 60; + Item.damage = 85; Item.rare = ItemRarityID.Lime; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Oblivion.cs b/Items/Weapons/Melee/Oblivion.cs index 33ee8074d6..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() @@ -27,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 28; Item.height = 38; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 55; + Item.damage = 50; Item.knockBack = 4f; Item.useTime = 22; Item.useAnimation = 22; diff --git a/Items/Weapons/Melee/OldLordClaymore.cs b/Items/Weapons/Melee/OldLordClaymore.cs index 58a906a399..82d8b08a91 100644 --- a/Items/Weapons/Melee/OldLordClaymore.cs +++ b/Items/Weapons/Melee/OldLordClaymore.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 76; Item.height = 76; - Item.damage = 195; + Item.damage = 144; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 90; // Yes it's actually supposed to be this slow 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/Pwnagehammer.cs b/Items/Weapons/Melee/Pwnagehammer.cs index 4c0510417d..0b0e47fa19 100644 --- a/Items/Weapons/Melee/Pwnagehammer.cs +++ b/Items/Weapons/Melee/Pwnagehammer.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 66; Item.height = 66; - Item.damage = 210; + Item.damage = 150; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/Quagmire.cs b/Items/Weapons/Melee/Quagmire.cs index 93827b8f25..0d405a1c87 100644 --- a/Items/Weapons/Melee/Quagmire.cs +++ b/Items/Weapons/Melee/Quagmire.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 30; Item.height = 36; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 52; + Item.damage = 54; Item.knockBack = 3.5f; Item.useTime = 22; Item.useAnimation = 22; 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/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/SmokingComet.cs b/Items/Weapons/Melee/SmokingComet.cs index 8fe6c66857..2373e4d3c0 100644 --- a/Items/Weapons/Melee/SmokingComet.cs +++ b/Items/Weapons/Melee/SmokingComet.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 36; Item.height = 40; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 21; + Item.damage = 17; Item.knockBack = 1.5f; Item.useTime = 25; Item.useAnimation = 25; 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/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/TaintedBlade.cs b/Items/Weapons/Melee/TaintedBlade.cs index 82b65ddff0..99777f59cd 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; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 46; Item.height = 46; - Item.damage = 60; + Item.damage = 48; Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useAnimation = 27; 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/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 07c02ed83e..ab59e6f12f 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() 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/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index bce0c1ee8b..965503a687 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee public float Charge = 0f; public static float chargeDamageMultiplier = 1.25f; //Extra damage from charge public static float beamDamageMultiplier = 1f; //Damage multiplier for the charged shots (remember it applies ontop of the charge damage multiplied - public static float glassStarDamageMultiplier = 0.6f; //Damage multiplier for the glass stars it shoots (Shoots 3x glass stars when not charged, shoots 2x glass stars + one beam when charged) + public static float glassStarDamageMultiplier = 1f; //Damage multiplier for the glass stars it shoots (Shoots 3x glass stars when not charged, shoots 2x glass stars + one beam when charged) public override void ModifyTooltips(List tooltips) { @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 72; - Item.damage = 194; + Item.damage = 130; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noUseGraphic = true; Item.noMelee = true; @@ -103,7 +103,6 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(source, player.Center - Shift, velocity.RotatedBy(-MathHelper.PiOver4 * 0.3f), ProjectileType(), (int)(damage * glassStarDamageMultiplier), knockback, player.whoAmI, Charge > 0 ? 1 : 0); } - Charge--; if (Charge < 0) Charge = 0; 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/TyphonsGreed.cs b/Items/Weapons/Melee/TyphonsGreed.cs index e2d8e61327..40517717a8 100644 --- a/Items/Weapons/Melee/TyphonsGreed.cs +++ b/Items/Weapons/Melee/TyphonsGreed.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 16; Item.height = 16; - Item.damage = 62; + Item.damage = 60; Item.DamageType = DamageClass.Melee; Item.useTime = 30; Item.useAnimation = 30; 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/Ranged/AcidwoodBow.cs b/Items/Weapons/Ranged/AcidwoodBow.cs index d86e3ef7ad..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; diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index dbf730675c..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,20 +25,20 @@ 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; Item.height = 18; - Item.damage = 46; + Item.damage = 39; Item.DamageType = DamageClass.Ranged; - Item.width = 70; - Item.height = 18; Item.scale = 0.85f; - Item.useTime = 30; + Item.useTime = Item.useAnimation = 33; Item.reuseDelay = 10; - Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; @@ -52,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void UpdateInventory(Player player) { - //ITS MY REWORK SO I CAN PUT A REFERENCE: Shotgun full of hate, returns Animosity otherwise + //ITS MY REWORK SO I CAN PUT A REFERENCE: Shotgun Full of Hate, returns Animosity otherwise if (Main.zenithWorld) Item.SetNameOverride(this.GetLocalizedValue("GFBName")); } @@ -172,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/Arietes41.cs b/Items/Weapons/Ranged/Arietes41.cs index 291294a981..e711d0b85b 100644 --- a/Items/Weapons/Ranged/Arietes41.cs +++ b/Items/Weapons/Ranged/Arietes41.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.width = 56; Item.height = 30; Item.scale = 0.85f; - Item.damage = 95; + Item.damage = 77; Item.DamageType = DamageClass.Ranged; Item.useTime = 13; Item.useAnimation = 13; @@ -38,7 +38,6 @@ 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) { float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir; - Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f; // Shock bullet @@ -50,8 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged GeneralParticleHandler.SpawnParticle(spark); } Projectile shockShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) + velocity * 1.65f, velocity, type, damage, knockback, player.whoAmI); - CalamityGlobalProjectile cgp = shockShot.Calamity(); - cgp.shockBullet = true; + shockShot.Calamity().shockBullet = true; } // Life bullet if (swapType) @@ -62,8 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged GeneralParticleHandler.SpawnParticle(spark); } Projectile lifeShot = Projectile.NewProjectileDirect(source, itemPosition + velocity.RotatedBy(-0.6 * player.direction) - velocity * 0.65f, velocity, type, damage, knockback, player.whoAmI); - CalamityGlobalProjectile cgp = lifeShot.Calamity(); - cgp.lifeBullet = true; + lifeShot.Calamity().lifeBullet = true; } swapType = !swapType; diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index b1446e597a..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,7 +33,7 @@ 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; diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index 825b90649f..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,11 +13,15 @@ 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; Item.height = 36; - Item.damage = 80; + Item.damage = 69; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 30; diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index 0deac5423a..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; diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index 12bbb10aac..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; diff --git a/Items/Weapons/Ranged/BladedgeRailbow.cs b/Items/Weapons/Ranged/BladedgeRailbow.cs index 1ab30dc6b6..65eb24364c 100644 --- a/Items/Weapons/Ranged/BladedgeRailbow.cs +++ b/Items/Weapons/Ranged/BladedgeRailbow.cs @@ -99,8 +99,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 24; Item.damage = 30; Item.DamageType = DamageClass.Ranged; - Item.useTime = 29; - Item.useAnimation = 29; + Item.useTime = Item.useAnimation = 28; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; @@ -113,22 +112,18 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Arrow; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + 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) { for (int i = 0; i < 4; i++) { - float SpeedX = velocity.X + (float)Main.rand.Next(-60, 61) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-60, 61) * 0.05f; + float SpeedX = velocity.X + Main.rand.NextFloat(-3f, 3f); + float SpeedY = velocity.Y + Main.rand.NextFloat(-3f, 3f); int index = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); Main.projectile[index].noDropItem = true; } Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float PiOver10 = MathHelper.Pi * 0.1f; Vector2 arrowVel = velocity; arrowVel.Normalize(); arrowVel *= 10f; @@ -137,12 +132,10 @@ namespace CalamityMod.Items.Weapons.Ranged int numArrows = Main.zenithWorld ? 4 : 2; for (int i = 0; i < numArrows; i++) { - float arrowOffset = (float)i - 1f / 2f; - Vector2 offsetSpawn = arrowVel.RotatedBy((double)(PiOver10 * arrowOffset), default); + float arrowOffset = i - 0.5f; + Vector2 offsetSpawn = arrowVel.RotatedBy(MathHelper.Pi * 0.1f * arrowOffset); if (!arrowHitsTiles) - { offsetSpawn -= arrowVel; - } int projType; if (Main.zenithWorld) @@ -150,12 +143,15 @@ namespace CalamityMod.Items.Weapons.Ranged else projType = ProjectileID.Leaf; - int projectile = Projectile.NewProjectile(source, realPlayerPos.X + offsetSpawn.X, realPlayerPos.Y + offsetSpawn.Y, velocity.X, velocity.Y, projType, damage, 0f, player.whoAmI); + int projectile = Projectile.NewProjectile(source, realPlayerPos.X + offsetSpawn.X, realPlayerPos.Y + offsetSpawn.Y, velocity.X, velocity.Y, projType, (int)(damage * 0.7f), 0f, player.whoAmI); // Now for the special conditions to fix stuff... - if (projectile.WithinBounds(Main.maxProjectiles) && (projType == ProjectileID.Leaf || projType == ModContent.ProjectileType())) - Main.projectile[projectile].DamageType = DamageClass.Ranged; - if (projType == ModContent.ProjectileType() || projType == ModContent.ProjectileType() || projType == ModContent.ProjectileType()) - Main.projectile[projectile].velocity /= 2; + if (projectile.WithinBounds(Main.maxProjectiles)) + { + if (projType == ProjectileID.Leaf || projType == ModContent.ProjectileType()) + Main.projectile[projectile].DamageType = DamageClass.Ranged; + if (projType == ModContent.ProjectileType() || projType == ModContent.ProjectileType() || projType == ModContent.ProjectileType()) + Main.projectile[projectile].velocity /= 2; + } } return false; } 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/BloodBoiler.cs b/Items/Weapons/Ranged/BloodBoiler.cs index 3067ec1c17..35eabb4e58 100644 --- a/Items/Weapons/Ranged/BloodBoiler.cs +++ b/Items/Weapons/Ranged/BloodBoiler.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 60; Item.height = 30; - Item.damage = 135; + Item.damage = 120; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 25; diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 1140080c10..fb099727e2 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 38; Item.height = 68; - Item.damage = 20; + Item.damage = 18; Item.DamageType = DamageClass.Ranged; Item.useTime = 4; Item.useAnimation = 16; 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/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index 966b53295a..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() diff --git a/Items/Weapons/Ranged/ConferenceCall.cs b/Items/Weapons/Ranged/ConferenceCall.cs index a673f01eb8..550f6e4e1c 100644 --- a/Items/Weapons/Ranged/ConferenceCall.cs +++ b/Items/Weapons/Ranged/ConferenceCall.cs @@ -44,7 +44,6 @@ 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) { - int bulletAmt = 4; for (int index = 0; index < bulletAmt; ++index) { @@ -87,10 +86,12 @@ namespace CalamityMod.Items.Weapons.Ranged targetPosition.X = (targetPosition.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); targetPosition.Y -= 100 * j; - Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed; + // Create a dummy projectile to grab the number of max updates the bullet has for predictive aim use + Projectile dummy = new Projectile(); + dummy.SetDefaults(type); + Vector2 extraBulletVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(targetPosition, Main.npc[targets[j]], Item.shootSpeed, dummy.MaxUpdates); int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } @@ -107,10 +108,12 @@ namespace CalamityMod.Items.Weapons.Ranged targetPosition.X = (targetPosition.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); targetPosition.Y -= 100 * randomTarget; - Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed; + // Create a dummy projectile to grab the number of max updates the bullet has for predictive aim use + Projectile dummy = new Projectile(); + dummy.SetDefaults(type); + Vector2 extraBulletVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(targetPosition, Main.npc[targets[randomTarget]], Item.shootSpeed, dummy.MaxUpdates); int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index 4ef77cdd2b..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; diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 611538d0c1..8fbb54e485 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,6 +14,10 @@ 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; 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 3a42b6e47d..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; diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index df98c2ca7e..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; @@ -45,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 c9027d1b99..5dd7c75d29 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -9,10 +10,13 @@ namespace CalamityMod.Items.Weapons.Ranged public class FirestormCannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } + + // This is intentionally stored on the item instead of the holdout to prevent swapping items to instantly reset the heat + // This could be theoretically exploited using multiple items, but the heat dissipates fast enough that I can't really care + public int BuiltUpHeat = 0; + public const int OverheatLevel = 480; + public const int OverheatCooldown = 180; + public const int OverheatDamage = 20; public override void SetDefaults() { @@ -20,70 +24,41 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 14; Item.DamageType = DamageClass.Ranged; - Item.useTime = 12; - Item.useAnimation = 12; + Item.useTime = Item.useAnimation = 11; + Item.knockBack = 1.5f; + Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 1.5f; + Item.channel = true; + Item.noUseGraphic = true; + Item.autoReuse = true; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; - Item.UseSound = SoundID.Item11; - Item.autoReuse = true; - Item.shoot = ProjectileID.Flare; + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5.5f; Item.useAmmo = AmmoID.Flare; } - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= 70; - - public override bool AltFunctionUse(Player player) => true; - - public override float UseSpeedMultiplier(Player player) + public override void HoldItem(Player player) { - if (player.altFunctionUse == 2) - return 1 / 3f; - return 1f; + player.Calamity().rightClickListener = true; + // Heat decrements if: + // The holdout exists, the player is not firing, the player is not in overheat, and there is heat in the weapon + if (player.ownedProjectileCounts[Item.shoot] > 0 && !Main.mouseLeft && player.Calamity().flareGunOverheat == 0 && BuiltUpHeat > 0) + { + BuiltUpHeat -= player.miscCounter % 2 == 0 ? 3 : 2; + if (BuiltUpHeat < 0) + BuiltUpHeat = 0; + } } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && !player.Calamity().mouseRight; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; // Spawning the holdout cannot consume ammo public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse == 2) - { - velocity *= 2f; - int flareAmt = Main.rand.Next(4, 6); - for (int index = 0; index < flareAmt; ++index) - { - float SpeedX = velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; - int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - if (flare.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flare].penetrate = 1; - Main.projectile[flare].timeLeft = 600; - Main.projectile[flare].DamageType = DamageClass.Ranged; - } - } - return false; - } - else - { - int flareAmt = Main.rand.Next(1, 3); - for (int index = 0; index < flareAmt; ++index) - { - float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; - int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - if (flare.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flare].DamageType = DamageClass.Ranged; - Main.projectile[flare].timeLeft = 200; - Main.projectile[flare].penetrate = 3; - } - } - return false; - } + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + return false; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 868f04b376..76ccecc30f 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 152; Item.height = 58; - Item.damage = 124; + Item.damage = 78; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = OriginalUseTime; Item.knockBack = 0.25f; diff --git a/Items/Weapons/Ranged/Fungicide.cs b/Items/Weapons/Ranged/Fungicide.cs index 039d2f2f04..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,11 +11,15 @@ 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; Item.height = 26; - Item.damage = 20; + Item.damage = 19; Item.DamageType = DamageClass.Ranged; Item.useTime = 22; Item.useAnimation = 22; diff --git a/Items/Weapons/Ranged/GoldenEagle.cs b/Items/Weapons/Ranged/GoldenEagle.cs index 9514ff0135..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; diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index d018bd9bc0..dd909d62fe 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -61,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 a17755c5bf..b63a4cacdc 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Ranged/HavocsBreath.cs b/Items/Weapons/Ranged/HavocsBreath.cs index fa23d2cd9b..9ca4a9a5a4 100644 --- a/Items/Weapons/Ranged/HavocsBreath.cs +++ b/Items/Weapons/Ranged/HavocsBreath.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 68; Item.height = 26; - Item.damage = 74; + Item.damage = 62; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 35; 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/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 267d6e3d15..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; diff --git a/Items/Weapons/Ranged/Hydra.cs b/Items/Weapons/Ranged/Hydra.cs index 93afbe3e1e..67c5b3927c 100644 --- a/Items/Weapons/Ranged/Hydra.cs +++ b/Items/Weapons/Ranged/Hydra.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; //Editable stats: - public const int BulletsPerShot = 4; + public const int BulletsPerShot = 3; public const float ShotSpread = 10f; //in degrees public const int TimeToSpawnHead = 3; //in seconds public const int MaximumHeadCount = 3; @@ -96,7 +96,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 shootDirection = velocity.SafeNormalize(Vector2.Zero); - for (int i = 0; i < 4; i++) + for (int i = 0; i < BulletsPerShot; i++) { int CurrentHeadCount = player.ownedProjectileCounts[HeadID]; //Exponentially louder the more heads, slightly diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index b9c18b562a..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,13 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { Item.width = 82; Item.height = 28; - Item.damage = 121; + Item.damage = 89; Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = 18; //Try not to change this if you can help it. Item.noMelee = true; @@ -57,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Reposition to the gun's tip. Calculated seperately due to the two different shot styles. + // Reposition to the gun's tip. Calculated separately due to the two different shot styles. Vector2 boulderPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); Vector2 shotPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -6f : 3f)).RotatedBy(velocity.ToRotation()); diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index 140c763e2c..0ec26d25e0 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/MagnaCannonShot") { PitchVariance = 0.3f, Volume = 0.4f }; public static int AftershotCooldownFrames = 30; - public static int FullChargeFrames = 138; //126 frames is durration of charge sound + public static int FullChargeFrames = 138; //126 frames is duration of charge sound public new string LocalizationCategory => "Items.Weapons.Ranged"; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 56; Item.height = 34; - Item.damage = 30; + Item.damage = 25; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Ranged/Malevolence.cs b/Items/Weapons/Ranged/Malevolence.cs index 54fc07fb85..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; @@ -48,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 21efda86f1..04583dd290 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -13,10 +13,12 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 36; Item.height = 110; - Item.damage = 35; + Item.damage = 39; Item.DamageType = DamageClass.Ranged; - Item.useTime = 18; - Item.useAnimation = 18; + Item.useTime = 5; + Item.useAnimation = 15; + Item.useLimitPerAnimation = 3; + Item.reuseDelay = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6f; @@ -32,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged } // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; + public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; public override Vector2? HoldoutOffset() => new Vector2(-4, 0); @@ -42,20 +44,16 @@ namespace CalamityMod.Items.Weapons.Ranged if (CalamityUtils.CheckWoodenAmmo(type, player)) type = ProjectileID.JestersArrow; - for (int i = 0; i < 3; i++) + float SpeedX = velocity.X + Main.rand.NextFloat(-0.5f, 0.5f); + float SpeedY = velocity.Y + Main.rand.NextFloat(-0.5f, 0.5f); + int arrow = Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), type, damage, knockback, player.whoAmI); + Main.projectile[arrow].noDropItem = true; + if (type == ProjectileID.JestersArrow) { - int randomExtraUpdates = Main.rand.Next(3); - float SpeedX = velocity.X + Main.rand.NextFloat(-10f, 10f) * 0.05f; - float SpeedY = velocity.Y + Main.rand.NextFloat(-10f, 10f) * 0.05f; - int arrow = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - Main.projectile[arrow].noDropItem = true; - Main.projectile[arrow].extraUpdates += randomExtraUpdates; //0 to 2 extra updates - if (type == ProjectileID.JestersArrow) - { - Main.projectile[arrow].localNPCHitCooldown = 10 * (randomExtraUpdates + 1); - Main.projectile[arrow].usesLocalNPCImmunity = true; - Main.projectile[arrow].tileCollide = false; - } + Main.projectile[arrow].localNPCHitCooldown = 12 * Main.projectile[arrow].MaxUpdates; + Main.projectile[arrow].usesLocalNPCImmunity = true; + Main.projectile[arrow].usesIDStaticNPCImmunity = false; + Main.projectile[arrow].tileCollide = false; } return false; } diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index 71981209e6..deaea9191e 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 72; Item.height = 32; - Item.damage = 41; + Item.damage = 29; Item.DamageType = DamageClass.Ranged; Item.useTime = 6; Item.useAnimation = 6; @@ -41,11 +41,11 @@ namespace CalamityMod.Items.Weapons.Ranged { // Reposition to the gun's tip + add some inaccuracy Vector2 newPos = position + new Vector2(64f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); - Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f)); + Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(3f)); // Fire either the bullet or the water jet, depending on cadence. int projectileToFire = fireWater ? Item.shoot : type; - Projectile.NewProjectile(source, newPos, newVel, projectileToFire, (int)(damage * 0.8f), knockback, player.whoAmI); + Projectile.NewProjectile(source, newPos, newVel, projectileToFire, damage, knockback, player.whoAmI); // Always fires a close range water blast. // It goes in the same direction as the main shot but has a minor velocity variation to be less monotonous. diff --git a/Items/Weapons/Ranged/MonolithBow.cs b/Items/Weapons/Ranged/MonolithBow.cs index 7d5df1afc0..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; diff --git a/Items/Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index 67f0594e59..e4515a024e 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -79,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); } @@ -115,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/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 37c0c0b14f..74b412be00 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 48; Item.height = 24; - Item.damage = 33; + Item.damage = 30; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; 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/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index bc9757aeb1..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; 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/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index f3aacb3dad..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; diff --git a/Items/Weapons/Ranged/Sandblaster.cs b/Items/Weapons/Ranged/Sandblaster.cs index bea5cba353..34396470c2 100644 --- a/Items/Weapons/Ranged/Sandblaster.cs +++ b/Items/Weapons/Ranged/Sandblaster.cs @@ -16,10 +16,9 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 62; Item.height = 26; - Item.damage = 80; + Item.damage = 70; Item.DamageType = DamageClass.Ranged; - Item.useTime = 15; - Item.useAnimation = 15; + Item.useTime = Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; @@ -32,10 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Sand; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool CanConsumeAmmo(Item ammo, Player player) { 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/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index 4dd3d35b39..b52a0d3939 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,55 +11,53 @@ namespace CalamityMod.Items.Weapons.Ranged public class SpectralstormCannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + // This is intentionally stored on the item instead of the holdout to prevent swapping items to instantly reset the heat + // This could be theoretically exploited using multiple items, but the heat dissipates fast enough that I can't really care + public int BuiltUpHeat = 0; + public const int OverheatLevel = 540; + public const int OverheatCooldown = 160; + public const int OverheatDamage = 50; + public override void SetDefaults() { Item.width = 66; Item.height = 26; - Item.damage = 48; + Item.damage = 82; Item.DamageType = DamageClass.Ranged; - Item.useTime = 4; - Item.useAnimation = 12; + Item.useTime = Item.useAnimation = 11; + Item.knockBack = 1.5f; + Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 1.5f; + Item.channel = true; + Item.noUseGraphic = true; + Item.autoReuse = true; + Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.UseSound = SoundID.Item11; - Item.autoReuse = true; - Item.shoot = ProjectileID.Flare; - Item.shootSpeed = 9.5f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 10f; Item.useAmmo = AmmoID.Flare; } - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - - public override bool CanConsumeAmmo(Item ammo, Player player) + public override void HoldItem(Player player) { - if (Main.rand.Next(0, 100) < 70) - return false; - return true; + player.Calamity().rightClickListener = true; + // Heat decrements if: + // The holdout exists, the player is not firing, the player is not in overheat, and there is heat in the weapon + if (player.ownedProjectileCounts[Item.shoot] > 0 && !Main.mouseLeft && player.Calamity().flareGunOverheat == 0 && BuiltUpHeat > 0) + { + BuiltUpHeat -= 3; + if (BuiltUpHeat < 0) + BuiltUpHeat = 0; + } } - + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && !player.Calamity().mouseRight; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; // Spawning the holdout cannot consume ammo public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; - int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - if (flare.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flare].timeLeft = 200; - Main.projectile[flare].DamageType = DamageClass.Ranged; - } - - float SpeedX2 = velocity.X + (float)Main.rand.Next(-20, 21) * 0.05f; - float SpeedY2 = velocity.Y + (float)Main.rand.Next(-20, 21) * 0.05f; - int soul = Projectile.NewProjectile(source, position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 2f, 0f); - if (soul.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[soul].timeLeft = 600; - Main.projectile[soul].DamageType = DamageClass.Ranged; - Main.projectile[soul].frame = Main.rand.Next(4); - } + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } 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/StellarCannon.cs b/Items/Weapons/Ranged/StellarCannon.cs index 376629dbca..7445e3628f 100644 --- a/Items/Weapons/Ranged/StellarCannon.cs +++ b/Items/Weapons/Ranged/StellarCannon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 50; Item.height = 30; - Item.damage = 182; + Item.damage = 180; Item.DamageType = DamageClass.Ranged; Item.useTime = 40; Item.useAnimation = 40; diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index 30db33d8cc..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() { diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 5c0b941748..17cf943732 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -14,10 +14,9 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 40; Item.height = 70; - Item.damage = 108; + Item.damage = 88; Item.DamageType = DamageClass.Ranged; - Item.useTime = 22; - Item.useAnimation = 22; + Item.useTime = Item.useAnimation = 28; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 8f; 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/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/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 4144561023..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; diff --git a/Items/Weapons/Ranged/VernalBolter.cs b/Items/Weapons/Ranged/VernalBolter.cs index 5bdf8049c8..f105614251 100644 --- a/Items/Weapons/Ranged/VernalBolter.cs +++ b/Items/Weapons/Ranged/VernalBolter.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 68; Item.height = 94; - Item.damage = 48; + Item.damage = 35; Item.DamageType = DamageClass.Ranged; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Ranged/WildfireBloom.cs b/Items/Weapons/Ranged/WildfireBloom.cs index ce9ab240c8..0934adb580 100644 --- a/Items/Weapons/Ranged/WildfireBloom.cs +++ b/Items/Weapons/Ranged/WildfireBloom.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 114; Item.height = 58; - Item.damage = 78; + Item.damage = 62; Item.DamageType = DamageClass.Ranged; Item.useTime = WildfireUseTime; Item.useAnimation = WildfireUseTime; diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index aa889bdab6..ea514d1562 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 66; Item.height = 64; - Item.damage = 238; + Item.damage = 185; Item.shootSpeed = 18f; Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 26; 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/BallisticPoisonBomb.cs b/Items/Weapons/Rogue/BallisticPoisonBomb.cs index a5adb023be..f35c9df13b 100644 --- a/Items/Weapons/Rogue/BallisticPoisonBomb.cs +++ b/Items/Weapons/Rogue/BallisticPoisonBomb.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 30; Item.height = 38; - Item.damage = 72; + Item.damage = 57; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 26; 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/CrushsawCrasher.cs b/Items/Weapons/Rogue/CrushsawCrasher.cs index 611d050155..a82b2e5f37 100644 --- a/Items/Weapons/Rogue/CrushsawCrasher.cs +++ b/Items/Weapons/Rogue/CrushsawCrasher.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 38; Item.height = 22; - Item.damage = 81; + Item.damage = 57; Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 18; @@ -31,20 +31,19 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.7f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { int spread = 3; - for (int i = 0; i < 5; i++) + for (int i = 0; i < 6; i++) { Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3, 4), velocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].Calamity().stealthStrike = true; + Main.projectile[proj].penetrate = 1; } spread -= Main.rand.Next(1, 4); } diff --git a/Items/Weapons/Rogue/Crystalline.cs b/Items/Weapons/Rogue/Crystalline.cs index 74260456a7..83add7844f 100644 --- a/Items/Weapons/Rogue/Crystalline.cs +++ b/Items/Weapons/Rogue/Crystalline.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override float StealthDamageMultiplier => 3f; + public override float StealthDamageMultiplier => 1.7f; 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/DeepWounder.cs b/Items/Weapons/Rogue/DeepWounder.cs index 4bb20aae43..7cbfc94525 100644 --- a/Items/Weapons/Rogue/DeepWounder.cs +++ b/Items/Weapons/Rogue/DeepWounder.cs @@ -13,12 +13,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 58; Item.height = 52; - Item.damage = 136; + Item.damage = 132; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 23; + Item.useTime = Item.useAnimation = 25; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 23; Item.knockBack = 3f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -36,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs index d9a4719ab1..2fc9f55986 100644 --- a/Items/Weapons/Rogue/DefectiveSphere.cs +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 42; Item.height = 44; - Item.damage = 116; + Item.damage = 85; Item.knockBack = 5f; Item.useAnimation = 13; Item.useTime = 13; @@ -37,22 +37,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool CanUseItem(Player player) { - if (player.Calamity().StealthStrikeAvailable()) - { - return true; - } - else if ((player.ownedProjectileCounts[Item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()]) >= 5) - { - return false; - } - else - { - return true; - } + return player.Calamity().StealthStrikeAvailable() || (player.ownedProjectileCounts[Item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()]) <= 4; } - public override float StealthDamageMultiplier => 0.9f; - public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { type = Utils.SelectRandom(Main.rand, new int[] @@ -72,13 +59,13 @@ namespace CalamityMod.Items.Weapons.Rogue { // This is done to allow looping when creating projectiles, instead of having to create many projectile/velocity variables all at once, // which this shoot code used to do. - int[] projectilesToShoot = new int[] - { + int[] projectilesToShoot = + [ ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType() - }; + ]; foreach (int projectileType in projectilesToShoot) { diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index cb31651c19..c2fcaf1af4 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 20; Item.height = 24; - Item.damage = 74; + Item.damage = 65; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 28; @@ -30,18 +30,16 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public static float StealthDmgMult = 0.6f; //So I can edit it directly via DragonLens instead of having to do math with CalTestHelpers - public override float StealthDamageMultiplier => StealthDmgMult; + public override float StealthDamageMultiplier => 0.6f; public static int CloudLifetime = 200; public static float DustRadius = 11f; - public static int StealthIframes = 9; //Cloud hitbox size manipulation public static float MaxSize = 3.2f; public static float MaxSizeStealth = 3.6f; public static float GrowthRate = 0.025f; - public static float StealthGrowhRate = 0.035f; + public static float StealthGrowthRate = 0.035f; 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/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index e9d74d021e..ef9768f94a 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,7 +13,10 @@ 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; diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index 4742e420dc..115a31a492 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -13,12 +13,12 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 109; Item.height = 128; - Item.damage = 285; + Item.damage = 192; Item.noMelee = true; Item.noUseGraphic = true; - // Due to the amazing sound engine, having more than one of these on screen will cause audio bugs! - // Therefore this thing has to be absurdly slow (Not that I've ever complained about that before) - Item.useAnimation = Item.useTime = 115; + // Due to the amazing sound engine, having multiple crosses embedded in enemies cuts off the sound + // Therefore this thing has to be very slow (Not that I've ever complained about that before) + Item.useAnimation = Item.useTime = 96; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 12f; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index aad9aeb1d9..8b7f5a9494 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -14,11 +14,10 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 30; Item.height = 30; - Item.damage = 52; + Item.damage = 45; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 25; - Item.useTime = 25; + Item.useTime = Item.useAnimation = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; Item.UseSound = SoundID.Item1; @@ -29,28 +28,18 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = 18f; Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.7f; + 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) { - if (!player.Calamity().StealthStrikeAvailable()) + for (int i = -1; i <= 1; i++) { - for (int i = -1; i <= 1; i++) - { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * 6f)); - Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI); - } + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * (player.Calamity().StealthStrikeAvailable() ? 5f : 6f))); + int shootCard = player.Calamity().StealthStrikeAvailable() ? ModContent.ProjectileType() : type; + int card = Projectile.NewProjectile(source, position, perturbedSpeed, shootCard, damage, knockback, player.whoAmI); + if (card.WithinBounds(Main.maxProjectiles) && player.Calamity().StealthStrikeAvailable()) + Main.projectile[card].Calamity().stealthStrike = true; } - else if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - for (int i = -1; i <= 1; i++) - { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * 5f)); - int stealth = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - } - } - return true; + return false; } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 43953e042c..b8342c3b62 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 46; - Item.damage = 89; + Item.damage = 81; Item.DamageType = RogueDamageClass.Instance; - Item.useTime = Item.useAnimation = 17; + Item.useTime = Item.useAnimation = 19; Item.knockBack = 12; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; @@ -37,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue // 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.9f; - public override float StealthKnockbackMultiplier => 0.3333f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) @@ -48,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].Calamity().stealthStrike = true; - Main.projectile[proj].penetrate = 5; + Main.projectile[proj].penetrate = 4; } return false; } diff --git a/Items/Weapons/Rogue/FrostyFlare.cs b/Items/Weapons/Rogue/FrostyFlare.cs index 1226639a46..acf40a72cb 100644 --- a/Items/Weapons/Rogue/FrostyFlare.cs +++ b/Items/Weapons/Rogue/FrostyFlare.cs @@ -9,16 +9,11 @@ namespace CalamityMod.Items.Weapons.Rogue { public class FrostyFlare : RogueWeapon { - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 99; - } - public override void SetDefaults() { Item.width = 10; Item.height = 22; - Item.damage = 32; + Item.damage = 37; Item.noUseGraphic = true; Item.noMelee = true; Item.useAnimation = Item.useTime = 13; @@ -27,12 +22,10 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.knockBack = 2f; - Item.value = Item.buyPrice(0, 0, 8, 0); + Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; Item.rare = ItemRarityID.LightPurple; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 22f; - Item.maxStack = Item.CommonMaxStack; - Item.consumable = true; Item.DamageType = RogueDamageClass.Instance; } 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/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 92de798ec1..6d7330fa64 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 44; Item.height = 48; - Item.damage = 165; + Item.damage = 160; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 40; @@ -32,26 +32,10 @@ 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) { - { - int proj = Projectile.NewProjectile(source, position, velocity.Length() * -Vector2.UnitY, type, damage, knockback, player.whoAmI); - if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - int spread = 15; - for (int i = 0; i < 2; i++) - { - Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-8, 8), velocity.Y + Main.rand.Next(-2, 3)).RotatedBy(MathHelper.ToRadians(spread)); - Projectile.NewProjectile(source, position, perturbedspeed.Length() * -Vector2.UnitY, type, (int)(damage * 0.3), knockback, player.whoAmI); - if (proj.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - } - spread -= Main.rand.Next(5, 8); - } - } - return false; - } + int proj = Projectile.NewProjectile(source, position, velocity.Length() * -Vector2.UnitY, type, damage, knockback, player.whoAmI); + if (proj.WithinBounds(Main.maxProjectiles)) + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; } } } 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/InfernalKris.cs b/Items/Weapons/Rogue/InfernalKris.cs index 13ec831929..a253fb640c 100644 --- a/Items/Weapons/Rogue/InfernalKris.cs +++ b/Items/Weapons/Rogue/InfernalKris.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 38; - Item.damage = 23; + Item.damage = 21; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 18; @@ -35,7 +35,10 @@ namespace CalamityMod.Items.Weapons.Rogue { int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); if (p.WithinBounds(Main.maxProjectiles)) + { Main.projectile[p].Calamity().stealthStrike = true; + Main.projectile[p].penetrate = 1; + } return false; } return true; 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/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index dc3bf49211..cfcd7844f7 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(100). + AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 7918e2eded..26a17019bd 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 48; - Item.damage = 64; + Item.damage = 57; Item.DamageType = RogueDamageClass.Instance; Item.knockBack = 3f; Item.useAnimation = Item.useTime = 15; @@ -38,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; } + public override float StealthDamageMultiplier => 1.25f; public override bool AltFunctionUse(Player player) => true; - public override bool CanUseItem(Player player) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) @@ -56,35 +56,23 @@ namespace CalamityMod.Items.Weapons.Rogue return base.CanUseItem(player); } - public override float UseSpeedMultiplier(Player player) - { - if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) - return 1f; - return 0.8f; - } - - public override float StealthDamageMultiplier => 1.25f; - - public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) - { - if (!player.Calamity().StealthStrikeAvailable() && player.altFunctionUse == 2) - damage = (int)(damage * 0.5f); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) { int bomb = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (bomb.WithinBounds(Main.maxProjectiles)) - Main.projectile[bomb].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + if (bomb.WithinBounds(Main.maxProjectiles) && player.Calamity().StealthStrikeAvailable()) + { + Main.projectile[bomb].Calamity().stealthStrike = true; + Main.projectile[bomb].extraUpdates = 1; + } return false; } else { - for (float i = -2.5f; i < 3f; ++i) + for (int i = 0; i < 2; i++) { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians((i - 0.5f) * 2)); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI); } } diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index adc05255a4..fb6f34714a 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -9,11 +9,15 @@ 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; Item.height = 38; - Item.damage = 44; + Item.damage = 43; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 9; @@ -21,35 +25,24 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 1f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.maxStack = 1; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 5.5f; + Item.shootSpeed = 7.5f; Item.DamageType = RogueDamageClass.Instance; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - bool stealthStrike = false; - if (player.Calamity().StealthStrikeAvailable()) - stealthStrike = true; - for (int i = 0; i < 2; i++) { - if (stealthStrike) - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity * 1.5f, type, damage, knockback * 12, player.whoAmI); - tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 140; - tooth.ai[1] = 4; - return false; // This makes it not fire 2 with the for loop, thanks Angel lol - } - else - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.7f, 1f), type, damage, knockback, player.whoAmI); - tooth.ai[1] = Main.rand.Next(1, 3 + 1); - } + Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.SafeNormalize(Vector2.UnitX), ModContent.ProjectileType(), damage, 0, player.whoAmI, 0, 0); + tooth.Calamity().stealthStrike = true; + } + else + { + for (int i = 0; i < 2; i++) + 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/MeteorFist.cs b/Items/Weapons/Rogue/MeteorFist.cs index 3fe824bcf6..514769e61b 100644 --- a/Items/Weapons/Rogue/MeteorFist.cs +++ b/Items/Weapons/Rogue/MeteorFist.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 22; Item.height = 28; - Item.damage = 37; + Item.damage = 31; Item.DamageType = RogueDamageClass.Instance; - Item.useAnimation = Item.useTime = 28; + Item.useAnimation = Item.useTime = 25; Item.knockBack = 5.75f; Item.shootSpeed = 4f; @@ -31,8 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); } - public override float StealthDamageMultiplier => 1.15f; - public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = 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/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 7adee86c42..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; @@ -17,8 +22,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 12; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 5; - Item.useAnimation = 5; + Item.useTime = 6; + Item.useAnimation = 6; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 1.5f; Item.UseSound = SoundID.Item1; @@ -36,12 +41,9 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[ModContent.ProjectileType()] < 20 && stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].Calamity().stealthStrike = true; - int projAmt = Main.rand.Next(7, 11); - for (int i = 0; i < projAmt; i++) + for (int i = 0; i < 8; i++) { - int spore = Projectile.NewProjectile(source, player.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.5f), knockback, player.whoAmI); - if (spore.WithinBounds(Main.maxProjectiles)) - Main.projectile[spore].ai[1] = 1f; + int spore = Projectile.NewProjectile(source, player.Center, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 1f); } foreach (Player other in Main.ActivePlayers) { diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index c00e7059f6..59195398eb 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -16,13 +16,12 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 108; Item.height = 114; - Item.damage = 152; + Item.damage = 140; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = Item.useAnimation = 30; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); 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/SludgeSplotch.cs b/Items/Weapons/Rogue/SludgeSplotch.cs index d3f9b71e46..e90b104126 100644 --- a/Items/Weapons/Rogue/SludgeSplotch.cs +++ b/Items/Weapons/Rogue/SludgeSplotch.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 30; - Item.damage = 41; + Item.damage = 30; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 18; diff --git a/Items/Weapons/Rogue/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index e99ea4e662..c1f007aef6 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 52; Item.height = 52; - Item.damage = 75; + Item.damage = 70; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 41; diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index b8f8e6eb71..abe77f582a 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -15,12 +15,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 34; - Item.damage = 82; + Item.damage = 69; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 9; + Item.useTime = Item.useAnimation = 9; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 9; Item.knockBack = 4f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 72246ccf3b..d1aa786d2e 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 40; Item.height = 24; - Item.damage = 50; + Item.damage = 47; Item.noMelee = true; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; 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/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/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index d531ffe9ce..f606cd97b4 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 42; - Item.damage = 50; + Item.damage = 64; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 28; 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 b8831ffa01..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,14 +12,18 @@ 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; Item.height = 40; - Item.damage = 120; + Item.damage = 80; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = Item.useAnimation = 42; + Item.useTime = Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6.5f; Item.UseSound = SoundID.Item106 with { Volume = 0.7f }; @@ -30,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - 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) { 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..6852ff4bf0 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 { @@ -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/AmphibiansGuitar.cs b/Items/Weapons/Summon/AmphibiansGuitar.cs index 1957f73d79..a385e088b1 100644 --- a/Items/Weapons/Summon/AmphibiansGuitar.cs +++ b/Items/Weapons/Summon/AmphibiansGuitar.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - Item.damage = 200; + Item.damage = 54; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/BorealisBomber.cs b/Items/Weapons/Summon/BorealisBomber.cs index d3fdc3a340..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,15 +14,16 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { Item.width = 48; Item.height = 56; - Item.damage = 35; + Item.damage = 34; Item.mana = 10; - Item.useAnimation = Item.useTime = 19; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index a69c43a5a0..4e39fe3f72 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.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; @@ -36,6 +38,7 @@ 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) { 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/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index bdaf95d306..de17dde940 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.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; @@ -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; diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index e1a878b754..b4c43ed83f 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -19,7 +20,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() { diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index 24fa2614c3..3e7129a037 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.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 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; diff --git a/Items/Weapons/Summon/CryogenicStaff.cs b/Items/Weapons/Summon/CryogenicStaff.cs index 8408855e68..56285668c0 100644 --- a/Items/Weapons/Summon/CryogenicStaff.cs +++ b/Items/Weapons/Summon/CryogenicStaff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 82; Item.height = 84; - Item.damage = 50; + Item.damage = 30; Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index 9f99226039..d67006f38b 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -1,4 +1,6 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; +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 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; @@ -43,15 +49,5 @@ namespace CalamityMod.Items.Weapons.Summon } 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..93cff97797 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,6 +14,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; diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index b68a90c690..07c7018c5d 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.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; @@ -10,6 +11,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; 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/DreadmineStaff.cs b/Items/Weapons/Summon/DreadmineStaff.cs index e26467a1f2..672105c7df 100644 --- a/Items/Weapons/Summon/DreadmineStaff.cs +++ b/Items/Weapons/Summon/DreadmineStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 44; Item.height = 44; - Item.damage = 60; + Item.damage = 40; Item.mana = 10; Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/EntropysVigil.cs b/Items/Weapons/Summon/EntropysVigil.cs index 676648fcab..286efcaa94 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -16,13 +18,14 @@ namespace CalamityMod.Items.Weapons.Summon { Item.staff[Type] = true; ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { Item.width = 52; Item.height = 52; - Item.damage = 47; + Item.damage = 42; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index e1103cbc49..9edd09c593 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,7 +13,10 @@ 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; diff --git a/Items/Weapons/Summon/FlarebatStaff.cs b/Items/Weapons/Summon/FlarebatStaff.cs index f94955710b..4ee88f1d16 100644 --- a/Items/Weapons/Summon/FlarebatStaff.cs +++ b/Items/Weapons/Summon/FlarebatStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - Item.damage = 18; + Item.damage = 20; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index a7f73e84fa..671bec1cae 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,7 +12,10 @@ 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; @@ -36,15 +40,5 @@ namespace CalamityMod.Items.Weapons.Summon Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); 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/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/GastricBelcherStaff.cs b/Items/Weapons/Summon/GastricBelcherStaff.cs index 4d2796f9cd..0d23ca4774 100644 --- a/Items/Weapons/Summon/GastricBelcherStaff.cs +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,11 +12,15 @@ 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; Item.height = 70; - Item.damage = 60; + Item.damage = 50; Item.mana = 10; Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/HivePod.cs b/Items/Weapons/Summon/HivePod.cs index 8fdf65c7a8..5013bfe4c7 100644 --- a/Items/Weapons/Summon/HivePod.cs +++ b/Items/Weapons/Summon/HivePod.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 46; Item.height = 50; - Item.damage = 125; + Item.damage = 75; Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index 1fb197c03a..e91c75a2c7 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -1,6 +1,7 @@ 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 +11,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() @@ -34,54 +57,42 @@ namespace CalamityMod.Items.Weapons.Summon Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } + + public override bool AltFunctionUse(Player player) + { + return 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); + + 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; - int swordCount = 0; + } + + 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 +102,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..a5391fa820 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.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; @@ -32,7 +33,12 @@ 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() { diff --git a/Items/Weapons/Summon/MutatedTruffle.cs b/Items/Weapons/Summon/MutatedTruffle.cs index 145cc7d099..be68bf83a5 100644 --- a/Items/Weapons/Summon/MutatedTruffle.cs +++ b/Items/Weapons/Summon/MutatedTruffle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -29,7 +30,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() { diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index e610e10089..af0f2d7571 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -13,7 +14,11 @@ 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.StaffMinionSlotsRequired[Type] = 5f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Summon/PuffShroom.cs b/Items/Weapons/Summon/PuffShroom.cs index b1e933d4d3..99690d4f50 100644 --- a/Items/Weapons/Summon/PuffShroom.cs +++ b/Items/Weapons/Summon/PuffShroom.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; @@ -10,6 +11,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; diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 5254fbb849..262bb00eb2 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -11,19 +11,14 @@ namespace CalamityMod.Items.Weapons.Summon public class SandSharknadoStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - #region Other stats for easy modification - public const float ProjSpeed = 30f; - public const float FireSpeed = 50f; // In frames. 60 frames = 1 second. - #endregion - public override void SetDefaults() { Item.width = 48; Item.height = 56; - Item.damage = 94; + Item.damage = 71; Item.knockBack = 2f; Item.mana = 10; diff --git a/Items/Weapons/Summon/ScabRipper.cs b/Items/Weapons/Summon/ScabRipper.cs index 74d18a268c..9ddc38325c 100644 --- a/Items/Weapons/Summon/ScabRipper.cs +++ b/Items/Weapons/Summon/ScabRipper.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 66; Item.height = 70; - Item.damage = 16; + Item.damage = 15; Item.mana = 10; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Shoot; 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/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index bbd57dae6f..15ab023121 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -1,4 +1,5 @@ using System.Linq; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,6 +13,10 @@ 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; diff --git a/Items/Weapons/Summon/StarspawnHelixStaff.cs b/Items/Weapons/Summon/StarspawnHelixStaff.cs index 333bdf5ce4..e687d10378 100644 --- a/Items/Weapons/Summon/StarspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.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; @@ -11,6 +12,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; diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 99845a7cb9..5b731630f0 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,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; diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index e584d973f4..db16a86ab9 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 40; Item.height = 36; - Item.damage = 14; + Item.damage = 15; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); Item.knockBack = 0.5f; diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index 967ce92bd5..1c6f7c5669 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 48; Item.height = 56; - Item.damage = 30; + Item.damage = 24; Item.mana = 10; Item.useAnimation = Item.useTime = 19; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 332e3bc54d..38ce3b2db3 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() { diff --git a/Items/Weapons/Summon/YharonsKindleStaff.cs b/Items/Weapons/Summon/YharonsKindleStaff.cs index 104e4933e0..cffe7f5fb8 100644 --- a/Items/Weapons/Summon/YharonsKindleStaff.cs +++ b/Items/Weapons/Summon/YharonsKindleStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -15,7 +16,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() { diff --git a/Localization/en-US/Mods.CalamityMod.Attunement.hjson b/Localization/en-US/Mods.CalamityMod.Attunement.hjson index a694250087..bb971a8498 100644 --- a/Localization/en-US/Mods.CalamityMod.Attunement.hjson +++ b/Localization/en-US/Mods.CalamityMod.Attunement.hjson @@ -138,7 +138,7 @@ PhoenixAttunement: { Swing the sword around you, accelerating over time The swirling nebula constantly emits homing cosmic bolts Release to hurl the sword toward the cursor alongside 6 gigantic cosmic bolts - The hurled sword erupts into a blazing flame pillar on enemy hits + The hurled sword erupts into a blazing tornado on enemy hits ''' } 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 971ac6e917..0d2f5e2bb4 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -730,11 +730,6 @@ BrimflameFrenzyBuff: { Description: Dark magic empowers your attacks at the cost of your life } -BrutalCarnage: { - DisplayName: Brutal Carnage - Description: "{0}% increased melee damage" -} - ChiBuff: { DisplayName: Chi Description: You are more resilient @@ -896,7 +891,7 @@ SilvaRevival: { SpiritDefense: { DisplayName: Spirit Defense - Description: Defense increased by {0} and damage reduction increased by {1}% + Description: Defense increased by {0} } SpiritPower: { @@ -1118,7 +1113,7 @@ BrimseekerBuff: { Description: Does it want something from you? } -BrimstoneWaifu: { +BrimstoneElemental: { DisplayName: Brimstone Elemental Description: The Brimstone Elemental will protect you } @@ -1143,7 +1138,7 @@ CinderBlossomBuff: { Description: A hot, searing flower is floating uncomfortably close to you } -CloudyWaifu: { +CloudElemental: { DisplayName: Cloud Elemental Description: The Cloud Elemental will protect you } @@ -1424,6 +1419,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 @@ -1439,12 +1439,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 } @@ -1559,7 +1554,7 @@ VoidConcentrationBuff: { Description: The infinite void yearns for more... } -WaterWaifu: { +WaterElemental: { DisplayName: Anahita Description: Anahita will protect you } 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 89b05f4298..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 DOWN hotkey (or 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: @@ -137,7 +127,7 @@ CalamityClientConfig: { Label: "[i:CalamityMod/BallAndChain] Enable Fast Falling" Tooltip: ''' - When enabled, you can hold the DOWN key while in the air to accelerate downwards faster. + When enabled, you can hold the {$Key.DOWN} key while in the air to accelerate downwards faster. This config does not increase your maximum falling speed, just how quickly you accelerate to it. Calamity is balanced around this setting being enabled. ''' @@ -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.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index ef1dc5d284..6a2096c783 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -29,9 +29,8 @@ AbyssalDivingSuit: { The suit's armored plates increase damage reduction by 15% Wearing this suit grants 15% damage reduction for hits under 50 damage The suit can absorb up to 3 hits over 50 damage, and will take 3 minutes to regenerate - Reduces the damage caused by drowning in the abyss, and removes the bleed effect in the upper layers Grants the ability to swim, extends underwater breathing, emits light underwater, and improves mobility on ice - Provides a moderate amount of light and reduces breath loss in the abyss + Provides a moderate amount of light, reduces breath loss, and reduces damage caused by drowning in the abyss Abyss creatures are less likely to see you, mitigates the abyss' defense reduction, and lets you sink faster in liquids Grants immunity to the sulphurous waters and Crush Depth's increased breath loss Grants resistance to the increased breath loss caused by Hadopelagic Pressure @@ -66,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: { @@ -289,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'] ''' @@ -343,7 +342,7 @@ BloodPact: { BloodstainedGlove: { DisplayName: Bloodstained Glove - Tooltip: Stealth strikes have +8 armor penetration and heal for 2 HP + Tooltip: Stealth strikes have +8 armor penetration and heal for 5 HP } BloodyWormScarf: { @@ -362,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' ''' } @@ -555,8 +554,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'" } @@ -596,11 +595,26 @@ DepthCharm: { Tooltip: ''' Reduces the damage caused by drowning in the abyss - Removes the bleed effect caused by the upper layers of the abyss Removes the increased breath loss of Crush Depth ''' } +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: @@ -688,7 +702,7 @@ ElectriciansGlove: { DisplayName: Electrician's Glove Tooltip: ''' - Stealth strikes summon sparks on enemy hits and heal you for 2 HP + Stealth strikes summon sparks on enemy hits and heal you for 10 HP Stealth strikes also have +8 armor penetration and deal 8% more damage ''' } @@ -706,6 +720,11 @@ ElementalGauntlet: { ''' } +ElementalinaBottle: { + DisplayName: Elemental in a Bottle + Tooltip: Summons a sand elemental to fight for you +} + ElysianAegis: { DisplayName: Elysian Aegis Tooltip: @@ -819,7 +838,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 ''' } @@ -838,7 +857,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 ''' } @@ -884,7 +903,11 @@ GladiatorsLocket: { GloveOfPrecision: { DisplayName: Glove of Precision - Tooltip: Decreases rogue attack speed by 15%, but increases damage by 10%, crit by 15% and velocity by 15% + Tooltip: + ''' + Decreases rogue attack speed by 15% + Increases rogue damage and critical strike chance by 10%, and velocity by 15% + ''' } GloveOfRecklessness: { @@ -917,7 +940,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] ''' } @@ -957,7 +980,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 @@ -988,10 +1011,10 @@ InfectedJewel: { Tooltip: ''' Passively grants +1 HP/s life regen - Grants 16 defense and +2 HP/s life regen while afflicted with any debuff + Grants 12 defense and +2 HP/s life regen while afflicted with any debuff Massively boosts natural 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' ''' @@ -1001,8 +1024,10 @@ InkBomb: { DisplayName: Ink Bomb Tooltip: ''' - Throws several ink bombs when hit that explode into ink - Gain a lot of stealth and confuse enemies when struck + +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 This effect has a 20 second cooldown before it can occur again ''' } @@ -1012,7 +1037,7 @@ InterstellarStompers: { Tooltip: ''' 6% increased movement speed, 20% increased jump speed, and negates fall damage - Hold DOWN to increase your maximum fall speed + Hold {$Key.DOWN} to increase your maximum fall speed Pressing [KEY] while midair charges up a superspeed slam over 0.33 seconds While falling, you ram through enemies and don't take contact damage Once you hit the ground, you create an explosion at your feet @@ -1025,7 +1050,7 @@ IronBoots: { DisplayName: Iron Boots Tooltip: ''' - Hold DOWN to increase your maximum fall speed, even in water + Hold {$Key.DOWN} to increase your maximum fall speed, even in water Upon hitting the ground, a shockwave is created at your feet The shockwave scales in both damage and size the longer you fall for Negates fall damage @@ -1078,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: @@ -1387,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,8 +1430,8 @@ Radiance: { [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:+15 defense and faster natural regen recovery 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] ''' } @@ -1451,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: @@ -1466,8 +1484,8 @@ ReaperToothNecklace: { ''' } -Regenator: { - DisplayName: Regenator +Regenerator: { + DisplayName: Regenerator Tooltip: ''' Your health cannot exceed 50% of its maximum @@ -1507,7 +1525,7 @@ RoverDrive: { DisplayName: Rover Drive Tooltip: ''' - Gain a barrier with 20 health, which grants 10 defense while active + Gain a barrier with 20 health [ADREN] If depleted, the barrier's health regenerates after not receiving damage for 10 seconds Getting hit resets the timer @@ -1531,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 ''' } @@ -1684,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] ''' } @@ -1733,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}" } @@ -1746,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}" } @@ -1822,9 +1838,9 @@ StatMeter: { AbyssStats: ''' Abyss Light Strength: {0} - Breath Lost Per Tick: {1} | Breath Loss Rate: {2} - Life Lost Per Tick at Zero Breath: {3} - Defense Lost From Pressure: {4} + Breath Loss Rate: {1} + Life Lost Per Tick at Zero Breath: {2} + Defense Lost From Pressure: {3} ''' AbyssStatsHidden: Abyss stats are only displayed while in the Abyss } @@ -1953,8 +1969,8 @@ 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 120 health + The barrier grants 10% damage reduction while active [ADREN] The barrier will regenerate 8 seconds after being hit, taking 10 seconds to completely regenerate Getting hit resets the timer @@ -2000,7 +2016,7 @@ TrinketofChi: { ''' Increases damage reduction by 8% if you avoid taking damage for 10 seconds This buff expires on hit - +1 HP/s life regen for teammates + +1 HP/s life regen for you and your teammates ''' } @@ -2081,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: @@ -2103,9 +2105,9 @@ WulfrumAcrobaticsPack: { This slingshot's stats scale with your equipped hook If the hook has special effects, the slingshot also benefits from them The slingshot allows for advanced rope-swinging physics - Hold UP or DOWN to retract or extend the slingshot's rope + Hold {$Key.UP} or {$Key.DOWN} to retract or extend the slingshot's rope Automatically grapples nearby walls if a lethal fall is detected - This safety feature won't activate if DOWN is held + This safety feature won't activate if {$Key.DOWN} is held 8% increased movement speed ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index 23e2a20942..c04413cf96 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,32 +33,31 @@ 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: { @@ -150,9 +149,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 +159,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,27 +169,28 @@ 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 + {$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 spawn homing eaters on enemy hits Rogue and summon attacks will scale off of the stat with a higher boost Minions no longer deal less damage while wielding rogue weapons @@ -200,11 +199,7 @@ ForbiddenCirclet: { HydrothermicArmor: { DisplayName: Hydrothermic Armor - Tooltip: - ''' - +20 max life - 8% increased damage and 4% increased critical strike chance - ''' + Tooltip: 8% increased damage and 4% increased critical strike chance CommonSetBonus: ''' Inferno effect when below 50% life @@ -300,9 +295,8 @@ LunicCorpsBoots: { DisplayName: Lunic Corps Boots Tooltip: ''' - 15% increased movement speed - 5% increased ranged critical strike chance - 10% increased max movement speed and acceleration + {0}% increased ranged critical strike chance + {1}% increased movement speed and acceleration ''' } @@ -310,38 +304,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} seconds after being hit] + [c/52CBDE:Recharging from zero to full charge takes {5} 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 +337,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 +352,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 ''' } @@ -391,11 +378,7 @@ PlaguebringerPistons: { PlaguebringerVisor: { DisplayName: Plaguebringer Visor - Tooltip: - ''' - 15% increased summon damage - +20 max life - ''' + Tooltip: 15% increased summon damage SetBonus: ''' Grants a plague dash which can slam through enemies without taking damage @@ -412,8 +395,8 @@ PlagueReaperMask: { 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} to blind yourself for 5 seconds but massively boost your ranged damage + This has a 25 second cooldown ''' } @@ -480,14 +463,12 @@ ReaverHeadTank: { ''' 15% increased damage reduction but 30% decreased damage +50 max life - Restores 1 HP every second, this applies separately from life regen ''' SetBonus: ''' - +10 defense and +1.5 HP/s life regen + +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% - All attacks steal life and speed up the rate of life regen 30% decreased movement speed and flight time Enemy damage is reflected and summons a thorn spike Reaver Rage activates when you are damaged @@ -496,36 +477,31 @@ ReaverHeadTank: { ReaverScaleMail: { DisplayName: Reaver Scale Mail - Tooltip: - ''' - 9% increased damage and 4% increased critical strike chance - +20 max life - ''' + Tooltip: 9% increased damage and 4% increased critical strike chance } 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} ''' } @@ -533,17 +509,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 ''' @@ -551,5 +527,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 645abad5d7..b43be68354 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -23,7 +23,7 @@ AuricTeslaHeadRanged: { SetBonus: ''' Ranged Tarragon, Bloodflare and God Slayer armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -56,7 +56,7 @@ AuricTeslaHeadRogue: { ''' +130 maximum stealth Rogue Tarragon, Bloodflare and God Slayer armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -90,7 +90,7 @@ AuricTeslaHeadMelee: { Enemies are more likely to target you 28% increased melee speed Melee Tarragon, Bloodflare and God Slayer effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -120,7 +120,7 @@ AuricTeslaHeadSummon: { Max run speed and acceleration boosted by 5% +6 max minions and 75% increased summon damage Summoner Tarragon, Bloodflare and Silva armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -149,7 +149,7 @@ AuricTeslaHeadMagic: { ''' Max run speed and acceleration boosted by 5% Magic Tarragon, Bloodflare and Silva armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -176,7 +176,7 @@ BloodflareBodyArmor: { Tooltip: ''' 12% increased damage and 8% increased critical strike chance - +40 max life + +25 max life ''' CommonSetBonus: ''' @@ -213,7 +213,6 @@ BloodflareHeadMelee: { ''' SetBonusEffect: ''' - True melee strikes will heal you After striking an enemy 15 times with true melee you will enter a blood frenzy for 5 seconds During this you will gain 25% increased melee damage, critical strike chance, and contact damage is halved This effect has a 30 second cooldown @@ -226,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 ''' @@ -248,7 +247,8 @@ BloodflareHeadRogue: { ''' Being over 80% life boosts your defense by 30 and rogue crit by 5% Being below 80% life boosts your rogue damage by 10% - Rogue critical strikes heal you + Rogue critical strikes burst into blood orbs + Picking up these blood orbs reduces the duration of [Potion Sickness] ''' } @@ -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,7 +292,7 @@ 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 ''' } @@ -302,7 +302,6 @@ EmpyreanCloak: { Tooltip: ''' Armor of the cosmos - +20 max life 7% increased rogue damage and critical strike chance ''' } @@ -417,15 +416,15 @@ 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 ''' CommonSetBonus: ''' - Pressing {0} allows you to dash towards your cursor for 2.5 seconds + Pressing {0} allows you to dash towards your cursor for 2 seconds Enemies you dash through take massive damage - During the dash you are immune to most debuffs + During the dash you are immune to damage and most debuffs The dash has a {1} second cooldown ''' } @@ -506,7 +505,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 +544,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 +555,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,12 +564,12 @@ SilvaArmor: { DisplayName: Silva Armor Tooltip: ''' - +80 max life + +50 max life 11% increased damage and 8% increased critical strike chance ''' CommonSetBonus: ''' - All projectiles spawn healing leaf orbs on enemy hits + +3 HP/s life regen Max run speed and acceleration boosted by 5% Taking fatal damage will revive you and make you invulnerable to all damage for 5 seconds This effect has a 5 minute cooldown, which does not decrement if any bosses or events are active @@ -617,7 +616,6 @@ TarragonBreastplate: { ''' CommonSetBonus: ''' - Reduces enemy spawn rates Increased heart pickup range Enemies have a chance to drop extra hearts on death ''' @@ -631,12 +629,7 @@ TarragonHeadMagic: { 10% increased damage reduction, +100 max mana, and 15% reduced mana usage ''' SetBonus: "{$TarragonHeadMagic.SetBonusEffect}" - SetBonusEffect: - ''' - On every 5th critical strike you will fire a leaf storm - Magic projectiles heal you on enemy hits - Amount healed is based on projectile damage - ''' + SetBonusEffect: On every 5th critical strike you will fire a leaf storm } TarragonHeadMelee: { @@ -655,7 +648,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 19a3b8ddc3..4cde8ba463 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -1,147 +1,155 @@ 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 ranged critical strike chance and 20% chance to not consume ammo - SetBonus: Ranged attacks deal an extra {0} flat damage - AbilityBrief: Sandsmoke Bomb - Double tap {0} to shroud yourself in a small cloud of sand - AbilityDescription: + Tooltip: "{$Common.RogueCrit}" + SetBonus: ''' - While the sand cloud is active, gain increased mobility but heavily reduced defense - Using a ranged 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 ranged 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 Up and 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: 3% increased rogue critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianGreaves: { DisplayName: Snow Ruffian Greaves - Tooltip: 5% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianMask: { DisplayName: Snow Ruffian Mask - Tooltip: 2% increased rogue damage + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" SetBonus: ''' - 5% increased rogue damage - +50 maximum stealth You can glide to negate fall damage + 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 + When you take over {0} 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 + {1}% 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} ''' } @@ -149,18 +157,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} ''' } @@ -168,10 +176,10 @@ 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: { @@ -179,106 +187,94 @@ StatigelHeadSummon: { Tooltip: Increased minion knockback SetBonus: ''' - 18% increased summon damage and +1 max minion + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a mini paladin to fight for you, the type depends on what world evil you have ''' } SulphurousBreastplate: { DisplayName: Sulphurous Breastplate - Tooltip: 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] ''' } @@ -296,25 +292,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.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 4cdeb69161..75375242bb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -102,7 +102,7 @@ DragoonDrizzlefish: { ''' Fires an assortment of hellfire and brimstone fireballs Sometimes fires a larger splitting fireball - Right click to feed the little boy some tasty gel + to feed the little boy some tasty gel 'He is a hungry boy' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson b/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson index eeb8cd9033..e5e5499fae 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson @@ -1,7 +1,7 @@ ShortTooltip: ''' [c/E3AF40:Whispers from on high dance in your ears...] - [c/BEBEBE:Press "Left Shift" to listen closer] + [c/BEBEBE:Hold Shift to listen closer] ''' LoreAbyss: { 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.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson index 3700ac4fa9..dde7b09dae 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson @@ -383,12 +383,12 @@ VoodooDemonVoodooDoll: { ExhumeShortTooltip: ''' [c/C61B40:'Ah, are you curious what I saw within this item?'] - [c/BABABA:Press "Left Shift" to listen] + [c/BABABA:Hold Shift to listen] ''' LegendaryShortTooltip: ''' [c/FF6F00:Tales of legends past radiate around you...] - [c/BABABA:Press "Left Shift" to listen closer] + [c/BABABA:Hold Shift to listen closer] ''' BallAndChain: { @@ -420,7 +420,7 @@ DisgustingMeat: { Tooltip: ''' Debug item, spawn and use to remove permanent upgrades - will remove health and mana upgrades + will remove health and mana upgrades, use with no Calamity upgrades to remove vanilla upgrades will remove rage and adrenaline upgrades, plus other miscellaneous boosters Removed boosters will be vomited out of you as items ''' @@ -514,6 +514,7 @@ SuperDummy: { Creates a super dummy Regenerates 1 million life per second Will not die when taking damage over time from debuffs - Right click to kill all super dummies + to kill all super dummies + Can only spawn 50 super dummies at once ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson b/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson index bedd4c182b..28ecd49ad7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson @@ -32,7 +32,7 @@ GazeOfCrysthamyr: { Tooltip: ''' Summons a rideable shadow dragon mount - Hold Up to ascend faster + Hold {$Key.UP} to ascend faster ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index cf192272c0..12a943c834 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}" @@ -499,7 +501,7 @@ CalamityCanvas2023: { to make the focus follow the cursor, again to set it Arrow keys can also be used to manually adjust the focus point The scroll wheel zooms the focus in and out - Hold SHIFT to hide the UI without closing it + Hold Shift to hide the UI without closing it 'Embrace chaos' ''' } @@ -512,7 +514,7 @@ CalamityCanvas2024: { to make the focus follow the cursor, again to set it Arrow keys can also be used to manually adjust the focus point The scroll wheel zooms the focus in and out - Hold SHIFT to hide the UI without closing it + Hold Shift to hide the UI without closing it 'Embrace havoc' ''' } @@ -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: @@ -793,7 +760,7 @@ ThankYouPainting: { ''' Thanks to the entire team, everyone who supported, and those who all play the mod and keep it alive! The confines of this painting is not enough to fit the entire team - Hold SHIFT to see a list of past and current developers + Hold Shift to see a list of past and current developers ''' } @@ -892,6 +859,11 @@ KelpTorch: { Tooltip: Can be placed in water } +OldDukeMonolith: { + DisplayName: Elden Diorama + Tooltip: "" +} + OtonilouStatue: { DisplayName: Otonilou Memorial Tooltip: "" @@ -1194,7 +1166,7 @@ VigorousCandle: { Tooltip: ''' when placed to regenerate {0}% of your maximum health per second - This regeneration is at full power even while moving and bypasses Revengeance Mode caps + This regeneration is at full power even while moving This cannot be stacked with other Candle buffs 'Its brilliant light suffuses those nearby with hope' ''' @@ -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,22 @@ 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 - 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: Mods.CalamityMod.Items.Placeables.ChargedWulfrumWallMountedBulb.DisplayName - Tooltip: "" -} - -WulfrumWallMountedBulb: { - DisplayName: Mods.CalamityMod.Items.Placeables.WulfrumWallMountedBulb.DisplayName - 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 +ShellTrimBrickWall: { + DisplayName: Shell Trim Brick Wall Tooltip: "" } diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index ad00243c80..dc71997ddd 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.' ''' @@ -86,7 +85,6 @@ CryoKey: { Tooltip: ''' [SPAWN] - Enrages outside the tundra {$Common.NotConsumable} 'A key for a glacial prison.' ''' @@ -108,8 +106,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 +149,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 +180,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 @@ -204,6 +200,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 +277,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 +286,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 7b35e3cf51..1083e38f93 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -111,7 +111,7 @@ DriftwoodPickaxe: { FellerofEvergreens: { DisplayName: Feller of Evergreens - Tooltip: "" + Tooltip: Occasionally drops extra fruits from shaking trees } Gelpick: { 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 9c176472a5..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,29 @@ 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: + ''' + A precision welding glove with laser emitters in each fingertip + to focus all emitters into a short range palm blast that always critically strikes + Palm blasts have a cooldown which is significantly shorter if they miss + [c/1FFBFF:'Most battalions prefer to either spread attacks widely, or focus on a singular target.] + [c/1FFBFF:This glove caters to both, though it will never bridge the gap between their strategies.'] + ''' +} + GalvanizingGlaive: { DisplayName: Galvanizing Glaive Tooltip: @@ -21,15 +44,6 @@ GalvanizingGlaive: { ''' } -GatlingLaser: { - DisplayName: Gatling Laser - Tooltip: - ''' - Fires a rapid barrage of accelerated lasers to annihilate foes - [c/1FFBFF:'Developed to be used primarily by Yharim's fleet and base defense force.'] - ''' -} - GaussDagger: { DisplayName: Gauss Dagger Tooltip: @@ -39,18 +53,8 @@ GaussDagger: { ''' } -GaussPistol: { - DisplayName: Gauss Pistol - Tooltip: - ''' - Fires a devastating high-velocity blast with extreme knockback - [c/1FFBFF:'Though this arcane pistol may seem mundane, it is deceivingly powerful.] - [c/1FFBFF:One of the many advantages of magical firearms is that size does not equal power.'] - ''' -} - -HolofiberImmolator: { - DisplayName: R-PMA: Holofiber Immolator +HolofibreImmolator: { + DisplayName: R-PMA: Holofibre Immolator Tooltip: ''' Fires three gravity-affected plasma drops which dissolve through foes @@ -265,3 +269,16 @@ WavePounder: { Stealth strikes emit absurdly powerful shockwaves ''' } + +Vulcan: { + DisplayName: R-GSS: Vulcan + Tooltip: + ''' + A mana-fueled Gatling cannon that fires in bursts + Press to launch a magnetic harpoon which attracts your shots + Launching a harpoon makes burst fire mode last longer + When a harpoon expires, all magnetized shots launch at nearby enemies with increased damage + [c/1FFBFF:'Originally a ceiling mounted mining beam, the removal of its battery reduced its heft only marginally.] + [c/1FFBFF:It saw little use and many complaints from the battlemage corps.'] + ''' +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 89d5f7e200..4657a9d5e5 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -38,7 +38,8 @@ AnahitasArpeggio: { TooltipNormal: ''' Holding casts up to 6 treble clefs that orbit the player - Releasing causes the treble clefs to fade away, then converge at the cursor + Releasing causes the treble clefs to converge at the cursor + After converging, treble clefs seek your cursor ''' TooltipGFB: ''' @@ -488,7 +489,8 @@ Keelhaul: { DisplayName: Keelhaul Tooltip: ''' - Summons a geyser upon hitting an enemy + Summons a lingering geyser upon hitting an enemy + Only one geyser can exist at a time 'Crumple 'em like paper' ''' } @@ -784,7 +786,7 @@ SHPC: { Orbs emit seeking souls and lingering pickup souls after collapse Orbs have varying effects depending on Soul type used {0} - Press Right Click to use the machine as a vacuum, pulling in lingering souls + Press to use the machine as a vacuum, pulling in lingering souls Once released, a torrent of soul lasers is discharged scaling with the number of souls pulled in ''' // These are the soul effect descriptions, the number is the item ID of the soul diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index a7f7715998..1164637196 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -84,7 +84,7 @@ ArkoftheCosmos: { to snip out the scissor blades in front of you Hitting an enemy with it will parry them, granting you brief invulnerability You can also parry projectiles to make them deal 160 less damage for a short period - Parrying will empower the next 15 swings of the sword + Parrying will empower the next 16 swings of the sword ''' BlastInfo: Double with charges available to cause a Big Rip in spacetime and consume all charges } @@ -185,12 +185,7 @@ BladecrestOathsword: { BlightedCleaver: { DisplayName: Blighted Cleaver - Tooltip: - ''' - Fires homing blazing blades - Gives the player the Brutal Carnage buff on enemy hits - This buff increases melee damage by 20% - ''' + Tooltip: Fires homing blazing blades } Bonebreaker: { @@ -334,12 +329,7 @@ DeathsAscension: { DefiledGreatsword: { DisplayName: Defiled Greatsword - Tooltip: - ''' - Fires blazing, hyper, and sunlight blades - Gives the player the Brutal Carnage buff on enemy hits - This buff increases melee damage by 20% - ''' + Tooltip: Fires blazing, hyper, and sunlight blades } DepthCrusher: { @@ -654,7 +644,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: { @@ -918,7 +915,7 @@ OldLordClaymore: { HoldShiftTooltip: ''' [c/df4420:A gift to outstanding Demons, a replica of the sword used by the greatest of all Demon Lords.] - [c/df4420:The prosperity he brought to their kind is unmatched even now that they alone rule the Undeworld.] + [c/df4420:The prosperity he brought to their kind is unmatched even now that they alone rule the Underworld.] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 319dace1d7..021008f3c8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -282,7 +282,7 @@ ClockworkBow: { DisplayName: Clockwork Bow Tooltip: ''' - Hold left click to load up to six precision bolts + Hold to load up to six precision bolts The more precision bolts are loaded, the harder they hit ''' } @@ -453,9 +453,11 @@ FirestormCannon: { DisplayName: Firestorm Cannon Tooltip: ''' - Releases a constant stream of weaponized flares - Press to fire a condensed spread of flares + Fires a rapid barrage of flares that builds up a searing heat in the weapon + Firing for too long overheats the weapon, leaving it unusable for a short period + Press to put away the weapon, which preserves its heat 70% chance to save ammo + 'What could go wrong?' ''' } @@ -557,7 +559,7 @@ HalleysInferno: { Press to zoom out Uses gel for ammo 50% chance to save ammo - 'Halley came sooner than expected' + 'Halley arrived sooner than expected' ''' } @@ -936,7 +938,7 @@ PolarisParrotfish: { ''' Rapidly fires an array of colorful star shots Firing speed increases the closer you are to an enemy - Right click to give the little girl some attention + to give the little girl some attention 'She is a happy girl' ''' } @@ -1154,8 +1156,13 @@ SpectralstormCannon: { DisplayName: Spectralstorm Cannon Tooltip: ''' - Fires a storm of lost souls and flares + Fires a barrage of spectral flares that builds up a searing heat in the weapon + While cooling down, heat-seeking phantoms are continuously released + Firing for too long overheats the weapon, leaving it unusable for a short period + However, triggering overheat releases a powerful burst of souls and resets heat + Press to put away the weapon, which preserves its heat 70% chance to save ammo + 'Ectoplasmic blast rated visor mandatory' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 2037158363..4fe952f5bc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -195,7 +195,7 @@ CrushsawCrasher: { Tooltip: ''' Throws bouncing axes - Stealth strikes throw five at once + Stealth strikes throw six at once ''' GFBFirstWords: ''' @@ -276,8 +276,8 @@ DeepWounder: { DisplayName: Deep Wounder Tooltip: ''' - Throws an abyssal hatchet that inflicts Armor Crunch and Crush Depth to the enemies it hits - Stealth strikes cause the hatchet to stick to struck enemies, causing Heavy Bleeding and spawning a burst of water projectiles + Throws an abyssal hatchet that inflicts Heavy Bleeding and Crush Depth to the enemies it hits + Stealth strikes cause the hatchet to stick to struck enemies, releasing a barrage of water projectiles Water projectiles launch at the closest enemy after a brief delay ''' } @@ -449,7 +449,6 @@ FrostcrushValari: { ''' Fires a long ranged frosty boomerang that chips off homing icicles on hit Stealth strikes throw a boomerang which follows the cursor - This boomerang creates a freezing blast and chips off homing icicles on every hit ''' } @@ -458,7 +457,7 @@ FrostyFlare: { Tooltip: ''' Throw a flare that sticks to enemies and rains a hailstorm on them - Stealth strikes trail snowflakes and summon phantom copies instead of ice shards + Stealth strikes summon phantom copies instead of ice shards 'Do not insert in flare gun' ''' } @@ -556,7 +555,7 @@ HeavenfallenStardisk: { ''' Throws a stardisk upwards which then launches itself towards your mouse cursor Explodes into a star of astral bolts on hit - Stealth strikes throw three disks that rain astral energy bolts from the sky + Stealth strikes rain astral energy bolts from the sky ''' } @@ -600,8 +599,8 @@ InfernalKris: { DisplayName: Infernal Kris Tooltip: ''' - Throws a burning dagger that starts spinning after travelling a short distance, inflicting additional damage while spinning - Stealth strikes cause the dagger to be engulfed in flames, exploding on contact with walls and enemies + Rapidly throws burning daggers + Stealth strikes engulf the dagger in flames, exploding when hitting walls and enemies ''' } @@ -677,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 ''' } @@ -1392,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 571c8256a9..bca33b7c0a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -51,7 +51,7 @@ AtlasMunitionsBeacon: { [c/F27049:If an enemy is in close proximity, it will enter Overdrive] [c/F27049:When in Overdrive the cannon uses its full power to bring down any foe] [c/F27049:While in Overdrive, the cannon will build up heat, eventually overheating] - [c/69F0DC:Press right click while holding this item to pick up the cannon and use it yourself] + [c/69F0DC:Press while holding this item to pick up the cannon and use it yourself] [c/69F0DC:When held, the cannon will always be in Overdrive] [c/69F0DC:If the cannon overheats while you hold it, you will be forced to drop it] [c/9AA4AE:Pressing allows you to drop it manually] @@ -91,7 +91,7 @@ BrittleStarStaff: { ''' Summons a small brittle starfish that will dash through enemies until it shatters Starfish will quickly regenerate after shattering - Holding right click will swap starfish between dashing and circling you + Holding will swap starfish between dashing and circling you When the starfish are circling, each one provides you with 4 defense ''' } @@ -364,7 +364,7 @@ FlamsteedRing: { Tooltip: ''' Summons a colossal controllable mech - Right click to display the mech's control panel + to display the mech's control panel The panel has 3 configurations, selected using the brackets on the edges of the UI Each bracket powers 2 out of 3 possible functions, represented by the circular icons The bottom left icon miniaturizes the mech to the size of a player, but weakens its weapons @@ -435,7 +435,7 @@ GlacialEmbrace: { For each minion slot used, you will gain an additional orbiting shield spike These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage They take some time to regenerate after launching themselves at the target, however - On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding + On , summons a duplicate ring around the targeted enemy, which slowly converges before exploding ''' } @@ -485,7 +485,7 @@ IgneousExaltation: { Tooltip: ''' Summons an Igneous blade that orbits around you - Right click to launch all blades towards the cursor + to launch all blades towards the cursor ''' } @@ -591,7 +591,7 @@ Perdition: { ''' {$CommonItemTooltip.Sentry} Summons a beacon at the position of the mouse - When a target is manually selected via right click it releases torrents of souls from below onto the target + When a target is manually selected via it releases torrents of souls from below onto the target Requires one sentry slot to summon, and only one beacon may exist at a time ''' } @@ -866,7 +866,7 @@ VoidConcentrationStaff: { Minion damage is increased by 5% while the aura is active Requires three minion slots to use There can only be one aura at a time - Right click to launch a black hole that grows in size + to launch a black hole that grows in size ''' } @@ -893,7 +893,7 @@ WulfrumController: { Tooltip: ''' Summons a wulfrum droid to fight for you - Hold right click while holding the remote to switch all of your drones into supercharge mode + Hold while holding the remote to switch all of your drones between regular and supercharge mode Supercharged droids will stop attacking and focus wulfrum energy onto you Supercharged droids provide +0.5 HP/s life regen and 3 defense per droid Can also be used to heal other players by keeping your mouse cursor close enough to them diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index c9f645fdee..9e19bfe3cc 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -3,14 +3,11 @@ RecipeGroup: { HardmodeAnvil: "{$LegacyMisc.37} Hardmode Anvil" HardmodeForge: "{$LegacyMisc.37} Hardmode Forge" - AnyLargeGem: "{$LegacyMisc.37} Large Gem" AnyFood: "{$LegacyMisc.37} Food Item" AnyEvilBar: "{$LegacyMisc.37} Evil Bar" - AnyEvilPowder: "{$LegacyMisc.37} Evil Powder" Boss2Material: Shadow Scale or Tissue Sample CursedFlameIchor: Cursed Flame or Ichor AnyEvilWater: "{$LegacyMisc.37} Evil Water" - AnyEvilFlask: "{$LegacyMisc.37} Evil Flask" AnyEvilBlock: "{$LegacyMisc.37} Evil Block" AnyGoodBlock: "{$LegacyMisc.37} Good Block" LunarPickaxe: "{$LegacyMisc.37} Lunar Pickaxe" @@ -43,7 +40,7 @@ Tier3KnowledgeTooltip: The Jungle schematic must be deciphered first Tier4KnowledgeTooltip: The Underworld schematic must be deciphered first Tier5KnowledgeTooltip: The Ice biome schematic must be deciphered first // Other CombatText uses and Item Messages -ShiftToExpand: Hold SHIFT to see an expanded description +ShiftToExpand: Hold Shift to see an expanded description LearnedSchematic: You learned how to create new things! CragmawVibeCheck: Vibe check. AutocannonHot: OUCH! HOT! diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 125f690431..96f1f31200 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -147,7 +147,6 @@ AeroSlime.DisplayName: Aero Slime ArmoredDiggerHead.DisplayName: Armored Digger MechanizedSerpent: Mechanized Serpent AuroraSpirit.DisplayName: Aurora Spirit -BloodlettingServant.DisplayName: Bloodletting Servant BloomSlime.DisplayName: Bloom Slime Bohldohr.DisplayName: Bohldohr BucketZombie.DisplayName: "{$NPCName.Zombie}" @@ -168,7 +167,6 @@ CryoSlime.DisplayName: Cryo Slime EbonianBlightSlime.DisplayName: Ebonian Blight Slime Eidolist.DisplayName: Eidolist FearlessGoldfishWarrior.DisplayName: Fearless Goldfish Warrior -Foveanator.DisplayName: Foveanator Frogfish.DisplayName: Frogfish Horse.DisplayName: Earth Elemental IceClasper.DisplayName: Ice Clasper @@ -189,7 +187,6 @@ Rotdog.DisplayName: Rotdog ScornEater.DisplayName: Scorn Eater ShockstormShuttle.DisplayName: Shockstorm Shuttle Shroomble.DisplayName: Shroomble -SkeletronPrime2.DisplayName: Skeletron Prime Stormlion.DisplayName: Stormlion StormlionSentry.DisplayName: Stormlion Sentry Sunskater.DisplayName: Sunskater diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index 7947c1ccf2..d633004aa0 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -63,10 +63,9 @@ FlareBomb.DisplayName: Flare Bomb FlareDust.DisplayName: Flare Dust FlareDust2.DisplayName: Flare Bomb Flarenado.DisplayName: Flarenado -FoveanatorEnergyBomb.DisplayName: Nebulous Energy Bomb -FoveanatorLaser.DisplayName: Nebulous Laser -FoveanatorFlamethrower.DisplayName: Nebulous Flames 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.Healing.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson index dfd1dd43af..e8077f1f00 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson @@ -1,5 +1,6 @@ AbsorberAura.DisplayName: Absorber Aura AltTransfusionTrail.DisplayName: Alt Transfusion Trail +BloodstoneHealOrb.DisplayName: Bloodstone Heal Orb BlueJellyAura.DisplayName: Blue Jelly Aura BurntSiennaProj.DisplayName: Sienna CactusHealOrb.DisplayName: Heal @@ -13,9 +14,6 @@ HydrothermicHealOrb.DisplayName: Hydrothermic Rejuvenation ManaPolarizerHealOrb.DisplayName: Mana Polarizer Heal Orb PhantomicHeart.DisplayName: Phantomic Heart PinkJellyAura.DisplayName: Pink Jelly Aura -ReaverHealOrb.DisplayName: Reaver Heal Orb RoyalHeal.DisplayName: Heal ShinobiHealOrb.DisplayName: Blue Healing Orb -SilvaOrb.DisplayName: Silva Orb TransfusionTrail.DisplayName: Heal -BloodstoneHealOrb.DisplayName: Bloodstone Heal Orb diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 53e09e1f92..3287796a91 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -306,3 +306,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 a72179f460..9dc5d84ee5 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -8,7 +8,10 @@ AnomalysNanogunHoldout.DisplayName: The Anomaly's Nanogun AnomalysNanogunMPFBBoom.DisplayName: MPFB Explosion AnomalysNanogunMPFBDevastator.DisplayName: MPFB Devastator AnomalysNanogunPlasmaBeam.DisplayName: Plasma Beam -GatlingLaserShot.DisplayName: Gatling Laser +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 GaussPistolShot.DisplayName: Gauss Shot @@ -46,6 +49,8 @@ SystemBaneProjectile.DisplayName: System Bane TeslaCannonShot.DisplayName: Tesla Beam UnstableMatter.DisplayName: Unstable Matter VoltageStream.DisplayName: Voltage Stream +VulcanProjectile.DisplayName: Vulcan Shot +VulcanSpear.DisplayName: Vulcanite Lance WavePounderBoom.DisplayName: Explosion WavePounderProjectile.DisplayName: Wave Pounder // Environmental diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 5533381a9d..c6be216f3d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -206,6 +206,7 @@ SicknessRound2.DisplayName: Round SlagRound.DisplayName: Slag Round SlimeBolt.DisplayName: Slime Bolt SparkSpreaderFire.DisplayName: Sparked Flames +SpectralFlare.DisplayName: Spectral Flare SpeedBlasterShot.DisplayName: Splatter Shot SporeBomb.DisplayName: Spore Bomb SproutingArrowMain.DisplayName: Sprouting Arrow diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 5328e2d17b..652d0084ee 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -158,6 +158,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..b9a0d86656 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -146,6 +146,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 474e9bf5e0..5b5cae9452 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson @@ -3,9 +3,6 @@ SlimeGodRun: The Slime God flees to fight another day... // Cryogen CryogenBossText: Cryogen is derping out! PyrogenBossText: Pyrogen is derping out! -// Triplets -TripletsBossText: The Triplets have awoken! -TripletsDefeatName: The Triplets // Calamitas Clone CalamitasBossText: You underestimate my power... CalamitasBossText2: Rise again, my siblings. @@ -16,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.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index 60f47f43c5..693d421595 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -61,6 +61,7 @@ Dragonfire4: This was a fight {0} could not win. ElementalMix1: "{0} was reduced to technicolor confetti." ElementalMix2: "{0} was blasted apart by a harmonized elemental onslaught." ElementalMix3: "{0} was overwhelmed by elemental turbulence." +FlareGunOverheat: "{0}'s gun was simply too hot to handle." GodSlayerInferno1: "{0} imploded into nothingness." GodSlayerInferno2: "{0}'s body slipped into oblivion." GodSlayerInferno3: "{0} ceased being a part of our universe." 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 a3db5b2517..c18834ec19 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -12,13 +12,13 @@ Charge: Current Charge DefenseDamage: Defense Damage SulphurousWater: Sulphuric Poisoning Stealth: Stealth -StealthShiftText: Hold SHIFT for more information on Rogue stealth +StealthShiftText: Hold Shift for more information on Rogue stealth StealthInfoText: ''' Rogue stealth builds while not attacking and slower while moving Once you have built max stealth, you will be able to perform a Stealth Strike Rogue stealth only reduces when you attack, it does not reduce while moving - The higher your rogue stealth the higher your rogue damage and crit + The higher your rogue stealth the higher your rogue damage Having more stealth regeneration slightly decreases the damage bonus from stealth This is offset by you being able to use stealth strikes far more often ''' @@ -27,15 +27,31 @@ DifficultyStatusText: "{0} is {1}." ModeAppend: "{0} Mode" Active: Active NotActive: Not active -DifficultyShiftText: "[c/737373:Hold the 'Shift' key for more information]" +DifficultyShiftText: "[c/737373:Hold Shift for more information]" CurrentlySelected: Currently Selected : {0} 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!]" -NoDifficulty: None -NoDifficultyInfo: The classic Terraria experience, with no Calamity difficulty changes +DifficultySwitch: Difficulty changed from [c/{0}:{1}] to [c/{2}:{3}]. +ClassicInfo: Your Adventure Begins... A far more relaxed Terraria experience +ExpertShortInfo: "[c/FFBA75:Fortune & Glory, Kid. For those looking for a more difficult vanilla experience]" +ExpertExpandedInfo: + ''' + [c/A87A07:Most bosses gain new attacks and more difficult attack patterns] + [c/A87A07:Most enemies have twice as much health, deal twice as much damage and receive 10% less knockback] + [c/A87A07:Certain enemies have new attacks, can inflict new debuffs or have a higher chance of inflicting debuffs they already had] + [c/A87A07:Enemies drop more loot, as well as having higher chances] + [c/A87A07:Players drop more of their coins on death] + ''' +MasterShortInfo: "[c/1CFFAA:Game over man, game over! A tougher step up in stats from Expert Mode]" +MasterExpandedInfo: + ''' + [c/029C6D:Most enemies have even more health and knockback resistance added on from Expert Mode] + [c/029C6D:Bosses have new exclusive vanity rewards] + [c/029C6D:Players drop ALL their coins on death] + [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: ''' @@ -47,21 +63,17 @@ RevengeanceExpandedInfo: [c/B55362:Bosses have new AI mechanics, new phases, and will drop Master Mode loot. Enemies spawn more frequently] [c/F7342A:This mode is more difficult than Expert. Be sure to prepare for the challenge] ''' -RevengeanceActivate: Revengeance is active. -RevengeanceDeactivate: Revengeance is not active. Death: Death -DeathLegend: Death+Legend -DeathEnabled: Death Mode is enabled -DeathShortInfo: "[c/C82DF7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]" +DeathShortInfo: "[c/E066F7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]" DeathExpandedInfo: ''' - [c/B834E0:All foes will pose a much larger threat with highly aggressive AIs and increased damage] + [c/B834E0:All foes will pose a much larger threat with highly aggressive AIs] [c/B834E0:Bosses have substantially harder AI changes. Enemies are even more numerous and can easily overwhelm you] [c/B834E0:Debuffs are especially lethal and the Abyss is significantly more dangerous] [c/E945FF:Vigilance and tenacity are crucial to survival] ''' -DeathActivate: Death is active; enjoy the fun. -DeathDeactivate: Death is not active; not fun enough for you? +// Legendary (FTW + Master) + Death Mode +Malice: Malice // Calamity Health Bar ExoTwinsNameNormal: XS-01 Artemis and XS-03 Apollo ExoTwinsNameHekate: Eyes of XB-∞ Hekate @@ -86,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 @@ -117,7 +131,7 @@ Cooldowns: { PrismaticLaser: Prismatic Laser Barrage Cooldown ProfanedSoulShieldDurability: Profaned Soul Shield Durability ProfanedSoulShieldRecharge: Profaned Soul Shield Recharge - RaiderBoost: Extra Critical Chance + RaidersBoost: Extra Critical Chance RelicOfResilienceCooldown: Relic of Resilience Cooldown RogueBooster: Rogue Booster Cooldown SandCloak: Sand Cloak Cooldown @@ -133,6 +147,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 @@ -148,7 +163,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. @@ -207,13 +222,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 @@ -225,7 +240,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 @@ -640,8 +655,8 @@ SulphurSea2: Irradiating one of the oceans Roxcalibur: I wanna rock AuricLandMines: Setting god killing traps // Hold Shift tooltip default -HoldShiftTooltipExtensionIndicator: Hold "Left Shift" for more -HoldShiftTooltipReplacementIndicator: Hold "Left Shift" for details +HoldShiftTooltipExtensionIndicator: Hold Shift for more +HoldShiftTooltipReplacementIndicator: Hold Shift for details // Dev and Donor Items DevItemTooltip: - Dev Item - DonorItemTooltip: - Donor Item - diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 718270c4af..30f140caee 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -28,7 +28,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 @@ -39,7 +39,7 @@ SetBonus: { ''' Multiplies all cold-based debuff damage by 1.25x Cold enemies will deal reduced contact damage to the player - Provides immunity to the Chilled, Frozen, Frostburn and Glacial State debuffs + Provides immunity to the Chilled, Frozen, and Frostburn debuffs ''' Rain: ''' @@ -49,7 +49,7 @@ SetBonus: { ''' Forbidden: ''' - {$LegacyTooltip.48} {$ArmorSetBonus.Forbidden} + {$LegacyTooltip.48} {0} to call an ancient storm to the cursor location Minions no longer deal less damage while wielding magic weapons ''' Frost: @@ -60,27 +60,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 +117,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 eb9bbf4fc6..e5377d757e 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: ''' @@ -27,7 +28,7 @@ AddedTooltip: { This grants +1.5 HP/s life regen and accelerates natural life regen Life drain stacks based on the number of enemies being hit ''' - WarmthPotion: Greatly reduces the duration of Chilled, Frozen, and Glacial State + WarmthPotion: Greatly reduces the duration of Chilled and Frozen HandWarmer: Provides a regeneration boost while wearing the Snow armor GoldenFishingRod: Its fishing line will never break // Step Stool @@ -46,7 +47,7 @@ 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 @@ -59,29 +60,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 +77,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 +96,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 +136,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: @@ -198,13 +163,12 @@ EditedTooltip: { // Soaring Insignia EmpressFlightBooster1: Increases wing flight time by 33% EmpressFlightBooster2: Increases movement and jump speed by 10% and acceleration by 1.25x - RifleScope1: Increase view range for guns (Right click to zoom out) + RifleScope1: Increase view range for guns ( to zoom out) RifleScope2: The scope effect can be toggled with visibility SniperScope: 12% increased ranged critical strike chance MagicQuiver: Increases arrow damage by 5% and greatly increases arrow speed MoltenQuiver1: Increases arrow damage by 7% and greatly increases arrow speed MoltenQuiver2: Lights wooden arrows ablaze and all arrows inflict Hellfire - MagicPowerPotion: 10% increased magic damage MagicHat: 6% increased magic critical strike chance PowerGlove: 10% increased melee speed, does not stack with downgrades BerserkerGlove: 10% increased true melee damage @@ -284,8 +248,8 @@ EditedTooltip: { Provides 32% increased jump speed and increased fall speed Provides a gravitational boost jump, which recharges whenever gravity is flipped Slightly improves wingless air movement speed - Press UP to change gravity - Press DOWN to fall faster + Press {$Key.UP} to change gravity + Press {$Key.DOWN} to fall faster ''' } @@ -295,7 +259,8 @@ BuffDescription: { 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 - WarmthExtra: Reduced durations of Chilled, Frozen, and Glacial State + Rabies: Decreased life regen, Causes status effects + WarmthExtra: Reduced durations of Chilled and Frozen WeaponImbueConfetti: All attacks cause confetti to appear WeaponImbueCursedFlames: Melee, Whip, and Rogue attacks inflict enemies with cursed flames WeaponImbueFire: Melee, Whip, and Rogue attacks set enemies on fire diff --git a/ModSupport/ExternalMods.cs b/ModSupport/ExternalMods.cs index 7518e201c1..f69d8d110d 100644 --- a/ModSupport/ExternalMods.cs +++ b/ModSupport/ExternalMods.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Terraria.ID; -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod { @@ -31,6 +25,7 @@ namespace CalamityMod internal static Mod magicStorage = null; internal static Mod overhaul = null; internal static Mod redemption = null; + internal static Mod remnants = null; internal static Mod soa = null; internal static Mod subworldLibrary = null; internal static Mod summonersAssociation = null; @@ -67,6 +62,8 @@ namespace CalamityMod ModLoader.TryGetMod("TerrariaOverhaul", out overhaul); redemption = null; ModLoader.TryGetMod("Redemption", out redemption); + remnants = null; + ModLoader.TryGetMod("Remnants", out remnants); soa = null; ModLoader.TryGetMod("SacredTools", out soa); subworldLibrary = null; @@ -97,6 +94,7 @@ namespace CalamityMod magicStorage = null; overhaul = null; redemption = null; + remnants = null; soa = null; subworldLibrary = null; summonersAssociation = null; diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index d2a470b2a4..9d2985bac3 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -671,12 +671,6 @@ namespace CalamityMod p.Calamity().externalAbyssLight += add; } - public static void AddBreathLossMult(Player p, float add) - { - if (p != null) - p.Calamity().externalBreathLossMultBoost += add; - } - public static void AddBreathTick(Player p, float add) { if (p != null) @@ -875,43 +869,45 @@ namespace CalamityMod #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; @@ -921,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 @@ -1037,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; @@ -1231,21 +1229,6 @@ namespace CalamityMod AddAbyssLightStrength(castPlayer(args[1]), light); return null; - case "BreathMult": - case "BreathLossMult": - case "AddBreathMult": - case "AddBreathLossMult": - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify both a Player object (or int index of a Player) and breath loss mult change as a float."); - if (args.Length < 3) - return new ArgumentNullException("ERROR: Must specify breath loss mult change as a float."); - if (!(args[2] is float breathLossMult)) - return new ArgumentException("ERROR: The second argument to \"AddBreathLossMult\" must be a float."); - if (!isValidPlayerArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"AddBreathLossMult\" must be a Player or an int."); - AddBreathLossMult(castPlayer(args[1]), breathLossMult); - return null; - case "BreathTick": case "AbyssBreathTick": case "AddBreathTick": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 65c8470dcf..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; @@ -460,9 +451,11 @@ namespace CalamityMod string entryName = "HiveMind"; BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); + Func IsCorruption = () => !WorldGen.crimson || Main.drunkWorld; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; AddBoss(bossChecklist, calamity, entryName, order, DownedHiveMind, type, new Dictionary() { + ["availability"] = IsCorruption, ["spawnInfo"] = GetSpawnInfo(entryName), ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), @@ -476,9 +469,11 @@ namespace CalamityMod string entryName = "Perforators"; BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); + Func IsCrimson = () => WorldGen.crimson || Main.drunkWorld; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; AddBoss(bossChecklist, calamity, entryName, order, DownedPerforators, type, new Dictionary() { + ["availability"] = IsCrimson, ["displayName"] = GetDisplayName(entryName), ["spawnInfo"] = GetSpawnInfo(entryName), ["despawnMessage"] = GetDespawnMessage(entryName), @@ -563,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/BabyCannonballJellyfish.cs b/NPCs/Abyss/BabyCannonballJellyfish.cs index 43e00656d4..2383bb5224 100644 --- a/NPCs/Abyss/BabyCannonballJellyfish.cs +++ b/NPCs/Abyss/BabyCannonballJellyfish.cs @@ -53,10 +53,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 002ff2ebce..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; @@ -42,10 +42,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index b9218ec8df..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; @@ -52,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index fb20344f3a..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; @@ -44,10 +44,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index ce1ea981bd..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; @@ -55,10 +55,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) 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 2b7e4564fa..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; @@ -56,10 +55,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToWater = false; NPC.Calamity().canBreakPlayerDefense = true; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 3dde3202c5..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; @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index ab478d5acd..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; @@ -65,10 +64,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -109,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 f1be9b6e3a..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; @@ -55,10 +54,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -91,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/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index 02450d05e6..46268d84d5 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Abyss NPC.dontCountMe = true; NPC.dontTakeDamage = true; NPC.chaseable = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index bb6bcfa664..d63b9dd8ff 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Abyss NPC.dontCountMe = true; NPC.dontTakeDamage = true; NPC.chaseable = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 3ad3252016..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; @@ -79,10 +78,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index dba229a146..2b126c6a68 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Abyss NPC.dontCountMe = true; NPC.dontTakeDamage = true; NPC.chaseable = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 3a5ae03dcf..6dc686e1a9 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -2,6 +2,8 @@ using System.IO; using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -42,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; @@ -52,10 +54,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -258,6 +256,7 @@ namespace CalamityMod.NPCs.Abyss { var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Blindfold, 100, 50)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 5)); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 2, 4, 3, 6)); } diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index d8366f56db..959a7d3fd5 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 8ffd9061fa..c09437ce55 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 5c3bad9db5..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; @@ -70,10 +69,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index faae8d5302..0e4baffc0c 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 04906775dd..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; @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index 6b95e594c6..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; @@ -59,10 +59,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 5147891755..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; @@ -61,10 +61,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 4cbaa373e4..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; @@ -49,10 +49,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index b110c6b019..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; @@ -41,10 +41,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 9d36a1bf4c..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; @@ -61,10 +61,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index e18c3657b6..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; @@ -41,10 +41,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index 6fb205d54a..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; @@ -70,10 +70,6 @@ namespace CalamityMod.NPCs.Abyss if (Main.zenithWorld) // legg NPC.height = (int)(NPC.height * 1.5f); - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -650,7 +646,7 @@ namespace CalamityMod.NPCs.Abyss { Vector2 direction = shorkCenter - player.Center; direction.Normalize(); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction * 10f, ProjectileID.DemonSickle, NPC.damage / 2, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction * 10f, ProjectileID.DemonSickle, 80, 0f, Main.myPlayer); } } } diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index b85836d81a..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; @@ -77,10 +77,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToWater = false; NPC.GravityIgnoresLiquid = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 5f54401431..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; @@ -58,10 +58,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 8e5d0c06e6..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; @@ -58,10 +58,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index feba4c4c47..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; @@ -85,10 +84,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -103,9 +98,6 @@ namespace CalamityMod.NPCs.AcidRain { NPC.TargetClosest(false); - // Fall through platforms. - NPC.Calamity().ShouldFallThroughPlatforms = true; - // Play a slither sound from time to time. if (Main.rand.NextBool(480)) SoundEngine.PlaySound(SoundID.Zombie32, NPC.Center); @@ -169,6 +161,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.velocity.X = (NPC.velocity.X * 24f + NPC.direction * swimSpeed) / 25f; } + public override bool? CanFallThroughPlatforms() => true; + public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2, 1, 3); 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 c9505ec7fe..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; @@ -60,10 +59,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index a901b64e48..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; @@ -64,10 +63,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 4a47bcbc42..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; @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) 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 5f50419754..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; @@ -90,10 +90,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index ef3fd1d1f3..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; @@ -71,10 +69,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 2aaa69c5f4..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; @@ -58,10 +58,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index a1cf912c4f..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; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index 759e49aa4e..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; @@ -73,10 +73,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) => writer.Write(Flying); @@ -103,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); @@ -161,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 f85ec39507..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; @@ -62,10 +61,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index c7a580569b..7aa490d3a3 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -27,10 +27,12 @@ namespace CalamityMod.NPCs.AquaticScourge this.HideFromBestiary(); } + public static int ToothDamage = 25; // 100 + public override void SetDefaults() { + NPC.damage = 52; // 104 NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); NPC.width = 32; NPC.height = 32; NPC.defense = 20; @@ -40,7 +42,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; @@ -51,25 +53,20 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.dontCountMe = true; NPC.chaseable = false; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -94,22 +91,22 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool getFuckedAI = Main.zenithWorld; // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || Main.getGoodWorld) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { 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; @@ -152,11 +149,11 @@ namespace CalamityMod.NPCs.AquaticScourge (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); } - bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush; - float enrageScale = bossRush ? 1f : 0f; + bool biomeEnraged = NPC.localAI[2] <= 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -168,7 +165,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Fire teeth @@ -191,9 +187,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; @@ -241,7 +236,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; } } @@ -264,7 +259,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 = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -282,7 +277,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) scourgeMaxSpeed *= 1.15f; } @@ -320,21 +315,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) @@ -384,7 +364,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 66ec3f5969..f67f835fed 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,7 +40,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; @@ -50,25 +51,20 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.dontCountMe = true; NPC.chaseable = false; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -93,22 +89,22 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool getFuckedAI = Main.zenithWorld; // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || Main.getGoodWorld) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { 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; @@ -151,11 +147,11 @@ namespace CalamityMod.NPCs.AquaticScourge (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); } - bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush; - float enrageScale = bossRush ? 1f : 0f; + bool biomeEnraged = NPC.localAI[2] <= 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -167,7 +163,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Kill body and tail @@ -210,7 +205,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; } } @@ -233,7 +228,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 = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -251,7 +246,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) scourgeMaxSpeed *= 1.15f; } @@ -289,21 +284,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) @@ -353,7 +333,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 bb2ce5cee8..b5d285e677 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,10 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.aiStyle = -1; AIType = -1; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + 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; @@ -77,16 +80,14 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -94,9 +95,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -134,23 +132,23 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool getFuckedAI = Main.zenithWorld; CalamityGlobalNPC.aquaticScourge = NPC.whoAmI; // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || Main.getGoodWorld) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { 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; @@ -193,7 +191,7 @@ namespace CalamityMod.NPCs.AquaticScourge } // Enrage - if (notOcean && !player.Calamity().ZoneSulphur && !bossRush) + if (notOcean && !player.Calamity().ZoneSulphur && !BossRushEvent.BossRushActive) { if (NPC.localAI[2] > 0f) NPC.localAI[2] -= 1f; @@ -201,12 +199,12 @@ namespace CalamityMod.NPCs.AquaticScourge else NPC.localAI[2] = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush; + bool biomeEnraged = NPC.localAI[2] <= 0f; - float enrageScale = bossRush ? 1f : 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -225,7 +223,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.localAI[3] = colorFadeTimeAfterSpiral; // Vomit acid mist - float acidMistBarfDivisor = getFuckedAI ? 2f : ((float)Math.Floor(bossRush ? 4f : death ? 5f : 6f) * (phase3 ? 1.5f : 1f)); + float acidMistBarfDivisor = getFuckedAI ? 2f : ((float)Math.Floor(death ? 5f : 6f) * (phase3 ? 1.5f : 1f)); if (calamityGlobalNPC.newAI[3] % acidMistBarfDivisor == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) @@ -233,21 +231,19 @@ 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; } } // Vomit circular spreads of acid clouds while in phase 3 - float toxicCloudBarfDivisor = bossRush ? 20f : death ? 30f : 40f; + float toxicCloudBarfDivisor = death ? 30f : 40f; if (calamityGlobalNPC.newAI[3] % toxicCloudBarfDivisor == 0f && phase3) { 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; @@ -255,7 +251,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); } } } @@ -306,7 +302,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Spawn segments @@ -355,12 +350,11 @@ namespace CalamityMod.NPCs.AquaticScourge if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 10 : expertMode ? 8 : 6; + int totalProjectiles = expertMode ? 8 : 6; if (phase3) 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)); @@ -371,7 +365,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); } } } @@ -396,7 +390,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; } } @@ -416,7 +410,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 = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -449,7 +443,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeAcceleration *= accelerationMultiplier; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { scourgeMaxSpeed *= 1.15f; scourgeAcceleration *= 1.15f; @@ -578,20 +572,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) @@ -665,13 +645,13 @@ namespace CalamityMod.NPCs.AquaticScourge if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water) { if (!NPC.AnyNPCs(ModContent.NPCType())) - return (Main.getGoodWorld ? 0.05f : 0.01f); + return (CalamityWorld.LegendaryMode ? 0.05f : 0.01f); } return 0f; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -763,7 +743,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 75cdc27014..1a2c8de69e 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,7 +37,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; @@ -48,25 +48,20 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.dontCountMe = true; NPC.chaseable = false; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -91,22 +86,22 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool getFuckedAI = Main.zenithWorld; // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || Main.getGoodWorld) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { 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; @@ -149,11 +144,11 @@ namespace CalamityMod.NPCs.AquaticScourge (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); } - bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush; - float enrageScale = bossRush ? 1f : 0f; + bool biomeEnraged = NPC.localAI[2] <= 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -165,7 +160,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Kill body and tail @@ -208,7 +202,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; } } @@ -231,7 +225,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 = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -249,7 +243,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) scourgeMaxSpeed *= 1.15f; } @@ -287,21 +281,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) @@ -351,7 +330,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) @@ -377,7 +355,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 5dfecc0272..070908c158 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -33,28 +33,23 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Astraglomerate.cs b/NPCs/Astral/Astraglomerate.cs index 0be0820f7c..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; @@ -58,10 +57,6 @@ namespace CalamityMod.NPCs.Astral { NPC.scale = 3f; } - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 741efed4a0..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,17 +50,13 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 20af8be840..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,16 +39,12 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 13373f41c5..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,16 +45,12 @@ 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; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 9cf146f5d7..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,16 +53,12 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 363ff9bb8b..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; @@ -154,10 +153,6 @@ namespace CalamityMod.NPCs.Astral NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index f9373dd5c2..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,17 +69,13 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 65; - NPC.defense = 22; + NPC.defense = 38; NPC.knockBackResist = 0.7f; NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public static bool ValidMovementPosition(Tile tile) @@ -315,6 +310,7 @@ namespace CalamityMod.NPCs.Astral { npcLoot.Add(ItemID.SharkFin, 8); npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 2, 3, 3, 4)); + npcLoot.Add(ItemID.Nachos, 30); } } } diff --git a/NPCs/Astral/Glomerling.cs b/NPCs/Astral/Glomerling.cs index ccbe4388c2..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,15 +50,11 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 76e15717a4..c6c1c6c104 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -42,28 +42,23 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 07658108a6..3910718d16 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -38,33 +38,27 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 31482df041..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) { @@ -82,10 +81,6 @@ namespace CalamityMod.NPCs.Astral NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index 3689d48278..ae8b05b1fb 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -40,30 +40,25 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 7163f98338..17ac78ee83 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -42,30 +42,25 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index f8ed4ceff0..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,17 +53,13 @@ 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; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 4e84d6c3b8..84f9759b5c 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -88,35 +88,35 @@ 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; NPC.defense = 40; - NPC.DR_NERD(0.4f); - NPC.LifeMaxNERB(120000, 140000, 740000); // 30 seconds in boss rush + NPC.DR_NERD(0.1f); + NPC.LifeMaxNERB(100000, 120000, 740000); // 30 seconds in boss rush 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; if (Main.zenithWorld) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -158,10 +158,9 @@ namespace CalamityMod.NPCs.AstrumAureus CalamityGlobalNPC.astrumAureus = NPC.whoAmI; // Variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -174,8 +173,6 @@ namespace CalamityMod.NPCs.AstrumAureus // Exhaustion bool exhausted = NPC.ai[2] >= (phase3 ? 2f : 1f); - calamityGlobalNPC.DR = exhausted ? 0.2f : 0.4f; - NPC.defense = exhausted ? NPC.defDefense / 2 : NPC.defDefense; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -198,26 +195,18 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.localAI[3] -= death ? 4f : expertMode ? 2f : 1f; } - float enrageScale = bossRush ? 1f : 0f; - if ((Main.IsItDay() && !player.Calamity().ZoneAstral) || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - 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; + float walkingVelocity = CalamityWorld.MaliceMode ? 6f : 5f; if (phase5) walkingVelocity += 2f; if (expertMode) walkingVelocity += 1.5f * (1f - lifeRatio); if (revenge) walkingVelocity += Math.Abs(NPC.Center.X - player.Center.X) * 0.0025f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) walkingVelocity *= 1.15f; float walkingProjectileVelocity = walkingVelocity * 0.8f; @@ -279,15 +268,14 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6; + int totalProjectiles = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 10f; Vector2 spinningPoint = new Vector2(0f, -velocity); 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; @@ -297,7 +285,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; @@ -305,11 +292,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; @@ -348,12 +335,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); } } } @@ -374,17 +360,16 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { - int maxProjectiles = !phase2 ? (bossRush ? 5 : 3) : (bossRush ? 7 : 5); - int spread = !phase2 ? (bossRush ? 11 : 8) : (bossRush ? 12 : 10); + int maxProjectiles = !phase2 ? 3 : 5; + 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) @@ -394,13 +379,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); } } } @@ -411,11 +395,10 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { - int maxProjectiles = !phase3 ? (bossRush ? 13 : death ? 11 : 9) : (bossRush ? 19 : death ? 17 : 15); - int spread = !phase3 ? (bossRush ? 20 : death ? 18 : 16) : (bossRush ? 24 : death ? 22 : 20); + int maxProjectiles = !phase3 ? (death ? 11 : 9) : (death ? 17 : 15); + 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; @@ -425,7 +408,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); } } } @@ -461,7 +444,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (NPC.Distance(player.Center) < 240f) NPC.ai[1] += death ? 4f : expertMode ? 2f : 1f; - if (NPC.ai[1] >= 180f || bossRush) + if (NPC.ai[1] >= 180f) { // Set AI to random state and reset other AI arrays NPC.TargetClosest(); @@ -573,7 +556,7 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.ai[1] += death ? 4f : expertMode ? 2f : 1f; } - if (NPC.ai[1] >= ((bossRush ? 270f : 360f) - (death ? 90f * (1f - lifeRatio) : 0f))) + if (NPC.ai[1] >= (360f - (death ? 90f * (1f - lifeRatio) : 0f))) { // Collide with tiles again NPC.noTileCollide = false; @@ -649,11 +632,10 @@ namespace CalamityMod.NPCs.AstrumAureus calamityGlobalNPC.newAI[1] = speedMultLimit; } - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 27f : 20f; - velocity += 6f * enrageScale; + float velocity = CalamityWorld.MaliceMode ? 27f : 20f; if (expertMode) velocity += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) velocity *= 1.15f; NPC.velocity = (new Vector2(player.Center.X, player.Center.Y - 500f) - NPC.Center).SafeNormalize(Vector2.Zero) * velocity; @@ -737,9 +719,10 @@ namespace CalamityMod.NPCs.AstrumAureus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6; + 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; Vector2 spinningPoint = new Vector2(0f, -velocity); @@ -757,11 +740,10 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { float flameVelocity = 6f; - int maxProjectiles = bossRush ? 4 : death ? 3 : 2; - int spread = bossRush ? 36 : death ? 28 : 20; + int maxProjectiles = death ? 3 : 2; + 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; @@ -769,7 +751,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); } } } @@ -779,12 +761,11 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 7f : death ? 6f : 5f; - int maxProjectiles = !phase3 ? (bossRush ? 13 : death ? 11 : 9) : (bossRush ? 17 : death ? 15 : 13); - int spread = !phase3 ? (bossRush ? 20 : death ? 18 : 16) : (bossRush ? 24 : death ? 22 : 20); + float laserVelocity = CalamityWorld.MaliceMode ? 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); @@ -793,7 +774,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); } } } @@ -829,10 +810,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 (CalamityWorld.MaliceMode) fallSpeed += 0.5f; if (calamityGlobalNPC.newAI[1] > 0f) @@ -845,7 +825,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; @@ -856,10 +835,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 (CalamityWorld.MaliceMode) velocityXCap += 5f; if (calamityGlobalNPC.newAI[0] > 0f) @@ -908,7 +886,7 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.localAI[2] += 1.25f; } - if (NPC.localAI[1] >= (bossRush ? 60f : death ? 180f : 240f)) + if (NPC.localAI[1] >= (death ? 180f : 240f)) { // Reset localAI and find a teleport destination NPC.TargetClosest(); @@ -1066,13 +1044,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 (Main.getGoodWorld && !reduceFallSpeed) + if (CalamityWorld.LegendaryMode && !reduceFallSpeed) { gravity *= 1.15f; maxFallSpeed *= 1.15f; @@ -1083,6 +1061,7 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.velocity.Y = maxFallSpeed; } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override void FindFrame(int frameHeight) { @@ -1300,7 +1279,7 @@ namespace CalamityMod.NPCs.AstrumAureus return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -1439,7 +1418,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 3daa83d2c7..c0d00b5ab8 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 && CalamityWorld.revenge) ? 36 : (3 + (int)((NPC.scale - 1f) * 3)); + int totalProjectiles = CalamityWorld.LegendaryMode ? 36 : (3 + (int)((NPC.scale - 1f) * 3)); double radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage2 = NPC.GetProjectileDamage(type); - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10f : 6f; + float velocity = CalamityWorld.LegendaryMode ? 10f : 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 53a82bf6cd..81a730c44c 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; @@ -67,9 +71,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.5f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.4f; else if (CalamityWorld.revenge) NPC.scale *= 1.35f; @@ -87,9 +89,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.dontCountMe = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -118,22 +117,16 @@ namespace CalamityMod.NPCs.AstrumDeus CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); // Difficulty variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - float enrageScale = bossRush ? 0.5f : 0f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1.5f; - } + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // 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) @@ -174,7 +167,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -195,12 +188,10 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.MaliceMode) gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); if (gfbWormCount > gfbMaxWormCount) gfbWormCount = gfbMaxWormCount; - if (gfbWormCount > 0) - enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; // Copy dontTakeDamage and Opacity from head NPC.dontTakeDamage = Main.npc[(int)NPC.ai[2]].dontTakeDamage; @@ -262,7 +253,8 @@ namespace CalamityMod.NPCs.AstrumDeus float segmentVelocityBoost = 5f * (1f - lifeRatio); segmentVelocity += segmentVelocityBoost; - segmentVelocity += 4f * enrageScale; + if (gfbWormCount > 0) + segmentVelocity += (gfbMaxWormCount - gfbWormCount) * 0.444f; if (revenge) { @@ -303,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); } } @@ -313,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; @@ -329,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); @@ -369,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); } } } @@ -425,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) @@ -457,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 = Main.getGoodWorld ? 300f : 600f; + float cyanThreshold = CalamityWorld.LegendaryMode ? 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; @@ -586,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 f590b2477c..04ca13ca77 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; @@ -89,9 +89,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.5f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.4f; else if (CalamityWorld.revenge) NPC.scale *= 1.35f; @@ -100,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; @@ -119,9 +117,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.value /= 5; } - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -152,22 +147,16 @@ namespace CalamityMod.NPCs.AstrumDeus CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); // Difficulty variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - float enrageScale = bossRush ? 0.5f : 0f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1.5f; - } + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // 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) @@ -212,7 +201,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -233,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 (CalamityWorld.MaliceMode) 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; @@ -343,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] = Main.getGoodWorld ? 300f : 600f; + Main.npc[headTwoID].Calamity().newAI[3] = CalamityWorld.LegendaryMode ? 300f : 600f; Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f; Main.npc[headTwoID].timeLeft *= 20; Main.npc[headTwoID].ForceNetUpdate(); @@ -450,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) { @@ -561,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) { @@ -580,7 +571,7 @@ namespace CalamityMod.NPCs.AstrumDeus speed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; turnSpeed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { speed *= 1.15f; turnSpeed *= 1.15f; @@ -781,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() @@ -817,7 +794,7 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = NPC.Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - float cyanThreshold = Main.getGoodWorld ? 300f : 600f; + float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; // Head is always the last segment to visually transition float transitionStart = cyanThreshold * 0.95f; bool drawCyan = NPC.Calamity().newAI[3] >= cyanThreshold; @@ -917,7 +894,7 @@ namespace CalamityMod.NPCs.AstrumDeus } } - public override void BossLoot(ref string name, ref int potionType) => potionType = ModContent.ItemType(); + public override void BossLoot(ref int potionType) => potionType = ModContent.ItemType(); public static bool ShouldNotDropThings(NPC NPC) => NPC.Calamity().newAI[0] == 0f || ((CalamityWorld.death || BossRushEvent.BossRushActive) && NPC.Calamity().newAI[0] != 3f); diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 2e12004722..db2efb9c1b 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; @@ -52,9 +52,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.5f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.4f; else if (CalamityWorld.revenge) NPC.scale *= 1.35f; @@ -72,9 +70,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.dontCountMe = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -101,22 +96,16 @@ namespace CalamityMod.NPCs.AstrumDeus CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); // Difficulty variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - float enrageScale = bossRush ? 0.5f : 0f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1.5f; - } + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // 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) @@ -157,7 +146,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -178,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 (CalamityWorld.MaliceMode) 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; @@ -245,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) { @@ -302,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) @@ -331,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 = Main.getGoodWorld ? 300f : 600f; + float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; // Tail is always the first segment to visually transition float transitionStart = cyanThreshold * 0.75f; float transitionEnd = cyanThreshold * 0.8f; @@ -425,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 478a14704b..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; @@ -93,25 +93,18 @@ namespace CalamityMod.NPCs.BrimstoneElemental } // Variables for buffing the AI - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining for Brim float lifeRatio = Main.npc[CalamityGlobalNPC.brimstoneElemental].life / (float)Main.npc[CalamityGlobalNPC.brimstoneElemental].lifeMax; // Enraged Brim checks - bool biomeEnraged = Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().newAI[3] <= 0f || bossRush; - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].ZoneUnderworldHeight || bossRush)) - { - Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().CurrentlyEnraged = !bossRush; + bool biomeEnraged = Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().newAI[3] <= 0f; + float enrageScale = 0f; + if (biomeEnraged && !Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].ZoneUnderworldHeight) enrageScale += 1f; - } - if (biomeEnraged && (!Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Calamity().ZoneCalamity || bossRush)) - { - Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().CurrentlyEnraged = !bossRush; + if (biomeEnraged && !Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Calamity().ZoneCalamity) enrageScale += 1f; - } // Brim phase checks bool brimIsAboutToTeleport = Main.npc[CalamityGlobalNPC.brimstoneElemental].ai[0] == 1f && Main.npc[CalamityGlobalNPC.brimstoneElemental].alpha == 0; @@ -153,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); } } @@ -246,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 82f36a3842..96cf8f7d05 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; @@ -88,9 +95,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -182,16 +186,15 @@ namespace CalamityMod.NPCs.BrimstoneElemental float lifeRatio = NPC.life / (float)NPC.lifeMax; // Variables for buffing the AI - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase2 = lifeRatio < 0.5f && revenge; bool phase3 = lifeRatio < 0.33f; // Enrage - if ((!player.ZoneUnderworldHeight || !player.Calamity().ZoneCalamity) && !bossRush) + if ((!player.ZoneUnderworldHeight || !player.Calamity().ZoneCalamity) && !BossRushEvent.BossRushActive) { if (calamityGlobalNPC.newAI[3] > 0f) calamityGlobalNPC.newAI[3] -= 1f; @@ -199,17 +202,17 @@ namespace CalamityMod.NPCs.BrimstoneElemental else calamityGlobalNPC.newAI[3] = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = calamityGlobalNPC.newAI[3] <= 0f || bossRush; + bool biomeEnraged = calamityGlobalNPC.newAI[3] <= 0f; - float enrageScale = bossRush ? 0.5f : 0f; - if (biomeEnraged && (!player.ZoneUnderworldHeight || bossRush)) + float enrageScale = 0f; + if (biomeEnraged && !player.ZoneUnderworldHeight) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 0.5f; } - if (biomeEnraged && (!player.Calamity().ZoneCalamity || bossRush)) + if (biomeEnraged && !player.Calamity().ZoneCalamity) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } @@ -300,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; @@ -331,17 +331,12 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Pick a location to teleport to else if (NPC.ai[0] == 0f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.chaseable = true; if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[1] += 1f; - if (NPC.Distance(player.Center) < 160f) - NPC.localAI[1] += death ? 4f : expertMode ? 2f : 1f; - if (NPC.localAI[1] >= (bossRush ? 90f : death ? 120f : 180f)) + if (NPC.localAI[1] >= (death ? 120f : 180f)) { NPC.TargetClosest(); NPC.localAI[1] = 0f; @@ -384,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; @@ -395,7 +390,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental Main.dust[dust].noGravity = true; Main.dust[dust].fadeIn = 1f; } - NPC.alpha += bossRush ? 8 : death ? 5 : revenge ? 4 : expertMode ? 3 : 2; + NPC.alpha += death ? 5 : revenge ? 4 : expertMode ? 3 : 2; if (NPC.alpha >= 255) { int spawnType = currentMode == 3 ? NPCID.AngryNimbus : ModContent.NPCType(); @@ -421,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) { @@ -463,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 || Main.getGoodWorld) + if (NPC.ai[3] >= 2f || phase2 || CalamityWorld.LegendaryMode) { NPC.ai[0] = -1f; NPC.ai[1] = 0f; @@ -484,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; @@ -503,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(); @@ -519,7 +510,7 @@ 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) + if (CalamityWorld.MaliceMode) Main.projectile[proj].extraUpdates += 1; } @@ -527,7 +518,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { velocity = (death ? 5f : 4f) + 2f * enrageScale; type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); + damage = DartDamage; if (currentMode == 4) { type = ModContent.ProjectileType(); @@ -540,7 +531,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { numProj *= 3; spread *= 2; @@ -554,7 +545,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { 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) + if (CalamityWorld.MaliceMode) Main.projectile[proj2].extraUpdates += 1; } } @@ -575,14 +566,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.localAI[0] += 2f; if (expertMode) NPC.localAI[0] += 1f - lifeRatio; @@ -609,7 +597,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) { @@ -620,7 +608,7 @@ 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) + if (CalamityWorld.MaliceMode) Main.projectile[proj].extraUpdates += 1; } } @@ -628,7 +616,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental totalProjectiles = 12; float radians2 = MathHelper.TwoPi / totalProjectiles; type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); + damage = DartDamage; if (currentMode == 4) { type = ModContent.ProjectileType(); @@ -650,7 +638,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { 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) + if (CalamityWorld.MaliceMode) Main.projectile[proj].extraUpdates += 1; } @@ -661,7 +649,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { 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) + if (CalamityWorld.MaliceMode) Main.projectile[proj].extraUpdates += 1; } } @@ -692,16 +680,13 @@ 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; Vector2 source = new Vector2(NPC.Center.X + (NPC.spriteDirection > 0 ? 34f : -34f), NPC.Center.Y - 74f); Vector2 aimAt = player.Center + player.velocity * 20f; - float aimResponsiveness = bossRush ? 0.05f : (NPC.ai[2] == 1f || death) ? 0.1f : 0.25f; + float aimResponsiveness = (NPC.ai[2] == 1f || death) ? 0.1f : 0.25f; Vector2 aimVector = (aimAt - source).SafeNormalize(Vector2.UnitY); if (aimVector.HasNaNs()) @@ -750,10 +735,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.zenithWorld) @@ -794,7 +779,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.zenithWorld) @@ -816,7 +801,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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) @@ -839,7 +824,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 @@ -891,14 +876,14 @@ namespace CalamityMod.NPCs.BrimstoneElemental } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } 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(); @@ -925,7 +910,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); } @@ -960,7 +945,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 803380b88f..043af182c8 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; @@ -41,10 +41,6 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -127,7 +123,7 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerIdleTargetDist.Normalize(); swarmerIdleTargetDist *= swarmerIdleSpeed; NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; } else if (NPC.velocity.Length() > 2f) @@ -175,7 +171,7 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerChargeTargetDist.Normalize(); swarmerChargeTargetDist *= swarmerChargeSpeed; NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; NPC.ForceNetUpdate(); @@ -203,7 +199,7 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerDecelerateTargetDist.Normalize(); swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) @@ -220,7 +216,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.damage = NPC.defDamage; NPC.velocity = swarmerDecelerateTargetDist; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) @@ -285,7 +281,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.damage, 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 268fadb66a..656bbb41ee 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,16 +80,13 @@ 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; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -135,10 +135,9 @@ namespace CalamityMod.NPCs.Bumblebirb // Variables float rotationMult = 3f; float rotationAmt = 0.03f; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Adjust slowing debuff immunity bool immuneToSlowingDebuffs = NPC.ai[0] == 3f || NPC.ai[0] == 3.1f || NPC.ai[0] == 3.2f; @@ -148,11 +147,10 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // If target is outside the jungle for more than 5 seconds, enrage - if (!player.ZoneJungle) + if (!player.ZoneJungle && !BossRushEvent.BossRushActive) { if (NPC.localAI[1] < CalamityGlobalNPC.biomeEnrageTimerMax) NPC.localAI[1] += 1f; @@ -166,16 +164,16 @@ namespace CalamityMod.NPCs.Bumblebirb // Enrage scale float enrageScale = death ? 1.5f : 1f; - if (NPC.localAI[1] >= CalamityGlobalNPC.biomeEnrageTimerMax || bossRush) + if (NPC.localAI[1] >= CalamityGlobalNPC.biomeEnrageTimerMax) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } - if (NPC.localAI[2] > 0f || bossRush) + if (NPC.localAI[2] > 0f) enrageScale += 1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrageScale += 0.5f; if (enrageScale > 3f) @@ -227,8 +225,8 @@ namespace CalamityMod.NPCs.Bumblebirb bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || (phase3 && calamityGlobalNPC.newAI[1] < newPhaseTimer && calamityGlobalNPC.newAI[3] != 1f); - calamityGlobalNPC.DR = (phaseSwitchPhase || NPC.ai[0] == 5f || (enrageScale == 3f && !bossRush)) ? (bossRush ? 0.99f : 0.55f) : 0.1f; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phaseSwitchPhase || NPC.ai[0] == 5f || (enrageScale == 3f && !bossRush); + calamityGlobalNPC.DR = phaseSwitchPhase || NPC.ai[0] == 5f || enrageScale == 3f ? 0.55f : 0.1f; + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phaseSwitchPhase || NPC.ai[0] == 5f || enrageScale == 3f; int reducedSetDamage = (int)Math.Round(NPC.defDamage * 0.5); @@ -269,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); } } } @@ -311,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); } } } @@ -339,7 +337,7 @@ namespace CalamityMod.NPCs.Bumblebirb } // Max spawn amount - int maxBirbs = (CalamityWorld.LegendaryMode && revenge) ? 12 : revenge ? 3 : 2; + int maxBirbs = CalamityWorld.MaliceMode ? 12 : revenge ? 3 : 2; // Variable for charging float chargeDistance = 600f; @@ -425,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) { @@ -469,19 +466,19 @@ namespace CalamityMod.NPCs.Bumblebirb bool spawnRight = player.velocity.X > 0f; for (int i = 0; i < totalProjectiles; i++) { - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { 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 @@ -492,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 @@ -501,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); } } } @@ -536,13 +533,13 @@ namespace CalamityMod.NPCs.Bumblebirb { int totalProjectiles = phase2 ? 40 : 48; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; int distance = phase2 ? 1200 : 1320; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) distance *= 2; bool spawnRight = player.velocity.X > 0f; @@ -555,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 { @@ -563,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); } } } @@ -651,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 (CalamityWorld.MaliceMode) follyQuickFlySpeed *= 2f; float follyQuickFlyVelMult = 20f; @@ -660,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] >= (CalamityWorld.MaliceMode ? 90f : 180f)) { NPC.TargetClosest(); NPC.ai[0] = 0f; @@ -850,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(), NPC.damage, 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); } } } @@ -858,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 = CalamityWorld.MaliceMode && (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) { @@ -924,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(), NPC.damage, 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); } } } @@ -1233,7 +1230,7 @@ namespace CalamityMod.NPCs.Bumblebirb return newColor; } - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.SuperHealingPotion; + public override void BossLoot(ref int potionType) => potionType = ItemID.SuperHealingPotion; public override void ModifyNPCLoot(NPCLoot npcLoot) { @@ -1307,7 +1304,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.damage, 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); } } } @@ -1317,7 +1314,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 e4571acd7a..e2fde8abe5 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; @@ -72,10 +77,9 @@ namespace CalamityMod.NPCs.CalClone if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 0.8f; - NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 12 : 25; - NPC.value = Item.buyPrice(0, 20, 0, 0); - NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.075f : 0.15f); - NPC.LifeMaxNERB(37500, 45000, 520000); + NPC.defense = 25; + NPC.value = Item.buyPrice(gold: 15); + NPC.LifeMaxNERB(39000, 46875, 520000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -87,9 +91,6 @@ namespace CalamityMod.NPCs.CalClone NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -140,10 +141,9 @@ namespace CalamityMod.NPCs.CalClone Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1f, 0f, 0f); // Variables for increasing difficulty - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 2f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.MaliceMode) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 1f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.MaliceMode) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -292,28 +292,11 @@ namespace CalamityMod.NPCs.CalClone // Target variable Player player = Main.player[NPC.target]; - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - 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)); Vector2 rotationVector = npcCenter - lookAt; - // Boss Rush predictive charge rotation - if (NPC.ai[1] == 4f && phase4 && bossRush) - { - // Velocity - float chargeVelocity = 30f; - chargeVelocity += 5f * enrageScale; - lookAt += Main.player[NPC.target].velocity * 20f; - rotationVector = Vector2.Normalize(npcCenter - lookAt) * chargeVelocity; - } - float rotation = (float)Math.Atan2(rotationVector.Y, rotationVector.X) + MathHelper.PiOver2; if (rotation < 0f) rotation += MathHelper.TwoPi; @@ -386,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); @@ -398,7 +379,7 @@ namespace CalamityMod.NPCs.CalClone baseVelocity += 1.5f * (1f - lifeRatio); baseAcceleration += 0.03f * (1f - lifeRatio); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { baseVelocity *= 1.15f; baseAcceleration *= 1.15f; @@ -462,12 +443,12 @@ 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 = (Main.getGoodWorld ? 120f : expertMode ? 180f : 240f) - enrageScale * 15f; - float projSpeed = bossRush ? 6.25f : 5f; + float gigaBlastFrequency = CalamityWorld.LegendaryMode ? 120f : expertMode ? 180f : 240f; + float projSpeed = 5f; if (calamityGlobalNPC.newAI[3] <= 300f) { if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top @@ -487,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; @@ -495,8 +476,8 @@ namespace CalamityMod.NPCs.CalClone if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - float projSpeed = bossRush ? 4.5f : 4f; + 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) { @@ -524,7 +505,7 @@ namespace CalamityMod.NPCs.CalClone } if (calamityGlobalNPC.newAI[3] == 900f - 360f) - BulletHellWarnSlot = SoundEngine.PlaySound(CalamitasClone.BulletHellWarning, player.Center); + BulletHellWarnSlot = SoundEngine.PlaySound(CalamitasClone.BulletHellWarning with { Volume = 0.75f }, player.Center); if (calamityGlobalNPC.newAI[3] > 900f - 360f) { if (SoundEngine.TryGetActiveSound(BulletHellWarnSlot, out var warningSound) && warningSound.IsPlaying) @@ -538,7 +519,7 @@ namespace CalamityMod.NPCs.CalClone NPC.localAI[1] = 0f; calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; - SoundEngine.PlaySound(CalamitasClone.BulletHellEnd, player.Center); + SoundEngine.PlaySound(CalamitasClone.BulletHellEnd with { Volume = 0.75f }, player.Center); // Prevent bullshit charge hits when second bullet hell ends. if (phase4) @@ -604,7 +585,7 @@ namespace CalamityMod.NPCs.CalClone return; } - else if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + else if (CalamityWorld.MaliceMode) { if (calamityGlobalNPC.newAI[3] < 900f) calamityGlobalNPC.newAI[3] += 1f; @@ -612,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; @@ -620,8 +601,8 @@ namespace CalamityMod.NPCs.CalClone if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - float projSpeed = bossRush ? 5f : 4f; + int damage = HellblastDamage; + float projSpeed = 4f; if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) { float distance = Main.rand.NextBool() ? -1000f : 1000f; @@ -660,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) @@ -672,31 +652,26 @@ 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(); + bool shootPredictiveShot = CalamityWorld.MaliceMode && Main.rand.NextBool(); Vector2 predictionVector = shootPredictiveShot ? 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; } } @@ -708,39 +683,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); } } } @@ -749,10 +717,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) @@ -765,13 +735,12 @@ 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 + (phase4 && bossRush ? player.velocity * 20f : Vector2.Zero) - NPC.Center); + Vector2 vector = Vector2.Normalize(player.Center - NPC.Center); NPC.velocity = vector * chargeVelocity; NPC.ai[1] = 3f; @@ -804,9 +773,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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, HellblastDamage, 0f, Main.myPlayer, 1f, 0f); } } @@ -927,7 +895,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(), 10); // Materials normalOnly.Add(ModContent.ItemType(), 1, 8, 10); @@ -968,7 +936,7 @@ namespace CalamityMod.NPCs.CalClone CalamityNetcode.SyncWorld(); } - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; + public override void BossLoot(ref int potionType) => potionType = ItemID.GreaterHealingPotion; public override void HitEffect(NPC.HitInfo hit) { @@ -1017,7 +985,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) @@ -1029,7 +996,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 a5cc956364..b4dec050ba 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; @@ -60,9 +62,8 @@ namespace CalamityMod.NPCs.CalClone if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; - NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 15 : 10; - NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.225f : 0.15f); - NPC.LifeMaxNERB(11000, 13200, 80000); + NPC.defense = 10; + NPC.LifeMaxNERB(8500, 10000, 80000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -145,10 +146,9 @@ namespace CalamityMod.NPCs.CalClone // Emit light Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1f, 0f, 0f); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -156,13 +156,6 @@ namespace CalamityMod.NPCs.CalClone Player player = Main.player[NPC.target]; - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - 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; @@ -225,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { calCloneBroProjAttackMaxSpeed *= 1.15f; calCloneBroProjAttackAccel *= 1.15f; @@ -325,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; @@ -339,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); } } } @@ -348,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) calCloneBroChargeSpeed *= 1.25f; Vector2 calCloneBroChargeCenter = NPC.Center; @@ -377,11 +359,8 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - if (bossRush) - damage /= 2; - int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 8 : expertMode ? 6 : 4; + int totalProjectiles = death ? 10 : revenge ? 8 : expertMode ? 6 : 4; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 5f; Vector2 spinningPoint = new Vector2(0f, -velocity); @@ -389,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++) @@ -400,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; @@ -411,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; @@ -568,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 73e07ab8e3..b12216583d 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; @@ -55,9 +57,8 @@ namespace CalamityMod.NPCs.CalClone if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; - NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 15 : 10; - NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.225f : 0.15f); - NPC.LifeMaxNERB(9200, 11025, 80000); + NPC.defense = 10; + NPC.LifeMaxNERB(8500, 10000, 80000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -139,10 +140,9 @@ namespace CalamityMod.NPCs.CalClone // Emit light Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1f, 0f, 0f); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -150,13 +150,6 @@ namespace CalamityMod.NPCs.CalClone Player player = Main.player[NPC.target]; - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - 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; @@ -219,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { calCloneBroProjAttackMaxSpeed *= 1.15f; calCloneBroProjAttackAccel *= 1.15f; @@ -316,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; @@ -330,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); } } } @@ -339,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) calCloneBroChargeSpeed *= 1.25f; Vector2 calCloneBroChargeCenter = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); @@ -368,11 +350,8 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - if (bossRush) - damage /= 2; - int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 8 : expertMode ? 6 : 4; + int totalProjectiles = death ? 10 : revenge ? 8 : expertMode ? 6 : 4; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 5f; Vector2 spinningPoint = new Vector2(0f, -velocity); @@ -380,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++) @@ -391,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; @@ -402,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; @@ -558,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 d6a78285ce..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) { @@ -53,10 +52,6 @@ namespace CalamityMod.NPCs.CalClone NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -119,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 2033674ecf..20b0d44ffc 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -18,6 +18,7 @@ using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Renderers.CalamityRenderers; using CalamityMod.Items; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Melee; @@ -147,10 +148,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; @@ -188,8 +204,6 @@ namespace CalamityMod.NPCs public float velocityPriorToPhaseSwap = 0f; public const float velocityPriorToPhaseSwapIncrement = 0.1f; - public bool ShouldFallThroughPlatforms; - /// Allows hostile NPCs to deal defense damage to the player, used mostly for hard-hitting bosses. public bool canBreakPlayerDefense = false; @@ -222,20 +236,6 @@ namespace CalamityMod.NPCs private const double EnemyHPMultiplier = 1.25; /// Constant multiplier used to decrease the health and/or damage of pre-Hardmode Desert enemies. private const double DesertEnemyStatMultiplier = 0.75; - /// - /// Constant multiplier used to decrease vanilla boss health in Master Mode.
- /// When combined with the universal health multiplier, results in 27.5% more health than Expert Mode. - ///
- public const double MasterModeBossHPMultiplier = 0.85; - - /// Constant multiplier used to decrease enemy health in Master Mode. - public const double MasterModeEnemyHPMultiplier = 0.75; - /// Constant multiplier used to decrease enemy damage in Master Mode. - public const double MasterModeEnemyDamageMultiplier = 0.9; - /// Constant multiplier used to decrease enemy knockback resistance. - public const float ExpertModeEnemyKnockbackMultiplier = 0.05f; - /// - public const float MasterModeEnemyKnockbackMultiplier = 0.1f; /// Constant multiplier used for decreasing the health and damage of mechanical bosses if the Early Hardmode Progression Rework config is enabled. public const double EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic = 0.8; @@ -288,17 +288,16 @@ 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 slowed = 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; /// /// 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. @@ -309,23 +308,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; @@ -385,40 +383,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]; @@ -556,8 +555,6 @@ namespace CalamityMod.NPCs myClone.velocityPriorToPhaseSwap = velocityPriorToPhaseSwap; - myClone.ShouldFallThroughPlatforms = ShouldFallThroughPlatforms; - myClone.canBreakPlayerDefense = canBreakPlayerDefense; myClone.miscDefenseLoss = miscDefenseLoss; @@ -587,31 +584,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.slowed = slowed; 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; @@ -646,27 +642,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; @@ -776,6 +772,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 @@ -842,551 +911,118 @@ namespace CalamityMod.NPCs damage = projectileCount * 4; } } - - // Shellfish Staff (and Mollusk armor) debuff stacking - if (shellfishVore > 0) - { - 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; - } - } - } - - 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() && - 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); - } #endregion // Debuff vulnerabilities and resistances. // 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); - } - - // Sage Poison - if (sagePoisonTime > 0) - { - // npc.Calamity().sagePoisonDamage = 50 * (float)(Math.Pow(totalSageSpirits, 0.73D) + Math.Pow(totalSageSpirits, 1.1D)) * 0.5f - // See SageNeedle.cs for details - int baseSagePoisonDoTValue = (int)(npc.Calamity().sagePoisonDamage * sicknessDamageMult); - ApplyDPSDebuff(baseSagePoisonDoTValue, baseSagePoisonDoTValue / 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 (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) @@ -1418,115 +1054,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.25f }, - { NPCID.GolemFistLeft, 0.25f }, - { NPCID.GolemFistRight, 0.25f }, - { NPCID.GolemHead, 0.25f }, - { NPCID.GolemHeadFree, 0.25f }, - { 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.Golem, 0.15f }, + { NPCID.GolemFistLeft, 0.15f }, + { NPCID.GolemFistRight, 0.15f }, + { NPCID.GolemHead, 0.15f }, { 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 @@ -1564,7 +1113,7 @@ namespace CalamityMod.NPCs { NPCID.Creeper, 1800 }, // 0:30 (30 seconds, length of Creepers phase) { NPCID.Deerclops, 5400 }, // 1:30 (90 seconds) { NPCID.QueenBee, 7200 }, // 2:00 (120 seconds) - { NPCID.SkeletronHead, 9000 }, // 2:30 (150 seconds) + { NPCID.SkeletronHead, 7200 }, // 2:00 (120 seconds) { NPCID.WallofFlesh, 7200 }, // 2:00 (120 seconds) { NPCID.WallofFleshEye, 7200 }, { NPCID.QueenSlimeBoss, 7200 }, // 2:00 (120 seconds) @@ -1575,10 +1124,10 @@ namespace CalamityMod.NPCs { NPCID.TheDestroyerTail, 10800 }, { NPCID.SkeletronPrime, 10800 }, // 3:00 (180 seconds) { NPCID.Plantera, 10800 }, // 3:00 (180 seconds) - { NPCID.HallowBoss, 10800 }, // 3:00 (180 seconds) { NPCID.Golem, 9000 }, // 2:30 (150 seconds) { NPCID.GolemHead, 3600 }, // 1:00 (60 seconds) { NPCID.DukeFishron, 9000 }, // 2:30 (150 seconds) + { NPCID.HallowBoss, 10800 }, // 3:00 (180 seconds) { NPCID.CultistBoss, 9000 }, // 2:30 (150 seconds) { NPCID.MoonLordCore, 14400 }, // 4:00 (240 seconds) { NPCID.MoonLordHand, 7200 }, // 2:00 (120 seconds) @@ -1604,7 +1153,7 @@ namespace CalamityMod.NPCs { NPCType(), 9000 }, { NPCType(), 9000 }, { NPCType(), 10800 }, // 3:00 (180 seconds) - { NPCType(), 14400 }, // 4:00 (240 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) { NPCType(), 10800 }, // 3:00 (180 seconds) { NPCType(), 10800 }, { NPCType(), 10800 }, // 3:00 (180 seconds) @@ -1613,7 +1162,7 @@ namespace CalamityMod.NPCs { NPCType(), 7200 }, { NPCType(), 10800 }, // 3:00 (180 seconds) { NPCType(), 10800 }, // 3:00 (180 seconds) - { NPCType(), 5400 }, // 1:30 (90 seconds) + { NPCType(), 7200 }, // 2:00 (120 seconds) { NPCType(), 7200 }, // 2:00 (120 seconds) { NPCType(), 14400 }, // 4:00 (240 seconds) { NPCType(), 10800 }, // 3:00 (180 seconds) @@ -1627,7 +1176,7 @@ namespace CalamityMod.NPCs { NPCType(), 14400 }, // 4:00 (240 seconds) { NPCType(), 14400 }, // DoG Phase 1 is 1:30, DoG Phase 2 is 2:30 { NPCType(), 14400 }, - { NPCType(), 14700 }, // 4:05 (245 seconds) -- he spends 5 seconds invincible where you can't do anything + { NPCType(), 14400 }, // 4:00 (240 seconds) { NPCType(), 21600 }, // 6:00 (360 seconds) { NPCType(), 21600 }, { NPCType(), 21600 }, // 6:00 (360 seconds) @@ -1655,8 +1204,6 @@ namespace CalamityMod.NPCs public override void SetDefaults(NPC npc) { - ShouldFallThroughPlatforms = false; - for (int i = 0; i < maxPlayerImmunities; i++) dashImmunityTime[i] = 0; @@ -1672,7 +1219,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; } @@ -1692,8 +1239,6 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) BossRushStatChanges(npc, Mod); - BossValueChanges(npc); - if (CalamityWorld.revenge) RevDeathStatChanges(npc, Mod); @@ -1717,6 +1262,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 @@ -1758,16 +1311,16 @@ namespace CalamityMod.NPCs break; case NPCID.Golem: - npc.lifeMax = 30000; + npc.lifeMax = 40000; break; case NPCID.GolemHead: - npc.lifeMax = 20000; + npc.lifeMax = 26500; break; case NPCID.GolemFistRight: case NPCID.GolemFistLeft: - npc.lifeMax = 7000; + npc.lifeMax = 7500; break; case NPCID.HallowBoss: @@ -1775,7 +1328,7 @@ namespace CalamityMod.NPCs break; case NPCID.Plantera: - npc.lifeMax = 80000; + npc.lifeMax = 72000; break; case NPCID.PlanterasTentacle: @@ -1823,30 +1376,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) @@ -1876,16 +1418,18 @@ namespace CalamityMod.NPCs { npc.lifeMax = (int)Math.Round(npc.lifeMax * 5D); } - else if (npc.type == NPCID.Golem || npc.type == NPCID.GolemHead) + else if (npc.type == NPCID.Golem) { - npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.5); - - if (npc.type == NPCID.Golem) - npc.npcSlots = 64f; + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); + npc.npcSlots = 64f; } - else if (npc.type == NPCID.GolemHeadFree) + else if (npc.type == NPCID.GolemHead) { - npc.dontTakeDamage = false; + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); + } + else if (npc.type == NPCID.GolemFistLeft || npc.type == NPCID.GolemFistRight) + { + npc.scale *= 1.15f; } else if (npc.type == NPCID.HallowBoss) { @@ -1897,7 +1441,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; @@ -1910,17 +1454,17 @@ namespace CalamityMod.NPCs npc.scale *= Main.zenithWorld ? 2f : 1.2f; } - else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) + else if (npc.type == NPCID.SkeletronPrime) { - // HP boosted in Death Mode due to having two heads (piercing can make them die faster than normal here since they share an HP bar) - npc.lifeMax = (int)Math.Round(npc.lifeMax * (CalamityWorld.death ? 1.7 : 1.2)); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 12f; } else if (npc.type <= NPCID.PrimeLaser && npc.type >= NPCID.PrimeCannon) { - npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.55); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.65); + npc.scale = 1.15f; } - else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == NPCType()) + else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 10f; @@ -1978,7 +1522,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); @@ -2000,11 +1544,11 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.KingSlime) { if (CalamityWorld.death) - npc.scale = Main.getGoodWorld ? 6f : 2.5f; + npc.scale = CalamityWorld.LegendaryMode ? 6f : 2.5f; else - npc.scale = Main.getGoodWorld ? 3f : 1.5f; + npc.scale = CalamityWorld.LegendaryMode ? 3f : 1.5f; - npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.getGoodWorld ? 1.8 : 1.5)); + npc.lifeMax = (int)Math.Round(npc.lifeMax * (CalamityWorld.LegendaryMode ? 1.8 : 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) { @@ -2723,14 +2267,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); @@ -2742,43 +2279,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: @@ -2793,19 +2301,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: @@ -2814,10 +2316,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; @@ -2836,11 +2334,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; @@ -2876,8 +2369,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: @@ -2894,7 +2385,6 @@ namespace CalamityMod.NPCs case NPCID.Sharkron2: npc.width = npc.height = 36; npc.chaseable = false; - canBreakPlayerDefense = true; break; // Fix drawing issues with Golem's Free Head @@ -2938,7 +2428,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 || npc.type == NPCType()) + 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); @@ -2948,7 +2438,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 || npc.type == NPCType()) + 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); @@ -2975,7 +2465,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; @@ -2983,21 +2473,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; @@ -3008,7 +2498,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; @@ -3016,575 +2506,6 @@ namespace CalamityMod.NPCs npc.defDamage = npc.damage; } } - - // Nerf KB resist in Expert and Master using this roundabout method - if (Main.expertMode) - AdjustExpertModeStatScaling(npc); - - // Adjust a ton of enemy stats - switch (npc.type) - { - case NPCID.AngryBones: - case NPCID.AngryBonesBig: - case NPCID.AngryBonesBigHelmet: - case NPCID.AngryBonesBigMuscle: - case NPCID.BigBoned: - case NPCID.ShortBones: - case NPCID.AnomuraFungus: - case NPCID.Antlion: - case NPCID.WalkingAntlion: - case NPCID.GiantWalkingAntlion: - case NPCID.LarvaeAntlion: - case NPCID.FlyingAntlion: - case NPCID.GiantFlyingAntlion: - case NPCID.BabySlime: - case NPCID.BlackSlime: - case NPCID.BlazingWheel: - case NPCID.BloodCrawler: - case NPCID.BloodCrawlerWall: - case NPCID.BlueJellyfish: - case NPCID.GreenJellyfish: - case NPCID.PinkJellyfish: - case NPCID.BloodJelly: - case NPCID.FungoFish: - case NPCID.BlueSlime: - case NPCID.BoneSerpentBody: - case NPCID.BoneSerpentHead: - case NPCID.BoneSerpentTail: - case NPCID.CaveBat: - case NPCID.CochinealBeetle: - case NPCID.Crab: - case NPCID.Crawdad: - case NPCID.Crawdad2: - case NPCID.Crimera: - case NPCID.BigCrimera: - case NPCID.LittleCrimera: - case NPCID.CursedSkull: - case NPCID.CyanBeetle: - case NPCID.Demon: - case NPCID.DemonEye: - case NPCID.CataractEye: - case NPCID.CataractEye2: - case NPCID.DemonEye2: - case NPCID.DemonEyeOwl: - case NPCID.DemonEyeSpaceship: - case NPCID.DialatedEye: - case NPCID.DialatedEye2: - case NPCID.GreenEye: - case NPCID.GreenEye2: - case NPCID.PurpleEye: - case NPCID.PurpleEye2: - case NPCID.SleepyEye: - case NPCID.SleepyEye2: - case NPCID.DevourerBody: - case NPCID.DevourerHead: - case NPCID.DevourerTail: - case NPCID.DoctorBones: - case NPCID.DungeonSlime: - case NPCID.EaterofSouls: - case NPCID.BigEater: - case NPCID.LittleEater: - case NPCID.FaceMonster: - case NPCID.ArmedZombieEskimo: - case NPCID.ZombieEskimo: - case NPCID.FungiBulb: - case NPCID.Ghost: - case NPCID.GiantShelly: - case NPCID.GiantShelly2: - case NPCID.GiantWormBody: - case NPCID.GiantWormHead: - case NPCID.GiantWormTail: - case NPCID.Gnome: - case NPCID.GoblinScout: - case NPCID.GraniteFlyer: - case NPCID.GraniteGolem: - case NPCID.GreenSlime: - case NPCID.Harpy: - case NPCID.Hellbat: - case NPCID.GreekSkeleton: - case NPCID.Hornet: - case NPCID.HornetFatty: - case NPCID.HornetHoney: - case NPCID.HornetLeafy: - case NPCID.HornetSpikey: - case NPCID.HornetStingy: - case NPCID.BigHornetFatty: - case NPCID.BigHornetHoney: - case NPCID.BigHornetLeafy: - case NPCID.BigHornetSpikey: - case NPCID.BigHornetStingy: - case NPCID.BigMossHornet: - case NPCID.GiantMossHornet: - case NPCID.LittleHornetFatty: - case NPCID.LittleHornetHoney: - case NPCID.LittleHornetLeafy: - case NPCID.LittleHornetSpikey: - case NPCID.LittleHornetStingy: - case NPCID.LittleMossHornet: - case NPCID.MossHornet: - case NPCID.TinyMossHornet: - case NPCID.IceBat: - case NPCID.IceSlime: - case NPCID.JungleBat: - case NPCID.JungleSlime: - case NPCID.LacBeetle: - case NPCID.LavaSlime: - case NPCID.MaggotZombie: - case NPCID.ManEater: - case NPCID.MeteorHead: - case NPCID.MotherSlime: - case NPCID.MushiLadybug: - case NPCID.Nymph: - case NPCID.Pinky: - case NPCID.Piranha: - case NPCID.PurpleSlime: - case NPCID.Raven: - case NPCID.RedSlime: - case NPCID.Salamander: - case NPCID.Salamander2: - case NPCID.Salamander3: - case NPCID.Salamander4: - case NPCID.Salamander5: - case NPCID.Salamander6: - case NPCID.Salamander7: - case NPCID.Salamander8: - case NPCID.Salamander9: - case NPCID.SandSlime: - case NPCID.SeaSnail: - case NPCID.Shark: - case NPCID.ShimmerSlime: - case NPCID.Skeleton: - case NPCID.SkeletonAlien: - case NPCID.SkeletonAstonaut: - case NPCID.SkeletonTopHat: - case NPCID.ArmoredSkeleton: - case NPCID.BigHeadacheSkeleton: - case NPCID.BigMisassembledSkeleton: - case NPCID.BigPantlessSkeleton: - case NPCID.BigSkeleton: - case NPCID.BoneThrowingSkeleton: - case NPCID.BoneThrowingSkeleton2: - case NPCID.BoneThrowingSkeleton3: - case NPCID.BoneThrowingSkeleton4: - case NPCID.HeadacheSkeleton: - case NPCID.HeavySkeleton: - case NPCID.MisassembledSkeleton: - case NPCID.PantlessSkeleton: - case NPCID.SmallMisassembledSkeleton: - case NPCID.SmallHeadacheSkeleton: - case NPCID.SmallSkeleton: - case NPCID.SmallPantlessSkeleton: - case NPCID.SporeSkeleton: - case NPCID.TacticalSkeleton: - case NPCID.SkeletonSniper: - case NPCID.SkeletonCommando: - case NPCID.DarkCaster: - case NPCID.FireImp: - case NPCID.Snatcher: - case NPCID.SnowFlinx: - case NPCID.SpikeBall: - case NPCID.SpikedIceSlime: - case NPCID.SpikedJungleSlime: - case NPCID.SporeBat: - case NPCID.ZombieMushroom: - case NPCID.ZombieMushroomHat: - case NPCID.Squid: - case NPCID.Tim: - case NPCID.TombCrawlerBody: - case NPCID.TombCrawlerHead: - case NPCID.TombCrawlerTail: - case NPCID.UndeadMiner: - case NPCID.UndeadViking: - case NPCID.VoodooDemon: - case NPCID.Vulture: - case NPCID.WallCreeper: - case NPCID.WallCreeperWall: - case NPCID.YellowSlime: - case NPCID.Zombie: - case NPCID.ZombieDoctor: - case NPCID.ZombieElf: - case NPCID.ZombieElfBeard: - case NPCID.ZombieElfGirl: - case NPCID.ZombieMerman: - case NPCID.ZombiePixie: - case NPCID.ZombieRaincoat: - case NPCID.ZombieSuperman: - case NPCID.ZombieSweater: - case NPCID.ZombieXmas: - case NPCID.ArmedTorchZombie: - case NPCID.ArmedZombie: - case NPCID.ArmedZombieCenx: - case NPCID.ArmedZombiePincussion: - case NPCID.ArmedZombieSlimed: - case NPCID.ArmedZombieSwamp: - case NPCID.ArmedZombieTwiggy: - case NPCID.BaldZombie: - case NPCID.BigBaldZombie: - case NPCID.BigFemaleZombie: - case NPCID.BigPincushionZombie: - case NPCID.BigRainZombie: - case NPCID.BigSlimedZombie: - case NPCID.BigSwampZombie: - case NPCID.BigTwiggyZombie: - case NPCID.BigZombie: - case NPCID.BloodZombie: - case NPCID.FemaleZombie: - case NPCID.PincushionZombie: - case NPCID.SlimedZombie: - case NPCID.SmallBaldZombie: - case NPCID.SmallFemaleZombie: - case NPCID.SmallPincushionZombie: - case NPCID.SmallRainZombie: - case NPCID.SmallSlimedZombie: - case NPCID.SmallSwampZombie: - case NPCID.SmallTwiggyZombie: - case NPCID.SmallZombie: - case NPCID.SwampZombie: - case NPCID.TorchZombie: - case NPCID.TwiggyZombie: - case NPCID.AnglerFish: - case NPCID.AngryTrapper: - case NPCID.Arapaima: - case NPCID.ArmoredViking: - case NPCID.DesertBeast: - case NPCID.BlackRecluse: - case NPCID.BlackRecluseWall: - case NPCID.BloodFeeder: - case NPCID.Mummy: - case NPCID.BloodMummy: - case NPCID.DarkMummy: - case NPCID.LightMummy: - case NPCID.BlueArmoredBones: - case NPCID.BlueArmoredBonesMace: - case NPCID.BlueArmoredBonesNoPants: - case NPCID.BlueArmoredBonesSword: - case NPCID.BoneLee: - case NPCID.ChaosElemental: - case NPCID.Clinger: - case NPCID.BigMimicCorruption: - case NPCID.BigMimicCrimson: - case NPCID.BigMimicHallow: - case NPCID.BigMimicJungle: - case NPCID.CorruptSlime: - case NPCID.Corruptor: - case NPCID.Crimslime: - case NPCID.BigCrimslime: - case NPCID.LittleCrimslime: - case NPCID.CrimsonAxe: - case NPCID.CultistArcherBlue: - case NPCID.CultistArcherWhite: - case NPCID.CultistDevote: - case NPCID.CursedHammer: - case NPCID.Derpling: - case NPCID.Herpling: - case NPCID.DesertDjinn: - case NPCID.DiabolistRed: - case NPCID.DiabolistWhite: - case NPCID.DiggerBody: - case NPCID.DiggerHead: - case NPCID.DiggerTail: - case NPCID.DesertGhoul: - case NPCID.DesertGhoulCorruption: - case NPCID.DesertGhoulCrimson: - case NPCID.DesertGhoulHallow: - case NPCID.DuneSplicerBody: - case NPCID.DuneSplicerHead: - case NPCID.DuneSplicerTail: - case NPCID.DungeonSpirit: - case NPCID.EnchantedSword: - case NPCID.FloatyGross: - case NPCID.FlyingSnake: - case NPCID.Gastropod: - case NPCID.GiantBat: - case NPCID.GiantCursedSkull: - case NPCID.GiantFlyingFox: - case NPCID.GiantFungiBulb: - case NPCID.GiantTortoise: - case NPCID.IceTortoise: - case NPCID.HellArmoredBones: - case NPCID.HellArmoredBonesMace: - case NPCID.HellArmoredBonesSpikeShield: - case NPCID.HellArmoredBonesSword: - case NPCID.HoppinJack: - case NPCID.IceElemental: - case NPCID.Mimic: - case NPCID.IceMimic: - case NPCID.PresentMimic: - case NPCID.IchorSticker: - case NPCID.IcyMerman: - case NPCID.IlluminantBat: - case NPCID.IlluminantSlime: - case NPCID.JungleCreeper: - case NPCID.JungleCreeperWall: - case NPCID.DesertLamiaDark: - case NPCID.DesertLamiaLight: - case NPCID.Lavabat: - case NPCID.Lihzahrd: - case NPCID.LihzahrdCrawler: - case NPCID.Medusa: - case NPCID.Moth: - case NPCID.Necromancer: - case NPCID.NecromancerArmored: - case NPCID.Paladin: - case NPCID.PigronCorruption: - case NPCID.PigronCrimson: - case NPCID.PigronHallow: - case NPCID.Pixie: - case NPCID.PossessedArmor: - case NPCID.RaggedCaster: - case NPCID.RaggedCasterOpenCoat: - case NPCID.RedDevil: - case NPCID.RockGolem: - case NPCID.RuneWizard: - case NPCID.RustyArmoredBonesAxe: - case NPCID.RustyArmoredBonesFlail: - case NPCID.RustyArmoredBonesSword: - case NPCID.RustyArmoredBonesSwordNoArmor: - case NPCID.DesertScorpionWalk: - case NPCID.DesertScorpionWall: - case NPCID.SkeletonArcher: - case NPCID.Slimeling: - case NPCID.Slimer: - case NPCID.Slimer2: - case NPCID.ToxicSludge: - case NPCID.Unicorn: - case NPCID.WanderingEye: - case NPCID.Werewolf: - case NPCID.Wolf: - case NPCID.SeekerBody: - case NPCID.SeekerHead: - case NPCID.SeekerTail: - case NPCID.Wraith: - case NPCID.WyvernBody: - case NPCID.WyvernBody2: - case NPCID.WyvernBody3: - case NPCID.WyvernHead: - case NPCID.WyvernLegs: - case NPCID.WyvernTail: - case NPCID.BloodEelBody: - case NPCID.BloodEelHead: - case NPCID.BloodEelTail: - case NPCID.BloodSquid: - case NPCID.ChatteringTeethBomb: - case NPCID.Clown: - case NPCID.CorruptBunny: - case NPCID.CorruptGoldfish: - case NPCID.CorruptPenguin: - case NPCID.Drippler: - case NPCID.GoblinShark: - case NPCID.TheGroom: - case NPCID.TheBride: - case NPCID.CrimsonBunny: - case NPCID.CrimsonGoldfish: - case NPCID.CrimsonPenguin: - case NPCID.EyeballFlyingFish: - case NPCID.Dandelion: - case NPCID.AngryNimbus: - case NPCID.FlyingFish: - case NPCID.IceGolem: - case NPCID.RainbowSlime: - case NPCID.UmbrellaSlime: - case NPCID.Tumbleweed: - case NPCID.SandShark: - case NPCID.SandsharkCorrupt: - case NPCID.SandsharkCrimson: - case NPCID.SandsharkHallow: - case NPCID.SandElemental: - case NPCID.BloodNautilus: - case NPCID.GoblinArcher: - case NPCID.GoblinPeon: - case NPCID.GoblinSorcerer: - case NPCID.GoblinSummoner: - case NPCID.GoblinThief: - case NPCID.GoblinWarrior: - case NPCID.MisterStabby: - case NPCID.SnowBalla: - case NPCID.SnowmanGangsta: - case NPCID.Parrot: - case NPCID.PirateCaptain: - case NPCID.PirateCorsair: - case NPCID.PirateCrossbower: - case NPCID.PirateDeadeye: - case NPCID.PirateDeckhand: - case NPCID.PirateGhost: - case NPCID.PirateShipCannon: - case NPCID.MothronSpawn: - case NPCID.Mothron: - case NPCID.Butcher: - case NPCID.CreatureFromTheDeep: - case NPCID.DeadlySphere: - case NPCID.DrManFly: - case NPCID.Eyezor: - case NPCID.Frankenstein: - case NPCID.Fritz: - case NPCID.Nailhead: - case NPCID.Psycho: - case NPCID.Reaper: - case NPCID.ThePossessed: - case NPCID.SwampThing: - case NPCID.Vampire: - case NPCID.VampireBat: - case NPCID.BrainScrambler: - case NPCID.GigaZapper: - case NPCID.MartianWalker: - case NPCID.GrayGrunt: - case NPCID.MartianDrone: - case NPCID.MartianEngineer: - case NPCID.MartianOfficer: - case NPCID.RayGunner: - case NPCID.Scutlix: - case NPCID.ScutlixRider: - case NPCID.MartianTurret: - case NPCID.HeadlessHorseman: - case NPCID.Hellhound: - case NPCID.Splinterling: - case NPCID.Poltergeist: - case NPCID.Scarecrow1: - case NPCID.Scarecrow2: - case NPCID.Scarecrow3: - case NPCID.Scarecrow4: - case NPCID.Scarecrow5: - case NPCID.Scarecrow6: - case NPCID.Scarecrow7: - case NPCID.Scarecrow8: - case NPCID.Scarecrow9: - case NPCID.Scarecrow10: - case NPCID.ElfArcher: - case NPCID.ElfCopter: - case NPCID.Flocko: - case NPCID.GingerbreadMan: - case NPCID.Krampus: - case NPCID.Nutcracker: - case NPCID.NutcrackerSpinning: - case NPCID.Yeti: - case NPCID.NebulaBeast: - case NPCID.NebulaBrain: - case NPCID.NebulaHeadcrab: - case NPCID.NebulaSoldier: - case NPCID.SolarCorite: - case NPCID.SolarCrawltipedeBody: - case NPCID.SolarCrawltipedeHead: - case NPCID.SolarCrawltipedeTail: - case NPCID.SolarDrakomire: - case NPCID.SolarDrakomireRider: - case NPCID.SolarSolenian: - case NPCID.SolarSpearman: - case NPCID.SolarSroller: - case NPCID.StardustCellBig: - case NPCID.StardustCellSmall: - case NPCID.StardustJellyfishBig: - case NPCID.StardustWormBody: - case NPCID.StardustWormHead: - case NPCID.StardustWormTail: - case NPCID.StardustSoldier: - case NPCID.StardustSpiderBig: - case NPCID.StardustSpiderSmall: - case NPCID.VortexHornet: - case NPCID.VortexHornetQueen: - case NPCID.VortexLarva: - case NPCID.VortexRifleman: - case NPCID.VortexSoldier: - case NPCID.DD2DarkMageT1: - case NPCID.DD2DarkMageT3: - case NPCID.DD2OgreT2: - case NPCID.DD2OgreT3: - case NPCID.MartianSaucerCore: - case NPCID.MartianSaucerCannon: - case NPCID.MartianSaucerTurret: - case NPCID.DD2SkeletonT1: - case NPCID.DD2SkeletonT3: - case NPCID.DD2DrakinT2: - case NPCID.DD2DrakinT3: - case NPCID.DD2GoblinBomberT1: - case NPCID.DD2GoblinBomberT2: - case NPCID.DD2GoblinBomberT3: - case NPCID.DD2GoblinT1: - case NPCID.DD2GoblinT2: - case NPCID.DD2GoblinT3: - case NPCID.DD2JavelinstT1: - case NPCID.DD2JavelinstT2: - case NPCID.DD2JavelinstT3: - case NPCID.DD2KoboldFlyerT2: - case NPCID.DD2KoboldFlyerT3: - case NPCID.DD2KoboldWalkerT2: - case NPCID.DD2KoboldWalkerT3: - case NPCID.DD2LightningBugT3: - case NPCID.DD2WitherBeastT2: - case NPCID.DD2WitherBeastT3: - case NPCID.DD2WyvernT1: - case NPCID.DD2WyvernT2: - case NPCID.DD2WyvernT3: - case NPCID.SlimeSpiked: - - // Buff enemy HP by 25% - npc.lifeMax = (int)Math.Round(npc.lifeMax * EnemyHPMultiplier); - - // Nerf a shitload of Master Mode enemies - // HP is nerfed by 25% (this nerf is higher due to the player not dealing any more damage in Master) - // Damage is nerfed by 15% (this nerf is lower due to the player having 100% effective defense in Master) - if (Main.masterMode) - { - AdjustMasterModeStatScaling(npc); - npc.defDamage = npc.damage; - } - - break; - - case NPCID.AncientCultistSquidhead: - // This guy only gets Master Mode nerfs - // HP is nerfed by 25% (this nerf is higher due to the player not dealing any more damage in Master) - // Damage is nerfed by 15% (this nerf is lower due to the player having 100% effective defense in Master) - if (Main.masterMode) - { - AdjustMasterModeStatScaling(npc); - npc.defDamage = npc.damage; - } - break; - - case NPCID.KingSlime: - case NPCID.EyeofCthulhu: - case NPCID.EaterofWorldsHead: - case NPCID.EaterofWorldsBody: - case NPCID.EaterofWorldsTail: - case NPCID.BrainofCthulhu: - case NPCID.Creeper: - case NPCID.QueenBee: - case NPCID.SkeletronHead: - case NPCID.SkeletronHand: - case NPCID.Deerclops: - case NPCID.WallofFlesh: - case NPCID.WallofFleshEye: - case NPCID.QueenSlimeBoss: - case NPCID.Retinazer: - case NPCID.Spazmatism: - case NPCID.TheDestroyer: - case NPCID.TheDestroyerBody: - case NPCID.TheDestroyerTail: - case NPCID.SkeletronPrime: - case NPCID.PrimeCannon: - case NPCID.PrimeLaser: - case NPCID.PrimeSaw: - case NPCID.PrimeVice: - case NPCID.Plantera: - case NPCID.PlanterasTentacle: - case NPCID.Golem: - case NPCID.GolemHead: - case NPCID.GolemHeadFree: - case NPCID.GolemFistLeft: - case NPCID.GolemFistRight: - case NPCID.HallowBoss: - case NPCID.DukeFishron: - case NPCID.CultistBoss: - case NPCID.MoonLordCore: - case NPCID.MoonLordFreeEye: - case NPCID.MoonLordHand: - case NPCID.MoonLordHead: - - if (Main.masterMode) - AdjustMasterModeStatScaling(npc, true); - - break; - } } #endregion @@ -3689,7 +2610,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 @@ -3787,7 +2708,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. @@ -3796,12 +2717,12 @@ namespace CalamityMod.NPCs // Damage reduction on spawn for certain worm bosses. if (CalamityWorld.revenge) { - if (EaterOfWorldsIDList.Includes(npc.type) && newAI[1] < EaterOfWorldsAI.DRIncreaseTime) - modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(BossRushEvent.BossRushActive ? 0.6f : 0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / EaterOfWorldsAI.DRIncreaseTime, 0f, 1f))); - if (DestroyerIDList.Includes(npc.type) && newAI[1] < DestroyerAI.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 (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) @@ -3858,18 +2779,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; @@ -3939,18 +2864,12 @@ namespace CalamityMod.NPCs #region Boss Head Slot public override void BossHeadSlot(NPC npc, ref int index) { - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) + if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) { - if (npc.type == NPCID.SkeletronPrime && (CalamityWorld.death || BossRushEvent.BossRushActive)) - index = ExtraTextureRefs.BossHeadIndex_ChadPrime; - - if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) - { - float lifeRatio = npc.life / (float)npc.lifeMax; - float mapIconVanishValue = CalamityWorld.death ? 0.3f : 0.4f; - if (lifeRatio < mapIconVanishValue || (lifeRatio > 0.9f && (CalamityWorld.death || BossRushEvent.BossRushActive))) - index = -1; - } + float lifeRatio = npc.life / (float)npc.lifeMax; + float mapIconVanishValue = 0.3f; + if (lifeRatio < mapIconVanishValue || lifeRatio > 0.9f) + index = -1; } } #endregion @@ -3959,7 +2878,7 @@ namespace CalamityMod.NPCs public override bool PreAI(NPC npc) { // Change Spaz and Ret weaknesses and resistances when phase 2 starts. - if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) + if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) { if (npc.ai[0] >= 2f) { @@ -3989,9 +2908,6 @@ namespace CalamityMod.NPCs { if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < BossZenDistance) Main.LocalPlayer.AddBuff(BuffType(), 2); - - if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && npc.type == NPCType() && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < BossZenDistance) - Main.LocalPlayer.AddBuff(BuffType(), 2); } if (npc.type != NPCType()) @@ -4013,7 +2929,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 @@ -4037,10 +2953,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 || @@ -4304,6 +3216,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: @@ -4313,6 +3227,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); @@ -5278,16 +4193,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; @@ -5296,10 +4201,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: @@ -5318,32 +4219,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; @@ -5352,21 +4232,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: @@ -5507,127 +4372,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 (slowed > 0) - slowed--; - 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--; @@ -5812,7 +4557,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) @@ -5859,23 +4604,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) @@ -5888,10 +4633,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) @@ -5904,10 +4649,7 @@ namespace CalamityMod.NPCs velocitySlownessFactor += baseSlownessFactor; } - if (slowed > 0) - velocitySlownessFactor += 0.05f; - - if (tesla > 0) + if (galvanicCorrosion) { float baseSlownessFactor = 0.05f; if (VulnerableToElectricity.HasValue) @@ -5920,7 +4662,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. @@ -6036,7 +4778,7 @@ namespace CalamityMod.NPCs shocked = 120; } - if (target.Calamity().snowman) + if (target.Transformation().Type == ModContent.ItemType()) { if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon || npc.type == NPCID.RedDevil) target.AddBuff(BuffType(), 36000); @@ -6044,21 +4786,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); @@ -6118,60 +4845,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: @@ -6198,20 +4882,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) { @@ -6316,14 +4988,21 @@ namespace CalamityMod.NPCs } // True melee resists - if (EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper || PerforatorWormIDList.Includes(npc.type) || - AquaticScourgeIDList.Includes(npc.type) || DestroyerIDList.Includes(npc.type) || AstrumDeusIDList.Includes(npc.type) || - StormWeaverIDList.Includes(npc.type) || ThanatosIDList.Includes(npc.type) || npc.type == NPCType() || - npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType()) + if (item.CountsAsClass() && item.type != ItemType()) { - float damageMult = ThanatosIDList.Includes(npc.type) ? 0.35f : npc.type == NPCType() ? 0.8f : 0.5f; - if (item.CountsAsClass() && item.type != ItemType()) - modifiers.SourceDamage *= damageMult; + float damageMult = 1f; + if (npc.type == NPCType()) + damageMult = 0.8f; + else if (CalamityNPCTypeSets.EaterOfWorlds.Contains(npc.type) || npc.type == NPCID.Creeper || npc.type == NPCType()) + damageMult = 0.75f; + 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 (CalamityNPCTypeSets.Thanatos.Contains(npc.type)) + damageMult = 0.35f; + + modifiers.SourceDamage *= damageMult; } } #endregion @@ -6467,27 +5146,27 @@ namespace CalamityMod.NPCs if (!projectile.npcProj && !projectile.trap) { // Plague Reaper deals 1.1x damage to Plagued enemies - if (projectile.CountsAsClass() && modPlayer.plagueReaper && pFlames > 0) + if (projectile.CountsAsClass() && modPlayer.plagueReaper && plague) modifiers.SourceDamage *= 1.1f; // 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; } // 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 60% - bool hasResist = EaterOfWorldsIDList.Includes(npc.type) && !Main.expertMode; + 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.4f; + modifiers.SourceDamage *= 0.33f; } if (modPlayer.camper && !player.StandingStill()) @@ -6574,7 +5253,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); } @@ -6628,7 +5307,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); } @@ -6640,26 +5319,6 @@ namespace CalamityMod.NPCs #region Check Dead public override bool CheckDead(NPC npc) { - if (npc.type == NPCID.SkeletronPrime) - { - if (CalamityWorld.death || BossRushEvent.BossRushActive) - { - // Kill the other head if he's still alive when this head dies - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == NPCType() && nPC.life > 0) - { - nPC.life = 0; - nPC.HitEffect(); - nPC.checkDead(); - nPC.active = false; - nPC.netUpdate = true; - } - } - } - } - if (npc.lifeMax > 1000 && npc.type != NPCID.DungeonSpirit && npc.type != NPCType() && npc.type != NPCType() && @@ -6724,7 +5383,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int slimeAmt = Main.getGoodWorld ? Main.rand.Next(6) + 10 : Main.rand.Next(2) + 2; // 2 to 3 extra + int slimeAmt = CalamityWorld.LegendaryMode ? Main.rand.Next(6) + 10 : 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); @@ -6732,8 +5391,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) * (Main.getGoodWorld ? 0.5f : 0.1f) + s * npc.direction * (Main.getGoodWorld ? 0.5f : 0.3f); - npc2.velocity.Y -= Main.rand.Next(0, 10) * (Main.getGoodWorld ? 0.5f : 0.1f) + s; + 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.ai[0] = -1000 * Main.rand.Next(3); if (Main.dedServ && slime < Main.maxNPCs) @@ -6746,7 +5405,7 @@ namespace CalamityMod.NPCs case NPCID.CursedHammer: case NPCID.EnchantedSword: case NPCID.CrimsonAxe: - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.justHit = false; break; @@ -6757,13 +5416,13 @@ namespace CalamityMod.NPCs case NPCID.IceTortoise: case NPCID.BlackRecluse: case NPCID.BlackRecluseWall: - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.justHit = false; break; case NPCID.Paladin: - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.justHit = false; break; @@ -6771,13 +5430,13 @@ namespace CalamityMod.NPCs if (npc.type == NPCType()) { - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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) { @@ -6943,8 +5602,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); } @@ -7023,6 +5682,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) || @@ -7293,6 +5958,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) { @@ -7387,11 +6061,6 @@ namespace CalamityMod.NPCs // If the doll is active, Voodoo Demons cannot spawn (via modded means). if (voodooDemonDollActive) pool.Remove(NPCID.VoodooDemon); - // Otherwise, if it's pre-Hardmode, provide a modded spawn entry that makes them much more common. - else if (!Main.hardMode && spawnInfo.Player.ZoneUnderworldHeight && !calamityBiomeZone) - { - pool[NPCID.VoodooDemon] = SpawnCondition.Underworld.Chance * 0.15f; - } } #endregion @@ -7453,8 +6122,14 @@ namespace CalamityMod.NPCs { if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) - 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) @@ -7466,15 +6141,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 @@ -7491,58 +6169,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); @@ -7581,7 +6259,7 @@ namespace CalamityMod.NPCs } } - if (laceration > 0) + if (laceration) Laceration.DrawEffects(npc, ref drawColor); if (laserBurnTimer > 0) @@ -7607,34 +6285,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) @@ -7649,33 +6327,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 (slowed > 0) - { - if (Main.rand.Next(5) < 4) - { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, DustID.SpookyWood, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 225, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.1f; - Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.NextBool()) - { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; - } - } - } - if (webbed > 0) + if (webbed) { if (Main.rand.Next(5) < 4) { @@ -7709,35 +6372,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; } @@ -7747,7 +6410,7 @@ namespace CalamityMod.NPCs if (npc.IsABestiaryIconDummy) return null; - if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode && CalamityWorld.revenge)) + if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode)) return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); if (npc.type == NPCID.KingSlime && CalamityWorld.death) @@ -7773,55 +6436,57 @@ 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/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) @@ -7854,7 +6519,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() { }; @@ -7865,9 +6530,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); @@ -7907,9 +6571,7 @@ namespace CalamityMod.NPCs currentDebuffs.Add(TextureAssets.Buff[BuffID.Confused].Value); if (npc.ichor) currentDebuffs.Add(TextureAssets.Buff[BuffID.Ichor].Value); - if (slowed > 0) - currentDebuffs.Add(TextureAssets.Buff[BuffID.Slow].Value); - if (webbed > 0) + if (webbed) currentDebuffs.Add(TextureAssets.Buff[BuffID.Webbed].Value); if (npc.midas) currentDebuffs.Add(TextureAssets.Buff[BuffID.Midas].Value); @@ -7976,7 +6638,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; @@ -8002,8 +6664,82 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType() || DestroyerIDList.Includes(npc.type)) + if (CalamityNPCTypeSets.Destroyer.Contains(npc.type)) shouldDrawBool = false; + + // Allows correct frames to draw in Rev+ phases + // GFB can rot for all I care + if (npc.type == NPCID.SkeletronPrime && !NPC.IsMechQueenUp) + { + int frameHeight = TextureAssets.Npc[npc.type].Value.Height / Main.npcFrameCount[npc.type]; + if (npc.ai[1] == 0f || npc.ai[1] == 4f) + { + newAI[2] += 1f; + if (newAI[2] >= 12f) + { + newAI[2] = 0f; + newAI[3] += frameHeight; + + if (newAI[3] / frameHeight >= 2f) + newAI[3] = 0f; + } + } + + // Spinning probe spawn or fly over phase + else if (npc.ai[1] == 5f || npc.ai[1] == 6f) + { + newAI[2] = 0f; + newAI[3] = frameHeight; + } + + // Spinning phase + else + { + newAI[2] = 0f; + newAI[3] = frameHeight * 2; + } + + 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)) @@ -8019,31 +6755,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; @@ -8168,7 +6879,7 @@ 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) + if (npc.Calamity().vulnerabilityHex || npc.Calamity().trueVulnerabilityHex) { float compactness = npc.width * 0.6f; if (compactness < 10f) @@ -8177,7 +6888,7 @@ namespace CalamityMod.NPCs if (power > 2.75f) power = 2.75f; 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)); } @@ -8268,7 +6979,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]; @@ -8407,7 +7118,7 @@ namespace CalamityMod.NPCs // Laser telegraph else if (npc.type == NPCID.Probe) { - float eyeTelegraphGateValue = (NPC.IsMechQueenUp ? DestroyerAI.ProbeLaserGateValue_Mechdusa : BossRushEvent.BossRushActive ? DestroyerAI.ProbeLaserGateValue_BossRush : revenge ? DestroyerAI.ProbeLaserGateValue_Rev : DestroyerAI.ProbeLaserGateValue) - DestroyerAI.ProbeLaserTelegraphTime; + float eyeTelegraphGateValue = (NPC.IsMechQueenUp ? DestroyerAI.ProbeLaserGateValue_Mechdusa : revenge ? DestroyerAI.ProbeLaserGateValue_Rev : DestroyerAI.ProbeLaserGateValue) - DestroyerAI.ProbeLaserTelegraphTime; Texture2D glowTexture = Request("CalamityMod/Particles/Sparkle").Value; Vector2 halfSize = npc.frame.Size() / 2; @@ -8439,7 +7150,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) opacity = 1f; opacity = MathHelper.Clamp(opacity, 0f, 1f); @@ -8554,83 +7265,6 @@ namespace CalamityMod.NPCs } } - // His afterimages I can't get to work, so fuck it - else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) - { - Texture2D npcTexture = (death && npc.type == NPCID.SkeletronPrime) ? ExtraTextureRefs.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; - int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; - - npc.frame.Y = (int)newAI[3]; - - // Mechdusa drawing - if (NPC.IsMechQueenUp) - { - if (npc.ai[1] == 0f || npc.ai[1] == 4f) - { - newAI[2] += 1f; - if (newAI[2] >= 12f) - { - newAI[2] = 0f; - newAI[3] += frameHeight; - if (newAI[3] / frameHeight >= 5) - newAI[3] = frameHeight * 3; - } - } - else - { - newAI[2] = 0f; - newAI[3] = frameHeight * 5; - } - } - - // Floating phase - else if (npc.ai[1] == 0f || npc.ai[1] == 4f) - { - newAI[2] += 1f; - if (newAI[2] >= 12f) - { - newAI[2] = 0f; - newAI[3] += frameHeight; - - if (newAI[3] / frameHeight >= 2f) - newAI[3] = 0f; - } - } - - // Spinning probe spawn or fly over phase - else if (npc.ai[1] == 5f || npc.ai[1] == 6f) - { - newAI[2] = 0f; - newAI[3] = frameHeight; - } - - // Spinning phase - else - { - newAI[2] = 0f; - newAI[3] = frameHeight * 2; - } - - npc.frame.Y = (int)newAI[3]; - - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - - Color eyesColor = new Color(200, 200, 200, 0); - if (death) - { - int alpha = 192; - eyesColor = npc.type == NPCType() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha); - Texture2D glowTexture = npc.type == NPCID.SkeletronPrime ? ExtraTextureRefs.ChadPrimeEyeGlowmask.Value : SkeletronPrime2.EyeTexture.Value; - spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - } - else - spriteBatch.Draw(TextureAssets.BoneEyes.Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - } - else if (npc.type == NPCID.Plantera) { // Percent life remaining @@ -9047,8 +7681,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]; @@ -9090,13 +7723,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; } @@ -9727,37 +8360,6 @@ namespace CalamityMod.NPCs } #endregion - #region Adjust Difficulty Stat Scaling - // Adjust HP and damage in Master Mode - public static void AdjustMasterModeStatScaling(NPC npc, bool isABoss = false) - { - if (!Main.masterMode) - return; - - // Bosses and enemies have separate HP reduction multipliers - npc.lifeMax = (int)Math.Round(npc.lifeMax * (isABoss ? MasterModeBossHPMultiplier : MasterModeEnemyHPMultiplier)); - - // Bosses do not get their damage reduced - if (!isABoss) - npc.damage = (int)Math.Round(npc.damage * MasterModeEnemyDamageMultiplier); - } - - // Adjust only knockback resist in Expert Mode (this is also adjusted in Master Mode because Expert has to be enabled if Master is enabled) - public static void AdjustExpertModeStatScaling(NPC npc) - { - if (!Main.expertMode) - return; - - if (npc.knockBackResist <= 0f) - return; - - // Knockback resist is backasswards in this fucking game so we need to add to the knockBackResist variable here :^) - float knockBackResistMult = Main.masterMode ? MasterModeEnemyKnockbackMultiplier : ExpertModeEnemyKnockbackMultiplier; - float knockBackResistReduction = npc.knockBackResist * knockBackResistMult; - npc.knockBackResist += knockBackResistReduction; - } - #endregion - #region Bestiary public override void SetBestiary(NPC npc, BestiaryDatabase database, BestiaryEntry bestiaryEntry) { diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index cb31ae999e..23980eeaa4 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -178,12 +178,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 3, 2)); break; - // Skeleton Merchant - // Punch Card @ 100% - case NPCID.SkeletonMerchant: - npcLoot.Add(ModContent.ItemType()); - break; - // Skeleton Archer // Magic Quiver @ 5% (2.5% in Vanilla) // Marrow @ 2.5% (0.5% in Vanilla) @@ -280,8 +274,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 @@ -289,10 +291,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 @@ -551,7 +562,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% @@ -684,11 +700,15 @@ 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) @@ -982,15 +1002,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 @@ -1887,58 +1907,18 @@ 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 - - // Blanket remove all specific food item drops that have changed obtainment methods in Calamity - // This is type-indiscriminate and will also most probably hit modded NPCs too - - // CIT 7NOV2024: Yeah it hits modded NPCs; in fact it removes GFB drops from Ravager and Deus - // Fixing this by making the code only run if the NPC is not a boss - if (!npc.boss) - { - int[] randomFoodItems = new int[] -{ - ItemID.ApplePie, - ItemID.BananaSplit, - ItemID.BBQRibs, - ItemID.Burger, - ItemID.MilkCarton, - ItemID.ChocolateChipCookie, - ItemID.CoffeeCup, - ItemID.CreamSoda, - ItemID.FriedEgg, - ItemID.Fries, - ItemID.Grapes, - ItemID.Hotdog, - ItemID.IceCream, - ItemID.Milkshake, - ItemID.Nachos, - ItemID.Pizza, - ItemID.PotatoChips, - ItemID.ShrimpPoBoy, - ItemID.Spaghetti, - ItemID.Steak -}; - foreach (int foodItemID in randomFoodItems) - npcLoot.RemoveWhere((rule) => rule is ItemDropWithConditionRule foodRule && foodRule.itemId == foodItemID); - } } #endregion @@ -1970,7 +1950,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 @@ -2058,7 +2038,7 @@ namespace CalamityMod.NPCs break; case NPCID.WallofFlesh: - SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Painter, NPCID.WitchDoctor, NPCID.Stylist, NPCID.DyeTrader, NPCID.Demolitionist, NPCID.PartyGirl, NPCID.Clothier, NPCID.SkeletonMerchant, NPCID.BestiaryGirl }, Main.hardMode); + SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Painter, NPCID.WitchDoctor, NPCID.Stylist, NPCID.DyeTrader, NPCID.Demolitionist, NPCID.PartyGirl, NPCID.Clothier, NPCID.SkeletonMerchant }, Main.hardMode); SetNewBossJustDowned(npc); if (!Main.hardMode && !BossRushEvent.BossRushActive) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 2e8c0548e0..8a16a17f33 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -75,7 +75,6 @@ namespace CalamityMod.NPCs }; private static readonly string[] ArmsDealerNames = { - "Drifter", "Finchi", "Heniek", // <@!363404700445442050> (kazurgundu) "Fire", // <@!354362326947856384> (ultimatefirewaster) @@ -90,6 +89,7 @@ namespace CalamityMod.NPCs { "Joeseph Jostar", "Storm Havik", // <@!1013452363178197072> (fishnotduck) + "Magorfis Splunt the Greater Finklejim", // <@!147490809334333440> (eidolbyssus) }; private static readonly string[] CyborgNames = { @@ -100,7 +100,6 @@ namespace CalamityMod.NPCs { "Tavish DeGroot", // <@!442447226992721930> (magicoal) "Fimmy", // <@!407348617079160832> (darkmega5) - "Dorira", // <@!215269032360804352> (crimsoncb) "John Helldiver", // <@!614126424751603714> (exellent.) }; private static readonly string[] DryadNames = @@ -110,6 +109,7 @@ namespace CalamityMod.NPCs "Jasmine", // <@!430532867479699456> (phantasmagoria.) "Cybil", // <@!486507232666845185> (Captain Doofus#????) "Ruth", // <@!1001307586068492388> (briny_coffee) + "Kanna", // <@!730203712898859018> (cosmoredeathwish) }; private static readonly string[] DyeTraderNames = null; private static readonly string[] GoblinTinkererNames = @@ -188,10 +188,10 @@ 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 = { - "Catalyst", // <@!156672312425316352> (xaqult) "Nyapano", // <@!120976656826368003> (nyapano) "Jade", // <@!187395834625785869> (verymasterninja) "Nyavi Aceso", // <@!270260920888852480> (navigator.) @@ -204,6 +204,7 @@ namespace CalamityMod.NPCs private static readonly string[] SantaClausNames = { "Jank", // <@!339950757472239616> (jankle_) + "Aoi Kurashiki", // <@!358411687885537291> (nothinpurrsonal) }; private static readonly string[] SkeletonMerchantNames = { @@ -221,6 +222,7 @@ namespace CalamityMod.NPCs "Linn", // <@!277983612383526913> (duckycolors) "Eira", // <@!1166136068408623234> (taela_gemetha) "Kreutz", // <@!553445849149997056> (red_r_kreutz) + "Cathlyn", // <@!156672312425316352> (xaqult) }; private static readonly string[] StylistNames = { @@ -245,13 +247,15 @@ 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 = { "Aldrimil", // <@!413719640238194689> (Thorioum#2475) "Wonton", // <@!1198092982923043040> (imonthatgudkush) + "Mad Lad", // <@!215269032360804352> (crimsoncb) }; private static readonly string[] WitchDoctorNames = { @@ -270,6 +274,7 @@ namespace CalamityMod.NPCs "Chris Tallballs", // <@!770211589076418571> (vysterx) (previously: bewearium) "Syethas", // <@!325413275066171393> (cosmicstariight) "Nextdoor Psycho", // <@!173261518572486656> (nextdoorpsycho) + "Mike Cyclops", // <@!702327497475227741> (seichoseicho) }; private static readonly string[] ZoologistNames = { @@ -280,6 +285,19 @@ namespace CalamityMod.NPCs "Gwenhwyvar", // <@!291342874497515531> (diamondnife) "Daxie", // <@!465438861103988737> (daxie626) }; + // Town Slimes + private static readonly string[] ClumsySlimeNames = null; + private static readonly string[] CoolSlimeNames = null; + private static readonly string[] DivaSlimeNames = null; + private static readonly string[] ElderSlimeNames = null; + private static readonly string[] MysticSlimeNames = null; + private static readonly string[] NerdySlimeNames = + { + "Big Blungus", // <@!272759434282008577> (schmoov) + "Rimuru Tempest", // <@!806463201398358036> (c0d3_404) + }; + private static readonly string[] SquireSlimeNames = null; + private static readonly string[] SurlySlimeNames = null; // The following sets are for the 1.4 Town Pets: Town Dogs, Cats and Bunnies. // All three pet types come in numerous breeds. Each breed has its own name pool. @@ -342,6 +360,8 @@ namespace CalamityMod.NPCs { "Felix", // <@!183424826407518208> (lilac_vrt_olligoci) "Tardo", // <@!739343546867384391> (midnight295) + "Dali", // <@!460238880436781061> (darthlego) + "Kiba", // <@!852348657072340992> (jollydragonslayer) }; private static readonly string[] TownCatRussianBlueNames = null; private static readonly string[] TownCatSilverNames = @@ -359,6 +379,7 @@ namespace CalamityMod.NPCs private static readonly string[] TownBunnyNames = { "Poco", // <@!1192261996146593872> (tostitomuncher33) + "Puffer", // <@!181103507711983616> (piky) }; private static readonly string[] TownBunnyWhiteNames = null; private static readonly string[] TownBunnyAngoraNames = null; @@ -597,6 +618,32 @@ namespace CalamityMod.NPCs AddNewNames(nameList, ZoologistNames); break; + // Town Slimes + case NPCID.TownSlimePurple: // Clumsy Slime + AddNewNames(nameList, ClumsySlimeNames); + break; + case NPCID.TownSlimeGreen: // Cool Slime + AddNewNames(nameList, CoolSlimeNames); + break; + case NPCID.TownSlimeRainbow: // Diva Slime + AddNewNames(nameList, DivaSlimeNames); + break; + case NPCID.TownSlimeOld: // Elder Slime + AddNewNames(nameList, ElderSlimeNames); + break; + case NPCID.TownSlimeYellow: // Mystic Slime + AddNewNames(nameList, MysticSlimeNames); + break; + case NPCID.TownSlimeBlue: // Nerdy Slime + AddNewNames(nameList, NerdySlimeNames); + break; + case NPCID.TownSlimeCopper: // Squire Slime + AddNewNames(nameList, SquireSlimeNames); + break; + case NPCID.TownSlimeRed: // Surly Slime + AddNewNames(nameList, SurlySlimeNames); + break; + // This function doesn't work with Town Pets currently case NPCID.TownCat: AddNewNames(nameList, TownCatNames); @@ -1035,10 +1082,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) @@ -1106,10 +1151,10 @@ namespace CalamityMod.NPCs bool happy = Main.LocalPlayer.currentShoppingSettings.PriceAdjustment <= 0.9; Condition hasFlareGunUpgrade = new(CalamityUtils.GetText("Condition.HasFlareGun"), () => (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); + Condition bestiaryProgressLacewing = new(CalamityUtils.GetText("Condition.LacewingBestiary"), () => Main.GetBestiaryProgressReport().CompletionPercent >= 0.4f); Condition roguePlayer = CalamityConditions.PlayerHasRogueArmor; Condition wingedPlayer = CalamityConditions.PlayerHasWings; Condition revengeance = CalamityConditions.InRevengeanceMode; - Condition drunk = CalamityConditions.PlayerAlcoholPoisoned; Condition downedPolterghast = CalamityConditions.DownedPolterghast; Condition downedDoG = CalamityConditions.DownedDevourerOfGods; @@ -1119,10 +1164,7 @@ namespace CalamityMod.NPCs .AddWithCustomValue(ItemID.WormholePotion, Item.buyPrice(silver: 5), Condition.HappyEnoughToSellPylons); shop.Add(ItemID.Flare, hasFlareGunUpgrade) .Add(ItemID.BlueFlare, hasFlareGunUpgrade) - .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())) - .AddWithCustomValue(ItemID.Burger, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.Hotdog, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.CoffeeCup, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons); + .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())); } if (type == NPCID.DyeTrader) @@ -1168,7 +1210,6 @@ namespace CalamityMod.NPCs shop.AddWithCustomValue(ItemID.JungleRose, Item.buyPrice(gold: 2)) .AddWithCustomValue(ItemID.NaturesGift, Item.buyPrice(gold: 10)) .Add(ItemType()) - .AddWithCustomValue(ItemID.Grapes, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) .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 @@ -1178,8 +1219,7 @@ namespace CalamityMod.NPCs if (type == NPCID.GoblinTinkerer) { shop.Add(ItemType()) - .Add(ItemID.Toolbox, Condition.NpcIsPresent(NPCID.Mechanic)) - .AddWithCustomValue(ItemID.Spaghetti, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron); + .Add(ItemID.Toolbox, Condition.NpcIsPresent(NPCID.Mechanic)); } if (type == NPCID.Mechanic) @@ -1236,15 +1276,12 @@ namespace CalamityMod.NPCs .Add(ItemType()) .Add(ItemType()) .Add(ItemType()) - .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 10), Condition.DownedGolem) - .AddWithCustomValue(ItemID.FriedEgg, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons); + .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 10), Condition.DownedGolem); } if (type == NPCID.PartyGirl) { - shop.AddWithCustomValue(ItemID.GenderChangePotion, Item.buyPrice(silver: 25), Condition.HappyEnoughToSellPylons) - .AddWithCustomValue(ItemID.Pizza, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.CreamSoda, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons); + shop.AddWithCustomValue(ItemID.GenderChangePotion, Item.buyPrice(silver: 25), Condition.HappyEnoughToSellPylons); } if (type == NPCID.Princess) @@ -1256,7 +1293,6 @@ namespace CalamityMod.NPCs 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) @@ -1273,14 +1309,10 @@ namespace CalamityMod.NPCs .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 12)); } - if (type == NPCID.Golfer) - { - shop.AddWithCustomValue(ItemID.PotatoChips, Item.buyPrice(gold: 1), Condition.HappyEnoughToSellPylons); - } if (type == NPCID.BestiaryGirl) { - shop.AddWithCustomValue(ItemID.Steak, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.Hardmode); + shop.AddWithCustomValue(ItemID.EmpressButterfly, Item.buyPrice(gold: 15), bestiaryProgressLacewing); } if (type == NPCID.Truffle) @@ -1288,6 +1320,29 @@ namespace CalamityMod.NPCs shop.Add(ItemType()); } } + + public override void ModifyActiveShop(NPC npc, string shopName, Item[] items) + { + // TODO: Uses a hardcoded string since dedicated names are currently hardcoded strings + // Will need to be changed if dedicated names are localized in the future + if (npc.type == NPCID.SkeletonMerchant && npc.GivenName == "Sans Undertale") + { + int index = 0; + for (int i = 0; i < Chest.maxItems; i++) + { + if (items[i] == null) + { + index = i; + break; + } + } + var punch = new Item(ItemType()) + { + shopCustomPrice = Item.buyPrice(gold: 10) + }; + items[index] = punch; + } + } #endregion } } diff --git a/NPCs/CalamityPierceResistance.cs b/NPCs/CalamityPierceResistance.cs index c69f0b3ad7..c51808476c 100644 --- a/NPCs/CalamityPierceResistance.cs +++ b/NPCs/CalamityPierceResistance.cs @@ -70,6 +70,9 @@ namespace CalamityMod.NPCs singleHitboxExemptProjectiles[ProjectileID.NettleBurstLeft] = true; singleHitboxExemptProjectiles[ProjectileID.NettleBurstRight] = true; singleHitboxExemptProjectiles[ProjectileID.PrincessWeapon] = true; + singleHitboxExemptProjectiles[ProjectileID.ToxicCloud] = true; + singleHitboxExemptProjectiles[ProjectileID.ToxicCloud2] = true; + singleHitboxExemptProjectiles[ProjectileID.ToxicCloud3] = true; var projectileTypes = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code) .Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ModProjectile))); @@ -145,7 +148,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 cc077b9f94..b330aaeae8 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -28,6 +28,7 @@ using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using CalamityMod.UI; namespace CalamityMod.NPCs.CeaselessVoid { @@ -41,6 +42,8 @@ namespace CalamityMod.NPCs.CeaselessVoid public bool playedbuildsound = false; + public bool madeItToLocation = true; + public override void SetStaticDefaults() { Main.npcFrameCount[Type] = 6; @@ -58,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; @@ -78,9 +84,6 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.DeathSound = DeathSound; NPC.Calamity().canBreakPlayerDefense = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -133,10 +136,9 @@ namespace CalamityMod.NPCs.CeaselessVoid double lifeRatio = NPC.life / (double)NPC.lifeMax; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Phases bool phase2 = lifeRatio <= 0.7; @@ -154,7 +156,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (phase4) darkEnergyAmt += 1; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) darkEnergyAmt *= 2; // Spawn a few Dark Energies as soon as the fight starts @@ -187,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 && !bossRush && 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; @@ -212,24 +211,23 @@ namespace CalamityMod.NPCs.CeaselessVoid else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - float tileEnrageMult = (CalamityWorld.LegendaryMode && revenge) ? 1.5f : bossRush ? 1.375f : 1f; - NPC.Calamity().CurrentlyEnraged = tileEnrageMult > 1f && !bossRush; + float maliceBuffMult = CalamityWorld.MaliceMode ? 1.5f : 1f; // Set AI variable to be used by Dark Energies - NPC.ai[1] = tileEnrageMult; + NPC.ai[1] = maliceBuffMult; // 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 = MathHelper.Lerp(0.5f, 1.5f, 1f - ((maliceBuffMult - 1f) / 0.5f)); // Decides whether Ceaseless moves closer to its target or not - float distanceRequiredToMove = (Main.getGoodWorld || !anyDarkEnergies) ? 320f : bossRush ? 600f : 720f; + float distanceRequiredToMove = CalamityWorld.LegendaryMode ? 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 : bossRush ? 1920f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; + float suckDistance = CalamityWorld.MaliceMode ? 2400f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; // Move closer to the target before trying to succ if (movingDuringSuccPhase) @@ -344,15 +342,14 @@ namespace CalamityMod.NPCs.CeaselessVoid { if (calamityGlobalNPC.newAI[1] == 0f) { - int numBeamPortals = bossRush ? 4 : revenge ? 3 : 2; + int numBeamPortals = revenge ? 3 : 2; float degrees = 360 / numBeamPortals; - float beamPortalDistance = bossRush ? 360f : death ? 400f : revenge ? 420f : expertMode ? 440f : 480f; + 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); } } } @@ -378,7 +375,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; @@ -388,7 +384,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); } } @@ -406,7 +402,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; @@ -420,7 +415,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); } } } @@ -437,7 +432,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; @@ -451,7 +445,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); } } } @@ -462,8 +456,11 @@ namespace CalamityMod.NPCs.CeaselessVoid { // Avoid cheap bullshit NPC.damage = 0; - if (move) + { + madeItToLocation = false; + } + if (!madeItToLocation) { Movement(false); } @@ -486,7 +483,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } // Destroy all Dark Energies if their total HP is below 20% - int darkEnergyMaxHP = bossRush ? DarkEnergy.MaxBossRushHP : DarkEnergy.MaxHP; + int darkEnergyMaxHP = BossRushEvent.BossRushActive ? DarkEnergy.MaxBossRushHP : DarkEnergy.MaxHP; //These are still needed so that CV Dark energy despawn works properly double HPBoost = CalamityServerConfig.Instance.BossHealthBoost * 0.01; darkEnergyMaxHP += (int)(darkEnergyMaxHP * HPBoost); @@ -530,8 +527,8 @@ namespace CalamityMod.NPCs.CeaselessVoid // Basic movement towards a location void Movement(bool succ) { - float velocity = moveVeryFast ? 25f : bossRush ? 15f : ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)) * tileEnrageMult; - float acceleration = (moveVeryFast ? 0.75f : bossRush ? 0.3f : 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)) * maliceBuffMult; + float acceleration = (death ? 0.2f : expertMode ? 0.16f : 0.12f) + (float)(death ? 0.04f * (1D - lifeRatio) : 0f) * maliceBuffMult; // Increase speed dramatically in succ phase if (succ) @@ -540,7 +537,14 @@ namespace CalamityMod.NPCs.CeaselessVoid acceleration *= 2f; } - if (Main.getGoodWorld) + if (!madeItToLocation) + { + + velocity *= 2f; + acceleration *= 5f; + } + + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -550,12 +554,12 @@ namespace CalamityMod.NPCs.CeaselessVoid // Move between 8 different positions around the player, in order float maxDistance = 320f; - Vector2 moveToOffset = succ ? Vector2.Zero : Main.getGoodWorld ? new Vector2(0f, -maxDistance) : Vector2.Zero; - if (!succ && Main.getGoodWorld) + Vector2 moveToOffset = succ ? Vector2.Zero : CalamityWorld.LegendaryMode ? new Vector2(0f, -maxDistance) : Vector2.Zero; + if ((!succ && CalamityWorld.LegendaryMode) || !madeItToLocation) { // Move to a new location every few seconds calamityGlobalNPC.newAI[2] += 1f; - float newPositionGateValue = bossRush ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; + float newPositionGateValue = death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; if (calamityGlobalNPC.newAI[2] > newPositionGateValue) { calamityGlobalNPC.newAI[2] = 0f; @@ -564,37 +568,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.ai[0] > 7f) NPC.ai[0] = 0f; } - - switch ((int)NPC.ai[0]) - { - case 0: - break; - case 1: - moveToOffset.X = -maxDistance; - break; - case 2: - moveToOffset.X = -maxDistance; - moveToOffset.Y = 0f; - break; - case 3: - moveToOffset.X = -maxDistance; - moveToOffset.Y = maxDistance; - break; - case 4: - moveToOffset.Y = maxDistance; - break; - case 5: - moveToOffset.X = maxDistance; - moveToOffset.Y = maxDistance; - break; - case 6: - moveToOffset.X = maxDistance; - moveToOffset.Y = 0f; - break; - case 7: - moveToOffset.X = maxDistance; - break; - } + moveToOffset += new Vector2(maxDistance, 0).RotatedBy(NPC.ai[0] / 8f * MathHelper.TwoPi); } destination += moveToOffset; @@ -603,8 +577,12 @@ namespace CalamityMod.NPCs.CeaselessVoid Vector2 distanceFromDestination = destination - NPC.Center; // Movement - if (NPC.Distance(destination) > maxDistance || succ || !Main.getGoodWorld) + if (NPC.Distance(destination) > maxDistance || succ || (!CalamityWorld.LegendaryMode && !madeItToLocation)) CalamityUtils.SmoothMovement(NPC, 0f, distanceFromDestination, velocity, acceleration, true); + if (NPC.Distance(destination) < 80) + { + madeItToLocation = true; + } } // Spawn more Dark Energies as the fight progresses @@ -631,6 +609,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { if (phase4) { + madeItToLocation = false; for (int i = 0; i < darkEnergyAmt; i++) { for (int j = 0; j < 3; j++) @@ -641,6 +620,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } else if (phase3) { + madeItToLocation = false; for (int i = 0; i < darkEnergyAmt; i++) { for (int j = 0; j < 3; j++) @@ -651,6 +631,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } else { + madeItToLocation = false; for (int i = 0; i < darkEnergyAmt; i++) { for (int j = 0; j < 3; j++) @@ -820,7 +801,7 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemType(); } @@ -830,12 +811,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 52f34259d9..c242ed17af 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; @@ -59,10 +59,6 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.HitSound = SoundID.NPCHit53; NPC.DeathSound = SoundID.NPCDeath44; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -123,7 +119,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.Opacity > 1f) NPC.Opacity = 1f; - NPC.scale = MathHelper.Lerp(0.05f, Main.getGoodWorld ? 0.5f : 1f, NPC.Opacity); + NPC.scale = MathHelper.Lerp(0.05f, CalamityWorld.LegendaryMode ? 0.5f : 1f, NPC.Opacity); } else { @@ -161,16 +157,15 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.timeLeft = 1800; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + 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 = bossRush ? 1200D : death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; + 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; if (NPC.Calamity().newAI[0] == 0f) @@ -284,7 +279,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 2c3e928208..7a979cac62 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -28,16 +28,16 @@ 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; - NPC.lifeMax = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 180 : 15; + NPC.lifeMax = CalamityWorld.LegendaryMode ? 180 : 15; if (BossRushEvent.BossRushActive) - NPC.lifeMax = 8000; - if (Main.getGoodWorld) + NPC.lifeMax = 6000; + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; AIType = -1; NPC.knockBackResist = 0.5f; @@ -48,10 +48,6 @@ namespace CalamityMod.NPCs.Crabulon NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) @@ -70,8 +66,8 @@ namespace CalamityMod.NPCs.Crabulon bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float xVelocityLimit = BossRushEvent.BossRushActive ? 12f : death ? 8f : revenge ? 6f : 5f; - float yVelocityLimit = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; + float xVelocityLimit = death ? 8f : revenge ? 6f : 5f; + float yVelocityLimit = CalamityWorld.LegendaryMode ? 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) @@ -103,7 +99,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.rotation = NPC.velocity.X * 0.1f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { float pushVelocity = 0.5f; foreach (NPC n in Main.ActiveNPCs) diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index fedab5f87a..73e9f8147d 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,21 +90,18 @@ 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { NPC.scale *= 1.5f; NPC.defense += 12; } - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -132,10 +131,9 @@ namespace CalamityMod.NPCs.Crabulon { Lighting.AddLight(NPC.Center, 0f, 0.3f, 0.7f); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; NPC.spriteDirection = NPC.direction; @@ -185,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) && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - if (biomeEnraged && (!player.ZoneGlowshroom || bossRush)) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - - if (Main.getGoodWorld) - enrageScale += 0.5f; - if (NPC.ai[0] < 2f) { int mushBombAmt = phase4 ? 6 : phase3 ? 3 : phase2 ? 2 : 1; @@ -240,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); } } } @@ -278,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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) walkingVelocity *= 2f; bool shouldWalkSlower = false; @@ -409,7 +381,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.ai[1] += 1f; } - float jumpGateValue = (bossRush ? 15f : expertMode ? 60f : 120f) / (enrageScale + 1f); + float jumpGateValue = expertMode ? 60f : 120f; if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -517,26 +489,25 @@ 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))) { SoundEngine.PlaySound(SoundID.Item42, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - float projectileVelocity = BossRushEvent.BossRushActive ? 24f : CalamityWorld.death ? 15f : 10f; + float projectileVelocity = CalamityWorld.death ? 15f : 10f; Vector2 destination = new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center; destination.Normalize(); destination *= projectileVelocity; // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = bossRush ? 24 : phase4 ? 14 : CalamityWorld.death ? (phase3 ? 10 : 16) : 12; + int numProj = phase4 ? 14 : CalamityWorld.death ? (phase3 ? 10 : 16) : 12; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < numProj; i++) { 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); } } } @@ -549,19 +520,19 @@ namespace CalamityMod.NPCs.Crabulon SoundEngine.PlaySound(SoundID.Item42, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - float projectileVelocity = BossRushEvent.BossRushActive ? 24f : CalamityWorld.death ? 15f : 10f; + float projectileVelocity = CalamityWorld.death ? 15f : 10f; Vector2 destination = new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center; destination.Normalize(); destination *= projectileVelocity; // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = bossRush ? 16 : phase4 ? 8 : (phase3 && death) ? 6 : 8; + int numProj = phase4 ? 8 : (phase3 && death) ? 6 : 8; float rotation = MathHelper.ToRadians(60); for (int i = 0; i < numProj; i++) { 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); } } } @@ -643,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) @@ -719,7 +690,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.ai[3] = NPC.Bottom.Y; NPC.noTileCollide = true; - float leapVelocity = bossRush ? 24f : death ? 18f : 16f; + float leapVelocity = death ? 18f : 16f; NPC.velocity = center - NPC.Center; NPC.velocity = NPC.velocity.SafeNormalize(Vector2.Zero); NPC.velocity *= leapVelocity; @@ -740,7 +711,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) { @@ -750,11 +720,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); } } @@ -774,7 +744,6 @@ namespace CalamityMod.NPCs.Crabulon NPC.netUpdate = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -784,10 +753,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(0, 81), 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) @@ -876,7 +845,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); @@ -889,7 +857,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; @@ -907,17 +875,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; @@ -982,7 +949,7 @@ namespace CalamityMod.NPCs.Crabulon { if (Main.netMode != NetmodeID.MultiplayerClient) { - int crabShroomSpawnFreq = (int)(NPC.lifeMax * ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.01 : Main.getGoodWorld ? 0.02 : 0.05)); + int crabShroomSpawnFreq = (int)(NPC.lifeMax * (CalamityWorld.LegendaryMode ? 0.02 : 0.05)); if ((NPC.life + crabShroomSpawnFreq) < NPC.localAI[0]) { NPC.localAI[0] = NPC.life; @@ -994,8 +961,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) * (Main.getGoodWorld ? 0.2f : 0.1f); - Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (Main.getGoodWorld ? 0.2f : 0.1f); + 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); if (Main.dedServ && crabShroom < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, crabShroom); } @@ -1003,6 +970,7 @@ namespace CalamityMod.NPCs.Crabulon } } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; // Can only hit the target if within certain distance public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -1261,7 +1229,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 622541bb79..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) @@ -47,10 +47,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index b9db14ce14..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; @@ -55,10 +54,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index 1c14f41f6e..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; @@ -47,10 +47,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/InfernalCongealment.cs b/NPCs/Crags/InfernalCongealment.cs index e398dc8703..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; @@ -48,10 +48,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/RenegadeWarlock.cs b/NPCs/Crags/RenegadeWarlock.cs index b2d3445b4a..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) @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 22af9262fa..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; @@ -53,10 +53,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 310531060d..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; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 9e3be9a95a..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; @@ -60,10 +59,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 0f477936d4..adb129ed17 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; if (Main.zenithWorld) @@ -126,9 +130,6 @@ namespace CalamityMod.NPCs.Cryogen NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; } - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -183,34 +184,9 @@ namespace CalamityMod.NPCs.Cryogen Player player = Main.player[NPC.target]; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - // Enrage - if (!player.ZoneSnow && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - - float enrageScale = death ? 0.5f : 0f; - if (biomeEnraged) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - - if (enrageScale > 2f) - enrageScale = 2f; - - if (bossRush) - enrageScale = 3f; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -294,7 +270,7 @@ namespace CalamityMod.NPCs.Cryogen else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { int spawnType = Main.zenithWorld ? NPCID.RedDevil : NPCID.IceGolem; if (!NPC.AnyNPCs(spawnType)) @@ -320,15 +296,15 @@ namespace CalamityMod.NPCs.Cryogen } } - float chargePhaseGateValue = bossRush ? 240f : 360f; + float chargePhaseGateValue = 360f; float chargeDuration = 60f; - float chargeTelegraphTime = NPC.ai[0] == 2f ? ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 60f : 80f) : ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 90f : 120f); + float chargeTelegraphTime = NPC.ai[0] == 2f ? (CalamityWorld.LegendaryMode ? 60f : 80f) : (CalamityWorld.LegendaryMode ? 90f : 120f); float chargeTelegraphMaxRotationIncrement = 1f; float chargeTelegraphRotationIncrement = chargeTelegraphMaxRotationIncrement / chargeTelegraphTime; float chargeSlowDownTime = 15f; - float chargeVelocityMin = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 24f : 12f; - float chargeVelocityMax = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 42f : 30f; - if (Main.getGoodWorld) + float chargeVelocityMin = CalamityWorld.LegendaryMode ? 24f : 12f; + float chargeVelocityMax = CalamityWorld.LegendaryMode ? 42f : 30f; + if (CalamityWorld.LegendaryMode) { chargePhaseGateValue *= 0.7f; chargeDuration *= 0.8f; @@ -340,7 +316,7 @@ namespace CalamityMod.NPCs.Cryogen if (expertMode && (NPC.ai[0] < 5f || !phase6) && !chargePhase) { calamityGlobalNPC.newAI[3] += 1f; - if (calamityGlobalNPC.newAI[3] >= (bossRush ? 660f : 900f)) + if (calamityGlobalNPC.newAI[3] >= 900f) { calamityGlobalNPC.newAI[3] = 0f; SoundEngine.PlaySound(Main.zenithWorld ? SoundID.NPCHit41 : HitSound, NPC.Center); @@ -350,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; @@ -359,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); } } } @@ -382,11 +357,10 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 24 : 16; + 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; @@ -395,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); } } } @@ -406,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -458,11 +431,10 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 18 : 12; + 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; @@ -471,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) { @@ -538,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); @@ -559,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); } } } @@ -578,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) { @@ -656,11 +625,10 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 18 : 12; + 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; @@ -669,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); } } } @@ -680,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -708,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); @@ -729,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); } } } @@ -748,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) { @@ -819,11 +785,10 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 18 : 12; + 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; @@ -832,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); } } } @@ -843,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -927,11 +891,10 @@ 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 = bossRush ? 9 : 6; + int totalProjectiles = 6; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = velocity - (velocity * 0.33f * i); float projectileVelocityToPass = 0f; @@ -949,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); } } } @@ -1019,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)) { @@ -1028,12 +991,11 @@ 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++) { - int totalProjectiles = bossRush ? 3 : 2; + int totalProjectiles = 2; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = velocity - (velocity * (phase7 ? 0.25f : 0.5f) * i); float projectileVelocityToPass = 0f; @@ -1052,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); } } } @@ -1096,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; @@ -1130,7 +1092,7 @@ namespace CalamityMod.NPCs.Cryogen } float inertia = 30f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerchargeXDist) / (inertia + 1f); @@ -1156,14 +1118,13 @@ namespace CalamityMod.NPCs.Cryogen NPC.rotation = NPC.velocity.X * 0.1f; calamityGlobalNPC.newAI[3] += 1f; - if (calamityGlobalNPC.newAI[3] >= (bossRush ? 50f : 75f)) + if (calamityGlobalNPC.newAI[3] >= 75f) { calamityGlobalNPC.newAI[3] = 0f; SoundEngine.PlaySound(Main.zenithWorld ? SoundID.NPCHit41 : HitSound, NPC.Center); 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; @@ -1172,12 +1133,12 @@ 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); } } NPC.ai[1] += 1f; - if (NPC.ai[1] >= (bossRush ? 120f : 180f)) + if (NPC.ai[1] >= 180f) { NPC.TargetClosest(); NPC.ai[0] = 4f; @@ -1187,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) { @@ -1341,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) @@ -1391,7 +1349,7 @@ namespace CalamityMod.NPCs.Cryogen } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -1506,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 bb4ee5cc49..b936f757f6 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 || Main.getGoodWorld) ? 0.8f : 1f; + NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) ? 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 c5c3c4229e..1af12df8f8 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -39,16 +39,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 88; NPC.height = 88; NPC.defense = 5; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 27; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4800; NPC.aiStyle = -1; AIType = -1; @@ -64,18 +64,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[3] > 0f) { @@ -170,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 : - Main.getGoodWorld ? 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 fc10337135..6fff24e78e 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -39,16 +39,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 78; NPC.height = 78; NPC.defense = 4; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 26; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; @@ -64,18 +64,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[3] > 0f) { @@ -178,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 : - Main.getGoodWorld ? 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 f1bc6a6ad5..24e74f0275 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -53,17 +53,17 @@ 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 19; NPC.width = 88; NPC.height = 88; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4800; NPC.aiStyle = -1; AIType = -1; @@ -79,9 +79,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); - if (Main.zenithWorld) NPC.scale *= 2; } @@ -110,16 +107,15 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Become angry when the other Nuisance dies. bool getMad = (!NPC.AnyNPCs(ModContent.NPCType()) && revenge) || death; // Enrage - if (!Main.player[NPC.target].ZoneDesert && !bossRush) + if (!Main.player[NPC.target].ZoneDesert && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -127,12 +123,12 @@ namespace CalamityMod.NPCs.DesertScourge else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : getMad ? 0.5f : 0f; + float enrageScale = getMad ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -146,7 +142,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -168,7 +164,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) minLength *= 2; int bodyTypeAIVariable = 0; @@ -272,7 +268,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? SegmentVelocity_GoodWorld : + CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -299,7 +295,7 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { speed *= 1.5f; turnSpeed *= 1.5f; @@ -457,19 +453,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) @@ -600,6 +583,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 58cd825560..45b3676e8b 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -45,17 +45,17 @@ 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 18; NPC.width = 78; NPC.height = 78; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; @@ -71,9 +71,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); - if (Main.zenithWorld) NPC.scale *= 2; } @@ -106,16 +103,15 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Become angry when the other Nuisance dies. bool getMad = (!NPC.AnyNPCs(ModContent.NPCType()) && revenge) || death; // Enrage - if (!Main.player[NPC.target].ZoneDesert && !bossRush) + if (!Main.player[NPC.target].ZoneDesert && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -123,12 +119,12 @@ namespace CalamityMod.NPCs.DesertScourge else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : getMad ? 0.5f : 0f; + float enrageScale = getMad ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -142,7 +138,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.07f * enrageScale; turnSpeed += 0.14f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -175,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))); @@ -188,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; } @@ -203,7 +198,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) minLength *= 2; int bodyTypeAIVariable = 0; @@ -311,7 +306,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? SegmentVelocity_GoodWorld : + CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -338,7 +333,7 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { speed *= 1.5f; turnSpeed *= 1.5f; @@ -493,19 +488,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) @@ -638,6 +620,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 6769923e9b..06b472173f 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -21,16 +21,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 88; NPC.height = 88; NPC.defense = 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 34; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4800; NPC.aiStyle = -1; AIType = -1; @@ -46,18 +46,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -134,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 : - Main.getGoodWorld ? 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 8b502c0df0..6bec098fe0 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -21,16 +21,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 78; NPC.height = 78; NPC.defense = 7; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 33; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; @@ -46,18 +46,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -142,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 : - Main.getGoodWorld ? 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 23d2a5c5a6..ea3d5a8279 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -43,14 +43,13 @@ 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.aiStyle = -1; AIType = -1; @@ -65,15 +64,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; @@ -92,9 +88,8 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[3] > 0f) { @@ -214,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 : - Main.getGoodWorld ? 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 de32d8946f..4440d7ba44 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -56,7 +56,6 @@ namespace CalamityMod.NPCs.DesertScourge public const float LungeUpwardCutoffDistance = 420f; public const float BurrowDistance_Hide = 1080f; public const float BurrowDistance = 800f; - public const float BurrowDistance_BossRush = 400f; public const float OpenMouthForBiteDistance = 220f; private const int OpenMouthStopFrame = 4; @@ -85,23 +84,25 @@ namespace CalamityMod.NPCs.DesertScourge NPCID.Sets.MPAllowedEnemies[Type] = true; } + public static int SpitDamage = 8; // 32 + 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; 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; @@ -110,7 +111,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.4f; if (Main.zenithWorld) @@ -119,9 +120,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -165,10 +163,9 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Check for Nuisances bool hide = (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType())) && !death; @@ -191,7 +188,7 @@ namespace CalamityMod.NPCs.DesertScourge Player player = Main.player[NPC.target]; // Enrage - if (!player.ZoneDesert && !bossRush) + if (!player.ZoneDesert && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -199,12 +196,12 @@ namespace CalamityMod.NPCs.DesertScourge else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -237,7 +234,7 @@ namespace CalamityMod.NPCs.DesertScourge bool lungeUpward = burrow && NPC.Calamity().newAI[1] == 1f; bool quickFall = NPC.Calamity().newAI[1] == 2f; - float burrowDistance = hide ? BurrowDistance_Hide : bossRush ? BurrowDistance_BossRush : BurrowDistance; + float burrowDistance = hide ? BurrowDistance_Hide : BurrowDistance; float speed = death ? 0.105f : 0.085f; float turnSpeed = death ? 0.21f : 0.17f; @@ -257,7 +254,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -310,12 +307,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); } } } @@ -365,12 +361,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); } } } @@ -431,7 +426,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = death ? 24 : revenge ? 21 : expertMode ? 18 : 15; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) minLength *= 3; int bodyTypeAIVariable = 0; @@ -542,7 +537,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? SegmentVelocity_GoodWorld : + CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : expertMode ? SegmentVelocity_Expert : SegmentVelocity_Normal; @@ -601,15 +596,14 @@ namespace CalamityMod.NPCs.DesertScourge { // Spit a huge spread of sand upwards that falls down SoundEngine.PlaySound(SandBlastSound, NPC.Center); - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 16f : bossRush ? 10f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f; + float velocity = CalamityWorld.LegendaryMode ? 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 = bossRush ? 30 : death ? 24 : revenge ? 21 : expertMode ? 18 : 12; - if (Main.getGoodWorld) + int numProj = death ? 24 : revenge ? 21 : expertMode ? 18 : 12; + if (CalamityWorld.LegendaryMode) numProj *= 2; - int spread = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 120 : 90; + int spread = CalamityWorld.LegendaryMode ? 120 : 90; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { @@ -622,7 +616,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(); @@ -807,26 +801,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) @@ -946,7 +920,7 @@ namespace CalamityMod.NPCs.DesertScourge } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.SandBlock; } @@ -1072,7 +1046,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 5415c8e938..4647a5e631 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -23,14 +23,13 @@ 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.aiStyle = -1; AIType = -1; @@ -45,15 +44,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -72,9 +68,8 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -176,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 : - Main.getGoodWorld ? 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 8041253706..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; @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.dontCountMe = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -142,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 = BossRushEvent.BossRushActive ? 30f : 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 6eb9fba049..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; @@ -65,10 +65,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -189,8 +185,8 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 segmentDirection = NPC.Center; float dogHeadX = Main.npc[CalamityGlobalNPC.DoGHead].position.X + (Main.npc[CalamityGlobalNPC.DoGHead].width / 2); float dogHeadY = Main.npc[CalamityGlobalNPC.DoGHead].position.Y + (Main.npc[CalamityGlobalNPC.DoGHead].height / 2); - float segmentVelocity = BossRushEvent.BossRushActive ? 30f : CalamityWorld.revenge ? 25f : 23f; - float velocityMult = BossRushEvent.BossRushActive ? 0.9f : CalamityWorld.revenge ? 0.75f : 0.23f; + float segmentVelocity = CalamityWorld.revenge ? 25f : 23f; + float velocityMult = CalamityWorld.revenge ? 0.75f : 0.23f; float maxDistanceFromDoGHead = 160f; if (increaseSpeedMore) @@ -337,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 be71961cd5..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; @@ -49,10 +49,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.dontCountMe = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -139,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 = BossRushEvent.BossRushActive ? 30f : 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 79e71a6b1d..4df6789f0d 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,11 +89,8 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -159,10 +156,9 @@ namespace CalamityMod.NPCs.DevourerofGods float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase2 = lifeRatio < 0.6f; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (phase2) { @@ -272,25 +268,11 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt(); // Velocity variables - float segmentVelocity = bossRush ? 19f : death ? 17.5f : 16f; + float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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) @@ -438,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 2d1b9fc913..87f324a67b 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -5,7 +5,9 @@ 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; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -154,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); @@ -191,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; @@ -205,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; @@ -213,11 +219,8 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -363,10 +366,9 @@ namespace CalamityMod.NPCs.DevourerofGods bool flyUpDuringLaserWalls = laserWallPhase == (int)LaserWallPhase.FireLaserWalls || (laserWallPhase == (int)LaserWallPhase.End && teleportTimer > 0); bool flies = NPC.ai[3] == 0f || flyUpDuringLaserWalls; Vector2 destination = flyUpDuringLaserWalls ? (player.Center - Vector2.UnitY * 480f) : player.Center; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -401,14 +403,14 @@ namespace CalamityMod.NPCs.DevourerofGods extrapitch = Main.zenithWorld ? 0.3f : 0f; // Velocity variables - float segmentVelocity = bossRush ? 19f : death ? 17.5f : 16f; + float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - float speed = bossRush ? 18f : death ? 16.5f : 15f; - float turnSpeed = bossRush ? 0.36f : death ? 0.33f : 0.3f; - float homingSpeed = bossRush ? 36f : death ? 30f : 24f; - float homingTurnSpeed = bossRush ? 0.48f : death ? 0.405f : 0.33f; + float speed = death ? 16.5f : 15f; + float turnSpeed = death ? 0.33f : 0.3f; + float homingSpeed = death ? 30f : 24f; + float homingTurnSpeed = death ? 0.405f : 0.33f; if (expertMode) { @@ -418,14 +420,14 @@ namespace CalamityMod.NPCs.DevourerofGods homingTurnSpeed += 0.15f * (1f - lifeRatio); } - float groundPhaseTurnSpeed = bossRush ? 0.3f : death ? 0.24f : 0.18f; + float groundPhaseTurnSpeed = death ? 0.24f : 0.18f; if (expertMode) groundPhaseTurnSpeed += 0.1f * (1f - lifeRatio); groundPhaseTurnSpeed += Vector2.Distance(destination, NPC.Center) * 0.0002f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { segmentVelocity *= 1.1f; speed *= 1.1f; @@ -499,7 +501,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.localAI[2] == timeWhenDoGShouldTeleportDuringPhase2Countdown + (death ? TimeBeforeTeleport_Death : CalamityWorld.revenge ? TimeBeforeTeleport_Revengeance : Main.expertMode ? TimeBeforeTeleport_Expert : TimeBeforeTeleport_Normal)) SpawnTeleportLocation(player, true); if (NPC.localAI[2] == timeWhenDoGShouldTeleportDuringPhase2Countdown) - Teleport(player, bossRush, death, revenge, expertMode, phase5); + Teleport(player, death, revenge, expertMode, phase5); // Just in case the projectile cap is reached and the teleport rift doesn't spawn. if (AwaitingPhase2Teleport && NPC.localAI[2] == 0f) @@ -550,7 +552,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Dialogue the moment the second phase starts - if (NPC.localAI[2] == 60f && !bossRush) + if (NPC.localAI[2] == 60f && !BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.EdgyBossText5"; Color messageColor = Color.Cyan; @@ -621,7 +623,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Teleport if (teleportTimer == 0) - Teleport(player, bossRush, death, revenge, expertMode, phase5); + Teleport(player, death, revenge, expertMode, phase5); } // Do the death animation once killed. @@ -642,7 +644,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Laser walls - float adjustedAlphaGateValue = AlphaGateValue - (bossRush ? 360f : death ? 180f : 0f); + float adjustedAlphaGateValue = AlphaGateValue - (death ? 180f : 0f); if (phase4 && !spawnedGuardians3 && postTeleportTimer <= 0) { if (laserWallPhase == (int)LaserWallPhase.SetUp) @@ -668,7 +670,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Fire laser walls every X seconds after a laser wall phase ends - float laserWallGateValue = LaserWallCooldown - (bossRush ? 360f : death ? 180f : 0f); + float laserWallGateValue = LaserWallCooldown - (death ? 180f : 0f); if (calamityGlobalNPC.newAI[3] >= laserWallGateValue) { NPC.Opacity = 0f; @@ -713,7 +715,7 @@ namespace CalamityMod.NPCs.DevourerofGods calamityGlobalNPC.newAI[3] = 0f; // Anger message - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.EdgyBossText6"; Color messageColor = Color.Cyan; @@ -751,10 +753,10 @@ namespace CalamityMod.NPCs.DevourerofGods // Fireballs // Check angle and distance to make sure it's realistic that they'd be fired - if (NPC.Opacity >= 1f && (distanceFromTarget > 480f || (CalamityWorld.LegendaryMode && CalamityWorld.revenge)) && (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) + 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()) { calamityGlobalNPC.newAI[0] += 1f; - if (calamityGlobalNPC.newAI[0] >= ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 30f : 150f) && calamityGlobalNPC.newAI[0] % ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 30f : phase7 ? 30f : 60f) == 0f) + if (calamityGlobalNPC.newAI[0] >= (CalamityWorld.LegendaryMode ? 30f : 150f) && calamityGlobalNPC.newAI[0] % (CalamityWorld.LegendaryMode ? 30f : phase7 ? 30f : 60f) == 0f) { float fireballSpeed = 8f; Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * fireballSpeed + NPC.velocity * 0.5f; @@ -764,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 && revenge) + if (CalamityWorld.LegendaryMode) { for (int l = 0; l < 8; l++) { @@ -786,13 +788,12 @@ namespace CalamityMod.NPCs.DevourerofGods int numBlobs = 4; type = ModContent.ProjectileType(); - damage = 60; for (int i = 0; i < numBlobs; i++) { Vector2 blobVelocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); blobVelocity.Normalize(); - blobVelocity *= Main.rand.Next(400, 801) * (bossRush ? 0.02f : 0.01f); + blobVelocity *= Main.rand.Next(400, 801) * 0.01f; blobVelocity *= Main.rand.NextFloat() + 1f; float blobVelocityYAdd = Math.Abs(blobVelocity.Y) * 0.5f; @@ -812,7 +813,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (!spawnedGuardians3 && laserWallPhase == (int)LaserWallPhase.FireLaserWalls) { float spawnOffset = 1200f; - float divisor = bossRush ? 100f : 150f; + float divisor = 150f; if (calamityGlobalNPC.newAI[1] % divisor == 0f) { @@ -821,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; @@ -1112,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 && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -1270,7 +1271,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -1386,8 +1387,8 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - double maximumSpeed1 = bossRush ? 0.52 : death ? 0.46 : 0.4; - double maximumSpeed2 = bossRush ? 1.25 : death ? 1.125 : 1D; + double maximumSpeed1 = death ? 0.46 : 0.4; + double maximumSpeed2 = death ? 1.125 : 1D; if (expertMode) { @@ -1533,7 +1534,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (revenge) spawnDoGCountdown = 10; - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.EdgyBossText"; Color messageColor = Color.Cyan; @@ -1582,8 +1583,8 @@ namespace CalamityMod.NPCs.DevourerofGods } // Laser barrage attack variables - float laserBarrageGateValue = bossRush ? 1080f : death ? 1320f : 1440f; - float laserBarrageShootGateValue = bossRush ? 160f : 240f; + float laserBarrageGateValue = death ? 1320f : 1440f; + float laserBarrageShootGateValue = 240f; float laserBarragePhaseGateValue = laserBarrageGateValue - laserBarrageShootGateValue; // Spawn segments @@ -1635,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; @@ -1871,7 +1872,7 @@ namespace CalamityMod.NPCs.DevourerofGods turnSpeedCopy += distanceFromTarget * 0.0001f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -2015,7 +2016,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -2131,8 +2132,8 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - double maximumSpeed1 = bossRush ? 0.52 : death ? 0.46 : 0.4; - double maximumSpeed2 = bossRush ? 1.25 : death ? 1.125 : 1D; + double maximumSpeed1 = death ? 0.46 : 0.4; + double maximumSpeed2 = death ? 1.125 : 1D; if (expertMode) { @@ -2266,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; } @@ -2313,7 +2301,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - private void Teleport(Player player, bool bossRush, bool death, bool revenge, bool expertMode, bool phase5) + private void Teleport(Player player, bool death, bool revenge, bool expertMode, bool phase5) { Vector2 newPosition = GetRiftLocation(true); @@ -2325,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 && revenge) ? 30 : bossRush ? 18 : 12; + int totalProjectiles = (CalamityWorld.LegendaryMode) ? 30 : 12; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = finalVelocity - i * mult; float velocityMult = 1f + ((finalVelocity - newVelocity) / (newVelocity * 2f) / 100f); @@ -2351,7 +2339,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.TargetClosest(); NPC.position = newPosition; - float chargeVelocity = bossRush ? 30f : death ? 26f : revenge ? 24f : expertMode ? 22f : 20f; + float chargeVelocity = death ? 26f : revenge ? 24f : expertMode ? 22f : 20f; float maxChargeDistance = 1600f; postTeleportTimer = (int)Math.Round(maxChargeDistance / chargeVelocity); AwaitingPhase2Teleport = false; @@ -2550,7 +2538,7 @@ namespace CalamityMod.NPCs.DevourerofGods return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -2749,7 +2737,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) { @@ -2811,9 +2799,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.Calamity().punchCard && 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 ac2e7d6dc6..c7f9c2c798 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,11 +85,8 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.takenDamageMultiplier = 1.25f; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -160,9 +157,8 @@ namespace CalamityMod.NPCs.DevourerofGods float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase2 = lifeRatio < 0.6f; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (phase2) { @@ -277,7 +273,6 @@ namespace CalamityMod.NPCs.DevourerofGods segmentDirection.Y = (int)(segmentDirection.Y / 16f) * 16; playerXDist -= segmentDirection.X; playerYDist -= segmentDirection.Y; - float playerDistance = (float)System.Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length) { try @@ -290,7 +285,7 @@ namespace CalamityMod.NPCs.DevourerofGods { } NPC.rotation = (float)System.Math.Atan2(playerYDist, playerXDist) + MathHelper.PiOver2; - playerDistance = (float)System.Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); + float playerDistance = (float)System.Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); int segmentWidth = NPC.width; playerDistance = (playerDistance - segmentWidth) / playerDistance; playerXDist *= playerDistance; @@ -306,25 +301,11 @@ namespace CalamityMod.NPCs.DevourerofGods } // Velocity variables - float segmentVelocity = bossRush ? 19f : death ? 17.5f : 16f; + float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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) @@ -404,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) { @@ -475,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/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 9134f87a5f..767b505105 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -124,7 +124,6 @@ namespace CalamityMod.NPCs.DraedonLabThings Initialized = true; } - NPC.Calamity().ShouldFallThroughPlatforms = false; switch (CurrentState) { case BehaviorState.WalkAround: @@ -147,6 +146,7 @@ namespace CalamityMod.NPCs.DraedonLabThings } } } + public override bool? CanFallThroughPlatforms() => CurrentState == BehaviorState.WalkOnWalls; public void WalkAroundOnGround() { @@ -263,7 +263,6 @@ namespace CalamityMod.NPCs.DraedonLabThings { StuckCount = 0f; WantsToClimbOnSomeWall = false; - NPC.Calamity().ShouldFallThroughPlatforms = true; // Generate unusual movement patterns based on sines. float offsetAngle = CalamityUtils.AperiodicSin(Time / 360f, 0f, 1f) * 0.006f; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index b00a9ac876..254c93ea4e 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; @@ -167,9 +171,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -237,10 +238,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -416,15 +416,15 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Phase 7 - 0, 1, 2 // Gate values - float reducedTimeForGateValue = bossRush ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; + float reducedTimeForGateValue = death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; float reducedTimeForGateValue_Berserk = reducedTimeForGateValue * 0.5f; float normalAttackTime = 360f - reducedTimeForGateValue; float berserkAttackTime = lastMechAlive ? 225f - reducedTimeForGateValue_Berserk : 270f - reducedTimeForGateValue_Berserk; float attackPhaseGateValue = shouldGetBuffedByBerserkPhase ? berserkAttackTime : normalAttackTime; float timeToLineUpAttack = 30f; - float timeToLineUpCharge = bossRush ? 45f : death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; + float timeToLineUpCharge = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { timeToLineUpAttack *= 0.5f; timeToLineUpCharge *= 0.5f; @@ -435,7 +435,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float chargeLocationDistanceGateValue = 40f; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (AIState == (int)Phase.LineUpChargeCombo ? 40f : 20f) * baseVelocityMult; // Attack gate values @@ -443,9 +443,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo bool doBigAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f + timeToLineUpAttack; // Charge velocity - float chargeVelocity = bossRush ? 115f : death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; + float chargeVelocity = death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { baseVelocity *= 1.5f; chargeVelocity *= 1.15f; @@ -466,7 +466,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float rocketPhaseDuration = lastMechAlive ? 60f : 90f; int numRockets = nerfedAttacks ? 2 : 3; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numRockets += 3; // Default vector to fly to @@ -488,7 +488,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; @@ -993,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); } } } @@ -1057,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); } } @@ -1180,12 +1178,11 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.ForceNetUpdate(); // Plasma bolts on charge - if (Main.netMode != NetmodeID.MultiplayerClient && (!(Main.zenithWorld && !exoMechdusa) || (CalamityWorld.LegendaryMode && revenge))) + if (Main.netMode != NetmodeID.MultiplayerClient && (!(Main.zenithWorld && !exoMechdusa) || (CalamityWorld.LegendaryMode))) { - int totalProjectiles = bossRush ? 16 : death ? 12 : 8; + 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; @@ -1194,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); } } @@ -1673,7 +1670,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1819,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 167ada2582..055a1b2733 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -138,7 +138,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public const float deathrayTelegraphDuration_Expert = 120f; public const float deathrayTelegraphDuration_Rev = 105f; public const float deathrayTelegraphDuration_Death = 90f; - public const float deathrayTelegraphDuration_BossRush = 60f; // Total duration of the deathrays public const float deathrayDuration = 600f; @@ -220,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; @@ -233,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; @@ -242,9 +246,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.BossBar = ModContent.GetInstance(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -300,10 +301,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -386,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; @@ -505,11 +505,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Prevent mechs from being respawned - if (otherExoMechWasFirst) + // CIT 08JUN2025: This code is pointless and makes me unable to work swapping the laser arm position. Commenting it out. + /*if (otherExoMechWasFirst) { if (NPC.ai[3] < 1f) NPC.ai[3] = 1f; - } + }*/ // Phases bool spawnOtherExoMechs = lifeRatio < 0.7f && NPC.ai[3] == 0f; @@ -606,7 +607,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X, player.Center.Y - 800f) : AIState != (float)Phase.Deathrays ? new Vector2(player.Center.X, player.Center.Y - 425f) : player.Center; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (EnragedState == (float)Enraged.Yes ? 22f : 14f) * baseVelocityMult; float baseAcceleration = shouldGetBuffedByBerserkPhase ? 1.25f : 1f; float decelerationVelocityMult = 0.85f; @@ -888,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 && revenge)) && EnragedState == (float)Enraged.No) + if ((distanceFromTarget > DeathrayEnrageDistance || (CalamityWorld.LegendaryMode)) && EnragedState == (float)Enraged.No) { // Play enrage sound if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance) @@ -907,8 +908,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[3] = 1f; NPC.velocity *= decelerationVelocityMult; - int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 9 : expertMode ? 8 : 6; - if (Main.getGoodWorld) + int totalProjectiles = death ? 10 : revenge ? 9 : expertMode ? 8 : 6; + if (CalamityWorld.LegendaryMode) totalProjectiles += 4; float radians = MathHelper.TwoPi / totalProjectiles; @@ -920,8 +921,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX2, -velocity); spinningPoint.Normalize(); - float deathrayTelegraphDuration = bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : - revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : + expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; calamityGlobalNPC.newAI[2] += (EnragedState == (float)Enraged.Yes && calamityGlobalNPC.newAI[2] % 2f == 0f) ? 2f : 1f; if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) @@ -991,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); } } } @@ -1105,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; @@ -1495,7 +1493,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1710,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 7234ce1600..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; @@ -106,9 +109,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -146,10 +146,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -238,7 +237,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.Calamity().newAI[3] = 0f; // Predictiveness - float predictionAmt = bossRush ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; + float predictionAmt = death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -326,7 +325,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center + (calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? offset2 : offset); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -422,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 @@ -487,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 @@ -702,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 81107f0d5a..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; @@ -109,9 +112,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -151,10 +151,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -184,6 +183,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool nerfedAttacks = false; if (exoTwinsAlive) nerfedAttacks = Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].Calamity().newAI[1] != (float)Apollo.Apollo.SecondaryPhase.PassiveAndImmune; + // Used to make the beam only sweep horizontally during mecha mayhem phase + bool mechaMayhem = nerfedAttacks && exoWormAlive && Main.npc[CalamityGlobalNPC.draedonExoMechWorm].Calamity().newAI[1] != (float)ThanatosHead.SecondaryPhase.PassiveAndImmune; // Phases bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); @@ -325,7 +326,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; float baseAcceleration = shouldGetBuffedByBerserkPhase ? 1.25f : 1f; @@ -346,7 +347,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares else if (shouldGetBuffedByBerserkPhase) deathrayPhaseGateValue *= 0.5f; - float deathrayPhaseVelocity = (nerfedAttacks ? 6f : passivePhase ? 9f : 12f) * baseVelocityMult; + float deathrayPhaseVelocity = (nerfedAttacks ? 8f : passivePhase ? 9f : 12f) * baseVelocityMult; if (lastMechAlive) deathrayPhaseVelocity *= 1.2f; else if (shouldGetBuffedByBerserkPhase) @@ -356,8 +357,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, Main.player[targetIndex].Center) > 320f || !fireNormalLasers; // Telegraph duration for deathray spiral - float deathraySpiralTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathraySpiralTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to disable deathray firing bool doNotFire = calamityGlobalNPC_Body.newAI[1] == (float)AresBody.SecondaryPhase.PassiveAndImmune || @@ -455,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); } } } @@ -486,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); @@ -494,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); } } } @@ -512,10 +511,21 @@ namespace CalamityMod.NPCs.ExoMechs.Ares AIState = (float)Phase.Nothing; calamityGlobalNPC.newAI[2] = 0f; - // Change deathray sweep type for next deathray phase + // Change deathray sweep type for next deathray phase; this does not affect anything during mecha mayhem calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] > 1f) calamityGlobalNPC.newAI[3] = 0f; + + // If mecha mayhem, make Ares swap the position of the laser and gauss arms, and ensure the beam always sweeps horizontal + if (mechaMayhem) + { + calamityGlobalNPC.newAI[3] = 0f; + if (Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] == 0f) + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] = 1f; + else + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] = 0f; + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ForceNetUpdate(); + } } break; @@ -536,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 @@ -751,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 65d8a89c91..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; @@ -103,9 +106,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -145,10 +145,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -237,7 +236,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.Calamity().newAI[3] = 0f; // Predictiveness - float predictionAmt = bossRush ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; + float predictionAmt = death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -338,7 +337,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center + (calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? offset2 : offset); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -354,8 +353,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, Main.player[targetIndex].Center) > 320f || calamityGlobalNPC_Body.newAI[0] != (float)AresBody.Phase.Deathrays; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to cancel plasma bolt firing bool doNotFire = calamityGlobalNPC_Body.newAI[1] == (float)AresBody.SecondaryPhase.PassiveAndImmune || @@ -444,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 @@ -487,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 @@ -700,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 50617f35d7..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; @@ -104,9 +106,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -146,10 +145,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -238,7 +236,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.localAI[0] = 0f; // Predictiveness - float predictionAmt = bossRush ? 40f : death ? 30f : revenge ? 27.5f : expertMode ? 25f : 20f; + float predictionAmt = death ? 30f : revenge ? 27.5f : expertMode ? 25f : 20f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -341,7 +339,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center + (calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? offset2 : offset); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -354,8 +352,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, Main.player[targetIndex].Center) > 320f || calamityGlobalNPC_Body.newAI[0] != (float)AresBody.Phase.Deathrays; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to cancel tesla orb firing bool doNotFire = calamityGlobalNPC_Body.newAI[1] == (float)AresBody.SecondaryPhase.PassiveAndImmune || @@ -443,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 @@ -484,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 @@ -696,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 7818bae958..51e7694438 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; @@ -196,9 +199,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.BossBar = ModContent.GetInstance(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -270,10 +270,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -450,14 +449,14 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Phase 7 - 0, 1, 2 // Gate values - float reducedTimeForGateValue = bossRush ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; + float reducedTimeForGateValue = death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; float reducedTimeForGateValue_Berserk = reducedTimeForGateValue * 0.5f; float normalAttackTime = 360f - reducedTimeForGateValue; float berserkAttackTime = lastMechAlive ? 225f - reducedTimeForGateValue_Berserk : 270f - reducedTimeForGateValue_Berserk; float attackPhaseGateValue = shouldGetBuffedByBerserkPhase ? berserkAttackTime : normalAttackTime; float timeToLineUpAttack = phase2 ? 30f : 45f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) timeToLineUpAttack *= 0.5f; // Spin variables @@ -494,9 +493,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float movementDistanceGateValue = 100f; // Charge variables - float chargeVelocity = nerfedAttacks ? 60f : bossRush ? 81f : death ? 74f : revenge ? 70.5f : expertMode ? 67f : 60f; + float chargeVelocity = nerfedAttacks ? 60f : death ? 74f : revenge ? 70.5f : expertMode ? 67f : 60f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; float chargeDistance = 2000f; @@ -517,11 +516,11 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis predictionAmt *= 0.5f; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = ((AIState == (int)Phase.Deathray || lineUpAttack || AIState == (int)Phase.LaserShotgun) ? 40f : 20f) * baseVelocityMult; float decelerationVelocityMult = 0.85f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.5f; // Laser shotgun variables @@ -535,7 +534,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; @@ -777,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); } } } @@ -832,10 +830,9 @@ 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 = bossRush ? 10 : death ? 8 : expertMode ? 6 : 4; - int spread = bossRush ? 30 : death ? 26 : expertMode ? 21 : 15; + int numLasersPerSpread = death ? 8 : expertMode ? 6 : 4; + int spread = death ? 26 : expertMode ? 21 : 15; float rotation = MathHelper.ToRadians(spread); float distanceFromTarget = Vector2.Distance(NPC.Center, NPC.Center + chargeVelocityNormalized * chargeDistance); float setVelocityInAI = death ? 7f : revenge ? 6.75f : expertMode ? 6.5f : 6f; @@ -848,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); } } } @@ -929,14 +926,13 @@ 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 * normal = 16, 20, 24 * nerfedAttacks = 12, 15, 18 */ - int numLasersAddedByDifficulty = bossRush ? 3 : death ? 2 : expertMode ? 1 : 0; + int numLasersAddedByDifficulty = death ? 2 : expertMode ? 1 : 0; int numLasersPerSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 3 : lastMechAlive ? 7 : 5) + numLasersAddedByDifficulty; int baseSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 9 : lastMechAlive ? 20 : 15) + numLasersAddedByDifficulty * 2; int spread = baseSpread + (int)(calamityGlobalNPC.newAI[2] / divisor2) * (baseSpread / 4); @@ -954,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); } } @@ -1087,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; @@ -1099,7 +1094,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis else { // This first variable is used to adjust how long it takes for the rotation rate to reach max - float rotationSpeedMult = bossRush ? 6.66f : death ? 4f : revenge ? 3f : expertMode ? 2.5f : 2f; + float rotationSpeedMult = death ? 4f : revenge ? 3f : expertMode ? 2.5f : 2f; // This is used to adjust both the radians and the velocity of the spin moved per frame // At 15% progress it will be at max rotation in Boss Rush @@ -1592,7 +1587,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1619,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 e2eda50072..208d7695ab 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; @@ -88,9 +88,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -141,10 +138,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Check if other segments are still alive, if not, die bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); @@ -254,7 +250,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = bossRush ? 42D : death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; + double numSegmentsAbleToFire = death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.25; @@ -306,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); } } } @@ -364,12 +359,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) 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++) { @@ -378,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 { @@ -386,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); } } } @@ -522,7 +516,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -531,22 +525,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 +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 411630ec67..5c35828c78 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; @@ -87,9 +87,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -140,10 +137,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Check if other segments are still alive, if not, die bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); @@ -253,7 +249,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = bossRush ? 42D : death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; + double numSegmentsAbleToFire = death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.25; @@ -305,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); } } } @@ -363,12 +358,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) 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++) { @@ -377,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 { @@ -385,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); } } } @@ -525,7 +519,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -534,22 +528,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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) @@ -695,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 d4eb16b82b..ac548a2b24 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; @@ -192,9 +195,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.chaseable = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => - (BossRushEvent.BossRushActive ? 400f : CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.6f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : Main.getGoodWorld ? 0.5f : 1f); + (CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.75f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : CalamityWorld.LegendaryMode ? 0.5f : 1f); public int CheckForOtherMechs(ref int targetIndex, out bool exoPrimeAlive, out bool exoTwinsAlive) { @@ -297,10 +297,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos CalamityGlobalNPC.draedonExoMechWorm = NPC.whoAmI; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -518,7 +517,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float laserBarrageLocationDistance = turnDistance * 3f; // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -527,7 +526,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.15f; float turnDegrees = baseVelocity * 0.1f * (shouldGetBuffedByBerserkPhase ? 1.25f : 1.1f); @@ -941,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); } } } @@ -1046,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) @@ -1245,7 +1230,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1367,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 8faffda3d8..748c09e955 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; @@ -87,9 +87,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -140,10 +137,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Check if other segments are still alive, if not, die bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); @@ -253,7 +249,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = bossRush ? 42D : death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; + double numSegmentsAbleToFire = death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.25; @@ -305,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); } } } @@ -363,12 +358,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) 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++) { @@ -377,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 { @@ -385,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); } } } @@ -523,7 +517,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -532,22 +526,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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) @@ -694,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 9e5ae8406a..ac7cd01e1f 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; - if ((CalamityWorld.LegendaryMode && CalamityWorld.revenge)) + if (CalamityWorld.LegendaryMode) 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; @@ -40,10 +40,6 @@ namespace CalamityMod.NPCs.HiveMind NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -68,8 +64,6 @@ namespace CalamityMod.NPCs.HiveMind bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; float speed = death ? 15f : revenge ? 13f : 11f; - if (BossRushEvent.BossRushActive) - speed = 18f; if (NPC.ai[1] < 90f) NPC.ai[1] += 1f; @@ -126,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) @@ -157,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 e44757e78c..dd5b6714b7 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,12 +29,12 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 75; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1800; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.aiStyle = -1; AIType = -1; - NPC.knockBackResist = BossRushEvent.BossRushActive ? 0f : 0.4f; + NPC.knockBackResist = 0.4f; NPC.noGravity = true; NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = SoundID.NPCDeath21; @@ -73,15 +73,19 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10f : death ? 7f : revenge ? 6f : 4f; - float acceleration = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f; - float deceleration = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f; - if (BossRushEvent.BossRushActive) + // Despawn if Hive Mind isn't present + if (CalamityGlobalNPC.hiveMind == -1) { - velocity *= 2f; - acceleration *= 2f; + NPC.life = 0; + NPC.HitEffect(); + NPC.checkDead(); + 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; + if (NPC.position.Y > Main.player[NPC.target].position.Y - 400f) { if (NPC.velocity.Y > 0f) @@ -121,17 +125,16 @@ namespace CalamityMod.NPCs.HiveMind if (dropRain && Main.netMode != NetmodeID.MultiplayerClient) { NPC.ai[0] += 1f; - float rainDropRate = Main.getGoodWorld ? 10f : death ? 15f : revenge ? 20f : 30f; + float rainDropRate = CalamityWorld.LegendaryMode ? 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 && CalamityWorld.revenge) ? Main.rand.NextFloat() * 5f : 0f; + float randomXVelocity = CalamityWorld.LegendaryMode ? 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 e3bcc35ee9..3730e1e0c8 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 = Main.getGoodWorld ? 256f : 128f; + float distanceFromMind = FastVariant ? 96f : 128f; + if (CalamityWorld.LegendaryMode) + 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 && CalamityWorld.revenge && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = type == ProjectileID.CursedFlameHostile ? 30 : NPC.GetProjectileDamage(type); + int type = (CalamityWorld.LegendaryMode && 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 47acb7e3dc..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 (Main.getGoodWorld) - 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 = Main.getGoodWorld ? 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 (Main.getGoodWorld) - 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 && CalamityWorld.revenge && 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 1917f8fbce..1713dae743 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -54,8 +54,7 @@ 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 = 420; + private int burrowTimer = 120; private int minimumDriftTime = 300; private int teleportRadius = 300; private int decelerationTime = 30; @@ -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 @@ -147,19 +148,18 @@ namespace CalamityMod.NPCs.HiveMind NPC.height = frameHeight_P1; NPC.defense = 8; - NPC.LifeMaxNERB(7700, 9200, 350000); + NPC.LifeMaxNERB(6150, 7350, 350000); 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; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (expertMode) { @@ -189,17 +189,7 @@ namespace CalamityMod.NPCs.HiveMind driftBoost = 1.5f; } - if (bossRush) - { - lungeRots = 0.4; - minimumDriftTime = 40; - reelbackFade = 10; - lungeTime = 16; - driftSpeed = 6f; - driftBoost = 1f; - } - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { reelbackFade *= 10; arcTime *= 0.5f; @@ -210,9 +200,6 @@ namespace CalamityMod.NPCs.HiveMind NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -232,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); @@ -256,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(); @@ -352,10 +337,9 @@ namespace CalamityMod.NPCs.HiveMind private void SpawnStuff() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; int maxSpawns = death ? Main.rand.Next(3, 5) : revenge ? 3 : expertMode ? Main.rand.Next(2, 4) : 2; for (int i = 0; i < maxSpawns; i++) @@ -401,8 +385,7 @@ namespace CalamityMod.NPCs.HiveMind private void ReelBack() { - bool bossRush = BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || bossRush; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; NPC.alpha = 0; phase2timer = 0; @@ -440,37 +423,13 @@ namespace CalamityMod.NPCs.HiveMind Player player = Main.player[NPC.target]; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - // Enrage - if ((!player.ZoneCorrupt || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCorrupt || bossRush)) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - // Phase 2 settings if (IsPhaseTwo) { @@ -526,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; @@ -570,13 +529,13 @@ namespace CalamityMod.NPCs.HiveMind { NPC.localAI[0] = 1f; int maxBlobs = death ? 15 : revenge ? 7 : expertMode ? 6 : 5; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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)); } } @@ -613,15 +572,15 @@ namespace CalamityMod.NPCs.HiveMind if (Main.netMode != NetmodeID.MultiplayerClient) { - int maxSpawns = bossRush ? 16 : death ? 8 : revenge ? 6 : expertMode ? Main.rand.Next(4, 6) : Main.rand.Next(3, 5); - int maxDankSpawns = bossRush ? 4 : death ? Main.rand.Next(2, 4) : revenge ? 2 : expertMode ? Main.rand.Next(1, 3) : 1; + int maxSpawns = death ? 5 : revenge ? 4 : expertMode ? Main.rand.Next(3, 5) : Main.rand.Next(2, 4); + int maxDankSpawns = death ? Main.rand.Next(2, 4) : revenge ? 2 : expertMode ? Main.rand.Next(1, 3) : 1; for (int i = 0; i < maxSpawns; i++) { 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(); @@ -639,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; @@ -690,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; @@ -743,8 +702,8 @@ namespace CalamityMod.NPCs.HiveMind { case 0: // Slowdrift - // Avoid cheap bullshit - NPC.damage = 0; + // Set damage + NPC.damage = NPC.defDamage; if (NPC.alpha > 0) { @@ -809,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; @@ -853,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(); } @@ -861,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; @@ -873,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) @@ -914,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) @@ -971,10 +930,10 @@ namespace CalamityMod.NPCs.HiveMind // Set damage NPC.damage = NPC.defDamage; - phase2timer = lungeTime - 4 * (int)enrageScale; - NPC.velocity = player.Center + (bossRush ? player.velocity * 20f : Vector2.Zero) - NPC.Center; + 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; @@ -1112,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 && CalamityWorld.revenge) ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; - Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, damage, 0, Main.myPlayer, 11f); + Vector2 randomVelocity = CalamityWorld.LegendaryMode ? 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) @@ -1259,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 @@ -1277,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) @@ -1289,13 +1247,6 @@ namespace CalamityMod.NPCs.HiveMind { if (Main.netMode != NetmodeID.MultiplayerClient) { - if (Main.rand.NextBool(15)) - { - int hiveBlobCount = NPC.CountNPCS(ModContent.NPCType()) + NPC.CountNPCS(ModContent.NPCType()); - if (hiveBlobCount < 3) - NPC.NewNPC(NPC.GetSource_FromThis(), (int)NPC.Center.X, (int)NPC.Center.Y, Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType()); - } - if (Main.rand.NextBool(30)) { if (NPC.CountNPCS(NPCID.EaterofSouls) < 2) @@ -1346,7 +1297,7 @@ namespace CalamityMod.NPCs.HiveMind } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.HealingPotion; } @@ -1395,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 8a3269a23c..a438f60a4b 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 && CalamityWorld.revenge) ? 10 : 1000; + NPC.lifeMax = CalamityWorld.LegendaryMode ? 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 && CalamityWorld.revenge))) + if (Main.netMode != NetmodeID.MultiplayerClient && (!NPC.AnyNPCs(ModContent.NPCType()) || CalamityWorld.LegendaryMode)) { 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 c1d15e08a3..d5922b0ff9 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -59,21 +59,26 @@ 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.GetNPCDamage(); + NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 55; // 110 NPC.npcSlots = 16f; NPC.width = 100; NPC.height = 100; NPC.defense = 20; - NPC.DR_NERD(0.2f); NPC.LifeMaxNERB(35000, 42000, 260000); NPC.knockBackResist = 0f; NPC.aiStyle = -1; 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,14 +88,11 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; if (Main.zenithWorld) NPC.scale *= 4f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -141,9 +143,6 @@ namespace CalamityMod.NPCs.Leviathan if (HasBegunSummoningLeviathan && CalamityGlobalNPC.LeviAndAna == -1) CalamityGlobalNPC.LeviAndAna = NPC.whoAmI; - // Set to false so she doesn't do it constantly - NPC.Calamity().canBreakPlayerDefense = false; - // Light Lighting.AddLight((int)(NPC.Center.X / 16f), (int)(NPC.Center.Y / 16f), 0f, 0.5f, 0.3f); @@ -162,14 +161,13 @@ namespace CalamityMod.NPCs.Leviathan // Variables Player player = Main.player[NPC.target]; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); // Enrage - if (notOcean && !bossRush) + if (notOcean && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -177,12 +175,12 @@ namespace CalamityMod.NPCs.Leviathan else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1.5f; } @@ -192,9 +190,9 @@ namespace CalamityMod.NPCs.Leviathan bubbleVelocity += 4f * enrageScale; if (!leviAlive) bubbleVelocity += 2f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) bubbleVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) bubbleVelocity *= 2f; // Phases @@ -239,7 +237,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.rotation = NPC.rotation.AngleTowards(idealRotation, 0.08f); - if (bossRush || Collision.WetCollision(NPC.position, NPC.width, NPC.height) || NPC.position.Y > (Main.worldSurface - 125f) * 16f) + if (BossRushEvent.BossRushActive || Collision.WetCollision(NPC.position, NPC.width, NPC.height) || NPC.position.Y > (Main.worldSurface - 125f) * 16f) { int oldAlpha = NPC.alpha; NPC.alpha = Utils.Clamp(NPC.alpha + 9, 0, 255); @@ -315,6 +313,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.dontTakeDamage = true; } + NPC.canDisplayBuffs = true; // Hover near the target, invisible if the Leviathan is present and not sufficiently injured. if ((phase3 || death) && WaitingForLeviathan && !Main.zenithWorld) { @@ -342,6 +341,7 @@ namespace CalamityMod.NPCs.Leviathan } NPC.dontTakeDamage = true; + NPC.canDisplayBuffs = false; if (NPC.ai[0] != -1f) { @@ -617,14 +617,14 @@ namespace CalamityMod.NPCs.Leviathan float velocity = death ? 13.5f : 12f; velocity += 6f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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) @@ -654,7 +654,7 @@ namespace CalamityMod.NPCs.Leviathan float telegraphDist = 500f; // In Legendary, the projectiles she fires is randomized - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { LegendaryModeAttackChosen = Main.rand.Next(3); if (LegendaryModeAttackChosen == 2) @@ -708,10 +708,10 @@ namespace CalamityMod.NPCs.Leviathan int totalProjectiles = 8; int projectileDistance = 600; int type = ModContent.ProjectileType(); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + int damage = SpearDamage; + if (CalamityWorld.LegendaryMode) { float radians = MathHelper.TwoPi / totalProjectiles; - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { switch (LegendaryModeAttackChosen) @@ -722,11 +722,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); @@ -750,12 +752,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); @@ -769,7 +773,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; @@ -826,9 +829,11 @@ namespace CalamityMod.NPCs.Leviathan if (revenge) chargeVelocity += 2f + (death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio)); - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; + // Stunt velocity at the end of the charge attack to prevent her flying off + if (NPC.ai[0] == -1f) + chargeVelocity *= 0.3f; NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * chargeVelocity; NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); @@ -850,10 +855,9 @@ namespace CalamityMod.NPCs.Leviathan // Charge else if (NPC.ai[0] == 4f) { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = (int)Math.Round(NPC.defDamage * 1.5); + NPC.damage = (int)Math.Round(NPC.defDamage * DashDamageMult); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge && NPC.ai[1] % 5f == 0f) + if (CalamityWorld.LegendaryMode && 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); @@ -923,7 +927,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) acceleration *= 1.15f; NPC.SimpleFlyMovement(chargeSetupLocation, acceleration); @@ -980,7 +984,7 @@ namespace CalamityMod.NPCs.Leviathan if (DrawProjectileTelegraphTimer > 0) { Color telegraphColor = Color.Black; - switch (CalamityWorld.LegendaryMode && CalamityWorld.revenge ? LegendaryModeAttackChosen : (int)NPC.localAI[3]) + switch (CalamityWorld.LegendaryMode ? LegendaryModeAttackChosen : (int)NPC.localAI[3]) { case 0: telegraphColor = new Color(55, 70, 240); @@ -1021,7 +1025,7 @@ namespace CalamityMod.NPCs.Leviathan //200x636 } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -1048,7 +1052,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 cd2355115a..bc01f7169c 100644 --- a/NPCs/Leviathan/AnahitasIceShield.cs +++ b/NPCs/Leviathan/AnahitasIceShield.cs @@ -29,16 +29,16 @@ 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; - NPC.DR_NERD(0.5f); - NPC.lifeMax = BossRushEvent.BossRushActive ? 1000 : 650; + NPC.DR_NERD(0.25f); + NPC.lifeMax = BossRushEvent.BossRushActive ? 2000 : 750; NPC.alpha = 255; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; } diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 59dded4f7f..152244ae2b 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,12 +54,8 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.3f; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -97,10 +92,9 @@ namespace CalamityMod.NPCs.Leviathan // Avoid cheap bullshit NPC.damage = 0; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; NPC.TargetClosest(false); @@ -129,13 +123,13 @@ namespace CalamityMod.NPCs.Leviathan sirenAlive = false; } - float inertia = bossRush ? 24f : death ? 26f : revenge ? 27f : expertMode ? 28f : 30f; + float inertia = death ? 26f : revenge ? 27f : expertMode ? 28f : 30f; if (!sirenAlive || leviathanInPhase4) inertia *= 0.75f; if (NPC.ai[0] == 0f) { - float lungeSpeed = bossRush ? 14f : death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; + float lungeSpeed = death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; if (!sirenAlive || leviathanInPhase4) lungeSpeed *= 1.25f; @@ -300,7 +294,5 @@ namespace CalamityMod.NPCs.Leviathan } } } - - public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.AdhesiveBandage, 100, 50)); } } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 5a301b94a5..0eacfebad3 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -57,21 +57,23 @@ 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; - NPC.DR_NERD(0.3f); - NPC.LifeMaxNERB(60000, 72000, 600000); + NPC.DR_NERD(0.1f); + NPC.LifeMaxNERB(57000, 68400, 600000); NPC.knockBackResist = 0f; 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,14 +86,11 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.3f; if (Main.zenithWorld) NPC.scale *= 0.3f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -131,10 +130,9 @@ namespace CalamityMod.NPCs.Leviathan if (CalamityGlobalNPC.LeviAndAna == -1) CalamityGlobalNPC.LeviAndAna = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Vector2 npcCenter = NPC.Center; // Is in spawning animation @@ -201,7 +199,7 @@ namespace CalamityMod.NPCs.Leviathan bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16D || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); // Enrage - if (notOcean && !bossRush) + if (notOcean && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -209,12 +207,12 @@ namespace CalamityMod.NPCs.Leviathan else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -228,7 +226,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Despawn @@ -313,7 +310,7 @@ namespace CalamityMod.NPCs.Leviathan hoverAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { hoverSpeed *= 1.15f; hoverAcceleration *= 1.15f; @@ -394,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; @@ -413,12 +409,11 @@ namespace CalamityMod.NPCs.Leviathan if (Main.zenithWorld) { - type = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; + type = CalamityWorld.LegendaryMode ? 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; @@ -443,16 +438,8 @@ namespace CalamityMod.NPCs.Leviathan float playerDistance = (float)Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); NPC.ai[1] += 1f; - int activePlayerAmt = 0; - for (int i = 0; i < Main.maxPlayers; i++) - { - if (Main.player[i].active && !Main.player[i].dead && (npcCenter - Main.player[i].Center).Length() < 1000f) - activePlayerAmt++; - } - NPC.ai[1] += activePlayerAmt / 2; - bool spawnedAberration = false; - float aberrationSpawnDelay = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 20f : (!sirenAlive || phase4) ? 60f : 40f; + float aberrationSpawnDelay = CalamityWorld.LegendaryMode ? 20f : (!sirenAlive || phase4) ? 60f : 50f; if (NPC.ai[1] > aberrationSpawnDelay) { NPC.ai[1] = 0f; @@ -460,8 +447,8 @@ namespace CalamityMod.NPCs.Leviathan spawnedAberration = true; } - int spawnLimit = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10 : (sirenAlive && !phase4) ? 1 : (death ? 2 : 3); - if (spawnedAberration && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit) + int spawnLimit = CalamityWorld.LegendaryMode ? 10 : (sirenAlive && !phase4) ? 0 : 2; + if (spawnedAberration && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit && NPC.ai[2] <= spawnLimit) { SoundEngine.PlaySound(soundChoice with { Pitch = soundChoice.Pitch + extrapitch }, npcCenter); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -575,7 +562,7 @@ namespace CalamityMod.NPCs.Leviathan if (revenge && (!sirenAlive || phase4)) lineupSpeed += death ? 9f * (1f - lifeRatio) : 6f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) lineupSpeed *= 1.15f; Vector2 leviChargeCenter = npcCenter; @@ -611,7 +598,7 @@ namespace CalamityMod.NPCs.Leviathan chargeAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -810,7 +797,7 @@ namespace CalamityMod.NPCs.Leviathan } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -984,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 19205bd748..35ddf96f39 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -1,6 +1,7 @@ using System.IO; using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -58,7 +59,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToWater = false; NPC.Calamity().ProvidesProximityRage = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; } diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index a72b4648a6..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; @@ -41,10 +41,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index a4ea0b9aeb..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; @@ -41,10 +40,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -157,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 5f230ad2bb..dfed057395 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; @@ -56,10 +55,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -394,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) @@ -439,14 +421,14 @@ namespace CalamityMod.NPCs.NormalNPCs { if (!CalamityPlayer.areThereAnyDamnBosses && NPC.downedPlantBoss && !NPC.AnyNPCs(ModContent.NPCType())) { - float spawnRateDivisor = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 125f : CalamityWorld.revenge ? 425f : 500f; + float spawnRateDivisor = CalamityWorld.LegendaryMode ? 125f : CalamityWorld.revenge ? 425f : 500f; return 1 / spawnRateDivisor; } } return 0f; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index 8aa015ef78..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; @@ -40,10 +39,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -107,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 adff77a47e..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; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/BloodlettingServant.cs b/NPCs/NormalNPCs/BloodlettingServant.cs deleted file mode 100644 index d2b172c462..0000000000 --- a/NPCs/NormalNPCs/BloodlettingServant.cs +++ /dev/null @@ -1,326 +0,0 @@ -using System; -using CalamityMod.Events; -using CalamityMod.Gores; -using CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -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.NPCs.NormalNPCs -{ - public class BloodlettingServant : ModNPC - { - private const float ChargeGateValue = 180f; - private const float ChargeTelegraphGateValue = 90f; - private const float ChargeDuration = 60f; - private const float ChargeDuration_Death = 50f; - - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 6; - NPCID.Sets.TrailingMode[Type] = 1; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; - NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); - } - - public override void SetDefaults() - { - NPC.aiStyle = -1; - AIType = -1; - NPC.GetNPCDamage(); - NPC.width = 44; - NPC.height = 30; - if (Main.tenthAnniversaryWorld) - NPC.scale *= 0.5f; - if (Main.getGoodWorld) - NPC.scale *= 1.1f; - - NPC.defense = 5; - NPC.lifeMax = 96; - NPC.knockBackResist = 0f; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath1; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToSickness = true; - } - - public override void AI() - { - Lighting.AddLight(NPC.Center, 0.3f, 0.3f, 0.3f); - - NPC.TargetClosest(); - Player target = Main.player[NPC.target]; - bool targetDead = target.dead; - - bool phase2 = NPC.life < NPC.lifeMax * 0.5; - float enrageScale = 1f + NPC.ai[2]; - - float enrageScaleMaxSpeedBonus = 2f * enrageScale; - float maxSpeedX = (phase2 ? (CalamityWorld.death ? 10f : 8f) : (CalamityWorld.death ? 8f : 6f)) + enrageScaleMaxSpeedBonus; - float maxSpeedY = (phase2 ? (CalamityWorld.death ? 8f : 6f) : (CalamityWorld.death ? 4f : 3f)) + enrageScaleMaxSpeedBonus; - float xAccel = maxSpeedX * 0.01f; - float xAccelBoost1 = maxSpeedX * 0.01f; - float xAccelBoost2 = maxSpeedX * 0.0075f; - float yAccel = maxSpeedY * 0.01f; - float yAccelBoost1 = maxSpeedY * 0.01f; - float yAccelBoost2 = maxSpeedY * 0.0075f; - - float chargeVelocity = 12f + enrageScaleMaxSpeedBonus * 2f; - bool attemptingToCharge = NPC.ai[0] >= ChargeGateValue; - bool farEnoughForCharge = NPC.Distance(target.Center) >= 320f; - bool closeEnoughForCharge = NPC.Distance(target.Center) < 480f; - bool charging = (attemptingToCharge && farEnoughForCharge && closeEnoughForCharge) || NPC.ai[1] > 0f; - - float projectileShootGateValue = CalamityWorld.death ? 180f : 270f; - if (Main.getGoodWorld) - projectileShootGateValue *= 0.5f; - - Vector2 lookAt = target.Center - NPC.Center; - float rateOfRotation = charging ? 0f : 0.1f; - float chargeDuration = CalamityWorld.death ? ChargeDuration_Death : ChargeDuration; - NPC.Calamity().canBreakPlayerDefense = charging; - if (charging) - { - if (NPC.ai[1] == 0f) - { - SoundEngine.PlaySound(SoundID.NPCDeath9, NPC.Center); - NPC.velocity = lookAt.SafeNormalize(Vector2.UnitY) * chargeVelocity; - NPC.spriteDirection = lookAt.X < 0f ? -1 : 1; - NPC.rotation = NPC.velocity.ToRotation() + (lookAt.X < 0f ? MathHelper.Pi : 0f); - - NPC.ai[1] = 1f; - if (NPC.ai[3] > projectileShootGateValue * 0.5f) - NPC.ai[3] = projectileShootGateValue * 0.5f; - - NPC.ForceNetUpdate(); - } - - if (NPC.ai[1] < ChargeDuration + 1f) - { - NPC.ai[1] += 1f; - if (NPC.ai[1] > ChargeDuration + 1f - 10f) - NPC.velocity *= 0.8f; - - if (NPC.ai[1] >= ChargeDuration + 1f) - { - NPC.ai[0] = 0f; - NPC.ai[1] = 0f; - NPC.ForceNetUpdate(); - } - } - } - else - { - if (lookAt.X > 0f) - { - NPC.spriteDirection = 1; - NPC.rotation = lookAt.ToRotation(); - } - if (lookAt.X < 0f) - { - NPC.spriteDirection = -1; - NPC.rotation = lookAt.ToRotation() + MathHelper.Pi; - } - } - - if (phase2) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 1.3); - - if (NPC.ai[0] < ChargeGateValue && !targetDead) - { - NPC.ai[0] += 1f; - if (NPC.ai[0] == ChargeGateValue) - NPC.ForceNetUpdate(); - } - } - else - NPC.damage = NPC.defDamage; - - if (targetDead) - { - NPC.velocity.Y -= 0.04f; - - if (NPC.timeLeft > 10) - NPC.timeLeft = 10; - } - else if (!attemptingToCharge) - { - DemonEyeAI.DemonEyeBatMovement(NPC, maxSpeedX, maxSpeedY, xAccel, xAccelBoost1, xAccelBoost2, yAccel, yAccelBoost1, yAccelBoost2); - - NPC.ai[3] += enrageScale; - bool shootProjectile = Collision.CanHitLine(NPC.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(NPC.Center, target.Center) > 240f; - if (NPC.ai[3] >= projectileShootGateValue && shootProjectile) - { - NPC.ai[3] = 0f; - float projectileSpeed = CalamityWorld.death ? 16f : 12f; - Vector2 projectileVelocity = NPC.SafeDirectionTo(target.Center) * projectileSpeed; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int projType = ProjectileID.BloodShot; - int projDamage = NPC.GetProjectileDamage(projType); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 10f, projectileVelocity, projType, projDamage, 0f, Main.myPlayer); - Main.projectile[proj].timeLeft = 600; - } - - NPC.ForceNetUpdate(); - } - - float pushVelocity = 0.2f * enrageScale; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active) - { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) - { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 48f * NPC.scale) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; - - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } - } - } - } - } - else if (!charging) - { - Vector2 destination = target.Center + new Vector2(-280f * NPC.spriteDirection, -280f); - Vector2 desiredVelocity = NPC.SafeDirectionTo(destination, -Vector2.UnitY) * chargeVelocity; - NPC.SimpleFlyMovement(desiredVelocity, enrageScale); - } - - if (Main.rand.NextBool(20)) - { - Vector2 dustSpawnTopLeft = new Vector2(NPC.position.X, NPC.position.Y + NPC.height * 0.25f); - Dust blood = Dust.NewDustDirect(dustSpawnTopLeft, NPC.width, NPC.height / 2, DustID.Blood, NPC.velocity.X, 2f, 0, new Color(128, 0, 0, 255 - NPC.alpha), 1f); - blood.velocity.X *= 0.5f; - blood.velocity.Y *= 0.1f; - } - } - - public override void FindFrame(int frameHeight) - { - NPC.frameCounter += 1D; - if (NPC.life < NPC.lifeMax * 0.5) - { - if (NPC.frame.Y < frameHeight * 3) - NPC.frame.Y = frameHeight * 3; - if (NPC.frameCounter >= 8D) - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - if (NPC.frame.Y > frameHeight * 5) - NPC.frame.Y = frameHeight * 3; - } - } - else - { - if (NPC.frameCounter >= 8D) - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - if (NPC.frame.Y > frameHeight * 2) - NPC.frame.Y = 0; - } - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - if (NPC.ai[0] >= ChargeTelegraphGateValue) - { - Texture2D npcTexture = TextureAssets.Npc[Type].Value; - Color originalColor = NPC.GetAlpha(drawColor); - Color newColor = new Color(192, 0, 0, 255 - NPC.alpha); - Vector2 drawPosition = NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY); - Vector2 origin = NPC.frame.Size() / 2; - - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - float telegraphScalar = MathHelper.Clamp((NPC.ai[0] - ChargeTelegraphGateValue) / ChargeTelegraphGateValue, 0f, 1f); - Color telegraphColor = Color.Lerp(originalColor, newColor, telegraphScalar); - - if (CalamityClientConfig.Instance.Afterimages && NPC.ai[1] > 0f) - { - int afterimageAmount = 10; - int afterImageIncrement = 2; - for (int j = 0; j < afterimageAmount; j += afterImageIncrement) - { - Color afterimageColor = telegraphColor; - afterimageColor = Color.Lerp(afterimageColor, originalColor, 0.5f); - afterimageColor = NPC.GetAlpha(afterimageColor); - afterimageColor *= (afterimageAmount - j) / 15f; - Vector2 afterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(npcTexture.Width, npcTexture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; - afterimagePos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(npcTexture, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - } - } - - spriteBatch.Draw(npcTexture, drawPosition, NPC.frame, telegraphColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - - return false; - } - - return true; - } - - public override void HitEffect(NPC.HitInfo hit) - { - if (Main.dedServ) - return; - - if (NPC.life > 0) - { - for (int i = 0; i < hit.Damage / (double)NPC.lifeMax * 100; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f); - - if (NPC.life < NPC.lifeMax * 0.5f && NPC.localAI[0] == 0f) - { - NPC.localAI[0] = 1f; - Gore.NewGore(NPC.GetSource_FromThis(), NPC.Center, NPC.velocity, Mod.Find("BloodlettingServant1").Type); - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 2f * hit.HitDirection, -2f); - Main.dust[dust].scale = Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].velocity *= Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].color = new Color(128, 0, 0, 255 - NPC.alpha); - } - } - } - else - { - for (int i = 0; i < 100; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 2f * hit.HitDirection, -2f); - Main.dust[dust].scale = Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].velocity *= Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].color = new Color(128, 0, 0, 255 - NPC.alpha); - } - for (int g = 2; g <= 4; g++) - { - Vector2 goreVel = NPC.velocity.RotatedByRandom(MathHelper.Pi); - Gore.NewGore(NPC.GetSource_Death(), NPC.Center, goreVel, Mod.Find("BloodlettingServant" + g).Type); - } - } - } - } -} diff --git a/NPCs/NormalNPCs/BloodlettingServant.png b/NPCs/NormalNPCs/BloodlettingServant.png deleted file mode 100644 index 5bb5258c6c..0000000000 Binary files a/NPCs/NormalNPCs/BloodlettingServant.png and /dev/null differ diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index bc4f8c9849..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; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index 00d2b1d8b3..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; @@ -32,10 +31,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/BucketZombie.cs b/NPCs/NormalNPCs/BucketZombie.cs index d0b4edf209..34e87385bb 100644 --- a/NPCs/NormalNPCs/BucketZombie.cs +++ b/NPCs/NormalNPCs/BucketZombie.cs @@ -25,20 +25,16 @@ 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; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool PreAI() diff --git a/NPCs/NormalNPCs/CladCrab.cs b/NPCs/NormalNPCs/CladCrab.cs index 286ae38309..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; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/NormalNPCs/CloudElemental.cs b/NPCs/NormalNPCs/CloudElemental.cs index 11bbb3861e..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; @@ -91,10 +90,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = false; NPC.Calamity().VulnerableToHeat = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 56a6b55f02..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; @@ -48,10 +47,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index a72c027c29..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index ef1ba06395..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index 52bf6243b8..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; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index 2d5c45ced0..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 57203f5712..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 661e93c8b7..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index acc838a377..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index ee69820a97..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 71ef2aa14a..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; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index d9aa5f45f2..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; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 2ebe973bfc..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; @@ -35,10 +34,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 98a2b2a496..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; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 7fde916b9d..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; @@ -57,10 +57,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index af1c94e9ad..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; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Foveanator.cs b/NPCs/NormalNPCs/Foveanator.cs deleted file mode 100644 index 64f358dc1c..0000000000 --- a/NPCs/NormalNPCs/Foveanator.cs +++ /dev/null @@ -1,966 +0,0 @@ -using System; -using System.IO; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.DataStructures; -using CalamityMod.Events; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.Chat; -using Terraria.GameContent; -using Terraria.GameContent.Achievements; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.NormalNPCs -{ - public class Foveanator : ModNPC - { - public static int phase1IconIndex; - public static int phase2IconIndex; - - public static Asset GlowTexture; - - public override void Load() - { - string phase1IconPath = "CalamityMod/NPCs/NormalNPCs/Foveanator_Head_Boss"; - string phase2IconPath = "CalamityMod/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss"; - - phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - } - - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 6; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; - NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); - - if (!Main.dedServ) - GlowTexture = ModContent.Request("CalamityMod/NPCs/NormalNPCs/FoveanatorGlow", AssetRequestMode.AsyncLoad); - } - - public override void SetDefaults() - { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.aiStyle = -1; - AIType = -1; - NPC.GetNPCDamage(); - NPC.DR_NERD(0.2f); - - NPC.width = 100; - NPC.height = 100; - if (Main.tenthAnniversaryWorld) - NPC.scale *= 0.5f; - if (Main.getGoodWorld) - NPC.scale *= 0.8f; - - NPC.defense = 10; - NPC.lifeMax = 24000; - NPC.knockBackResist = 0f; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.boss = true; - NPC.SpawnWithHigherTime(30); - NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath14; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToSickness = true; - AnimationType = NPCID.Retinazer; - Music = MusicID.Boss2; - - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(NPC.localAI[0]); - writer.Write(NPC.localAI[1]); - writer.Write(NPC.localAI[2]); - writer.Write(NPC.localAI[3]); - for (int i = 0; i < 4; i++) - writer.Write(NPC.Calamity().newAI[i]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - NPC.localAI[0] = reader.ReadSingle(); - NPC.localAI[1] = reader.ReadSingle(); - NPC.localAI[2] = reader.ReadSingle(); - NPC.localAI[3] = reader.ReadSingle(); - for (int i = 0; i < 4; i++) - NPC.Calamity().newAI[i] = reader.ReadSingle(); - } - - public override void BossHeadSlot(ref int index) => index = NPC.ai[0] >= 3f ? phase2IconIndex : phase1IconIndex; - - public override void AI() - { - CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - - bool bossRush = BossRushEvent.BossRushActive; - - // Get a target - if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) - CalamityUtils.CalamityTargeting(NPC, default); - - float enrageScale = bossRush ? 0.5f : 0.3f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - - // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; - - // Check for Retinazer - bool retAlive = false; - if (CalamityGlobalNPC.laserEye != -1) - retAlive = Main.npc[CalamityGlobalNPC.laserEye].active; - - // Check for Spazmatism or Retinazer - bool spazAlive = false; - if (CalamityGlobalNPC.fireEye != -1) - spazAlive = Main.npc[CalamityGlobalNPC.fireEye].active; - - // Explode if ret and spaz are dead - if (!retAlive && !spazAlive) - { - NPC.life = 0; - NPC.HitEffect(); - NPC.active = false; - NPC.netUpdate = true; - return; - } - - Vector2 lookDirection = NPC.Center - Main.player[NPC.target].Center; - int direction = (NPC.Center.X < Main.player[NPC.target].position.X + Main.player[NPC.target].width) ? -1 : 1; - - float hoverRotation = lookDirection.ToRotation() + MathHelper.PiOver2; - if (hoverRotation < 0f) - hoverRotation += MathHelper.TwoPi; - else if (hoverRotation > MathHelper.TwoPi) - hoverRotation -= MathHelper.TwoPi; - - // Rotate faster during energy bomb and laser barrage - float rotationRate = NPC.ai[1] == 3f ? 0.25f : 0.15f; - NPC.rotation = NPC.rotation.AngleTowards(hoverRotation, rotationRate); - - if (Main.rand.NextBool(5)) - { - int foveaDust = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y + NPC.height * 0.25f), NPC.width, (int)(NPC.height * 0.5f), DustID.Blood, NPC.velocity.X, 2f, 0, default, 1f); - Dust dust = Main.dust[foveaDust]; - dust.velocity.X *= 0.5f; - dust.velocity.Y *= 0.1f; - } - - if (Main.netMode != NetmodeID.MultiplayerClient && !Main.player[NPC.target].dead && NPC.timeLeft < 10) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (i != NPC.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism || Main.npc[i].type == NPC.type) && Main.npc[i].timeLeft - 1 > NPC.timeLeft) - NPC.timeLeft = Main.npc[i].timeLeft - 1; - } - } - - // Phase HP ratios - float phase2LifeRatio = 0.85f; - float finalPhaseLifeRatio = 0.4f; - - // Movement variables - float phase1MaxSpeedIncrease = 2f; - float phase1MaxAccelerationIncrease = 0.025f; - float phase1MaxChargeSpeedIncrease = 1f; - - // Phase duration variables - float phase1MaxLaserPhaseDurationDecrease = 120f; - - // Go to phase 2 early if Spaz and Ret health total goes below 50% - // Go to final phase early if Spaz and Ret health total goes below 20% - float retAndSpazHPRatio = 0f; - if (CalamityGlobalNPC.fireEye != -1) - { - if (Main.npc[CalamityGlobalNPC.fireEye].active) - retAndSpazHPRatio += Main.npc[CalamityGlobalNPC.fireEye].life / (float)Main.npc[CalamityGlobalNPC.fireEye].lifeMax; - } - if (CalamityGlobalNPC.laserEye != -1) - { - if (Main.npc[CalamityGlobalNPC.laserEye].active) - retAndSpazHPRatio += Main.npc[CalamityGlobalNPC.laserEye].life / (float)Main.npc[CalamityGlobalNPC.laserEye].lifeMax; - } - - // Phase checks - bool phase2 = lifeRatio < phase2LifeRatio || retAndSpazHPRatio < 0.5f; - bool finalPhase = lifeRatio < finalPhaseLifeRatio || retAndSpazHPRatio < 0.2f; - - Vector2 mechQueenSpacing = Vector2.Zero; - if (NPC.IsMechQueenUp) - { - NPC NPC = Main.npc[NPC.mechQueen]; - Vector2 mechQueenCenter = NPC.GetMechQueenCenter(); - Vector2 eyePosition = new Vector2(0f, -300f); - eyePosition *= 0.75f; - float mechdusaRotation = NPC.velocity.X * 0.025f; - mechQueenSpacing = mechQueenCenter + eyePosition; - mechQueenSpacing = mechQueenSpacing.RotatedBy(mechdusaRotation, mechQueenCenter); - } - - NPC.reflectsProjectiles = false; - - // Despawn - if (Main.player[NPC.target].dead) - { - NPC.velocity.Y -= 0.04f; - if (NPC.timeLeft > 10) - { - NPC.timeLeft = 10; - return; - } - } - - else if (NPC.ai[0] == 0f) - { - if (NPC.ai[1] == 0f) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float maxVelocity = 8.5f; - float acceleration = 0.12f; - maxVelocity += 4.5f * enrageScale; - acceleration += 0.06f * enrageScale; - - maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - - if (Main.getGoodWorld) - { - maxVelocity *= 1.15f; - acceleration *= 1.15f; - } - - // Foveanator stays further away from the player than Retinazer (Retinazer distance is 300, Foveanator distance is 450) - float distanceFromTarget = 450f; - Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction - Vector2.UnitY * distanceFromTarget; - float distanceFromDestination = (destination - NPC.Center).Length(); - Vector2 idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitX * direction); - - if (NPC.IsMechQueenUp) - { - maxVelocity = 14f; - - destination = mechQueenSpacing; - distanceFromDestination = (destination - NPC.Center).Length(); - idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitY); - - if (distanceFromDestination > maxVelocity) - idealVelocity *= maxVelocity / distanceFromDestination; - - float inertia = 60f; - NPC.velocity = (NPC.velocity * (inertia - 1f) + idealVelocity) / inertia; - } - else - NPC.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); - - // Foveanator stays in this phase longer than Retinazer (Foveanator time is 450, Retinazer time is 300) - // Foveanator has longer cooldown between firing projectiles than Retinazer (Foveanator cooldown is 60, Retinazer cooldown is 30) - float phaseGateValue = 450f - (phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))); - float laserGateValue = 60f; - if (NPC.IsMechQueenUp) - { - phaseGateValue = 1350f; - laserGateValue = ((!NPC.npcsFoundForCheckActive[NPCID.TheDestroyerBody]) ? 120f : 180f); - } - - NPC.ai[2] += 1f; - if (NPC.ai[2] >= phaseGateValue) - { - NPC.ai[1] = 1f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - - CalamityUtils.CalamityTargeting(NPC, default); - - NPC.netUpdate = true; - } - else if (distanceFromDestination < 960f) - { - if (!Main.player[NPC.target].dead) - { - NPC.ai[3] += 1f; - if (Main.getGoodWorld) - NPC.ai[3] += 0.5f; - } - - if (NPC.ai[3] >= laserGateValue) - { - NPC.ai[3] = 0f; - - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float laserSpeed = 6f + 1.5f * enrageScale; - int type = 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 laserVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 60f, laserVelocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - else if (NPC.ai[1] == 1f) - { - // Set damage - NPC.damage = NPC.defDamage; - - NPC.rotation = hoverRotation; - - float chargeSpeed = 4f; - chargeSpeed += 1f * enrageScale; - chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) - chargeSpeed += 1f; - - NPC.velocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; - - NPC.ai[1] = 2f; - } - else if (NPC.ai[1] == 2f) - { - // Set damage - NPC.damage = NPC.defDamage; - - NPC.ai[2] += 1f; - float decelerateGateValue = 72f + (12f * ((1f - lifeRatio) / (1f - phase2LifeRatio))); - if (NPC.ai[2] >= decelerateGateValue) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float decelerationMultiplier = 0.8f - (0.2f * ((1f - lifeRatio) / (1f - phase2LifeRatio))); - NPC.velocity *= decelerationMultiplier; - - if (Math.Abs(NPC.velocity.X) < 0.1) - NPC.velocity.X = 0f; - if (Math.Abs(NPC.velocity.Y) < 0.1) - NPC.velocity.Y = 0f; - } - else - { - // Accelerative charge - float maxVelocity = 24f; - maxVelocity += 6f * enrageScale; - maxVelocity += (phase1MaxChargeSpeedIncrease * 6f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) - maxVelocity += 6f; - - if (NPC.velocity.Length() < maxVelocity) - { - NPC.velocity *= 1.04f; - if (NPC.velocity.Length() > maxVelocity) - { - NPC.velocity.Normalize(); - NPC.velocity *= maxVelocity; - } - } - - NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2; - } - - float delayBeforeChargingAgain = 96f - (6f * ((1f - lifeRatio) / (1f - phase2LifeRatio))); - if (NPC.ai[2] >= delayBeforeChargingAgain) - { - NPC.ai[3] += 1f; - NPC.ai[2] = 0f; - - NPC.rotation = hoverRotation; - - float totalCharges = 3f; - if (NPC.ai[3] >= totalCharges) - { - NPC.ai[1] = 0f; - NPC.ai[3] = 0f; - - CalamityUtils.CalamityTargeting(NPC, default); - } - else - NPC.ai[1] = 1f; - } - } - - // Enter phase 2 - if (phase2) - { - NPC.ai[0] = 1f; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - - CalamityUtils.CalamityTargeting(NPC, default); - - NPC.netUpdate = true; - } - } - - else if (NPC.ai[0] == 1f || NPC.ai[0] == 2f) - { - // Avoid cheap bullshit - NPC.damage = 0; - - if (NPC.IsMechQueenUp) - NPC.reflectsProjectiles = true; - - if (NPC.ai[0] == 1f) - { - NPC.ai[2] += 0.005f; - if (NPC.ai[2] > 0.5f) - NPC.ai[2] = 0.5f; - } - else - { - NPC.ai[2] -= 0.005f; - if (NPC.ai[2] < 0f) - NPC.ai[2] = 0f; - } - - NPC.rotation += NPC.ai[2]; - - NPC.ai[1] += 1f; - if (NPC.ai[2] >= 0.2f) - { - if (NPC.ai[1] % 20f == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = 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); - } - - float projectileSpeed = 16f; - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; - int spread = 30; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < 2; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i)); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 60f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f); - } - } - } - } - - if (NPC.ai[1] == 100f) - { - NPC.ai[0] += 1f; - NPC.ai[1] = 0f; - if (NPC.ai[0] == 3f) - { - NPC.ai[2] = 0f; - } - else - { - SoundEngine.PlaySound(SoundID.NPCHit1, NPC.Center); - - if (!Main.dedServ) - { - for (int i = 0; i < 2; i++) - { - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), Mod.Find("Foveanator1").Type, NPC.scale); - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 7, NPC.scale); - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 6, NPC.scale); - } - } - - for (int j = 0; j < 20; j++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - } - } - - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - - NPC.velocity *= 0.98f; - if (Math.Abs(NPC.velocity.X) < 0.1) - NPC.velocity.X = 0f; - if (Math.Abs(NPC.velocity.Y) < 0.1) - NPC.velocity.Y = 0f; - } - else - { - // If in phase 2 but Spaz or Ret aren't - bool spazOrRetInPhase1 = false; - if (CalamityGlobalNPC.fireEye != -1) - { - if (Main.npc[CalamityGlobalNPC.fireEye].active) - spazOrRetInPhase1 = Main.npc[CalamityGlobalNPC.fireEye].ai[0] == 1f || Main.npc[CalamityGlobalNPC.fireEye].ai[0] == 2f || Main.npc[CalamityGlobalNPC.fireEye].ai[0] == 0f; - } - if (CalamityGlobalNPC.laserEye != -1) - { - if (Main.npc[CalamityGlobalNPC.laserEye].active) - spazOrRetInPhase1 = Main.npc[CalamityGlobalNPC.laserEye].ai[0] == 1f || Main.npc[CalamityGlobalNPC.laserEye].ai[0] == 2f || Main.npc[CalamityGlobalNPC.laserEye].ai[0] == 0f; - } - - NPC.chaseable = !spazOrRetInPhase1; - - int setDamage = (int)Math.Round(NPC.defDamage * 1.5); - NPC.defense = NPC.defDefense + 14; - calamityGlobalNPC.DR = spazOrRetInPhase1 ? 0.9999f : 0.2f; - calamityGlobalNPC.unbreakableDR = spazOrRetInPhase1; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = spazOrRetInPhase1; - - NPC.HitSound = SoundID.NPCHit4; - - if (NPC.ai[1] == 0f) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float maxVelocity = 4f + (1.2f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - float acceleration = 0.06f + (0.02f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - maxVelocity += 2f * enrageScale; - acceleration += 0.04f * enrageScale; - - float distanceFromTarget = 360f; - Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction; - float distanceFromDestination = (destination - NPC.Center).Length(); - Vector2 idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitX * direction); - - if (!NPC.IsMechQueenUp) - { - // Boost speed if too far from target - if (distanceFromDestination > distanceFromTarget) - maxVelocity += MathHelper.Lerp(0f, 12f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); - - if (Main.getGoodWorld) - { - maxVelocity *= 1.15f; - acceleration *= 1.15f; - } - - NPC.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); - } - - // Fire flamethrower for x seconds - NPC.ai[2] += (retAlive && spazAlive) ? 1f : 2f; - float phaseGateValue = NPC.IsMechQueenUp ? 1350f : 360f - (90f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - if (NPC.ai[2] >= phaseGateValue) - { - // Go to charge phase or fire large barrage of lasers and energy bombs if in final phase - NPC.ai[1] = finalPhase ? 3f : 1f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - NPC.netUpdate = true; - } - - // Fire fireballs and flamethrower - else if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height)) - { - // Play flame sound on timer - NPC.localAI[2] += 1f; - if (NPC.localAI[2] > 22f) - { - NPC.localAI[2] = 0f; - SoundEngine.PlaySound(SoundID.Item34, NPC.Center); - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[1] += 1f; - if (NPC.localAI[1] > 4f) - { - NPC.localAI[1] = 0f; - - float foveanatorFlamethrowerSpeed = 4f + 2f * enrageScale; - float timeForFlamethrowerToReachMaxVelocity = (retAlive && spazAlive) ? 120f : 60f; - float flamethrowerSpeedScalar = MathHelper.Clamp(NPC.ai[2] / timeForFlamethrowerToReachMaxVelocity, 0f, 1f); - foveanatorFlamethrowerSpeed = MathHelper.Lerp(0.1f, foveanatorFlamethrowerSpeed, flamethrowerSpeedScalar); - - int type = 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) * foveanatorFlamethrowerSpeed + NPC.velocity * 0.5f; - - if (NPC.IsMechQueenUp) - flamethrowerVelocity = (NPC.rotation + MathHelper.PiOver2).ToRotationVector2() * foveanatorFlamethrowerSpeed + NPC.velocity * 0.5f; - - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 100f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); - } - } - } - - if (NPC.IsMechQueenUp) - { - maxVelocity = 14f; - - destination = mechQueenSpacing; - distanceFromDestination = (destination - NPC.Center).Length(); - idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitY); - - if (distanceFromDestination > maxVelocity) - idealVelocity *= maxVelocity / distanceFromDestination; - - float inertia = 60f; - NPC.velocity = (NPC.velocity * (inertia - 1f) + idealVelocity) / inertia; - } - } - - // Charge - else if (NPC.ai[1] == 1f) - { - // Set damage - NPC.damage = setDamage; - - // Play charge sound - // TODO - Make this a jet turbine sound or something - //SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Set rotation and velocity - NPC.rotation = hoverRotation; - - float chargeSpeed = 4.5f + (1.25f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - chargeSpeed += 4f * enrageScale; - if (Main.getGoodWorld) - chargeSpeed *= 1.2f; - - NPC.velocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; - - NPC.ai[1] = 2f; - } - - // Maintain charge velocity until deceleration - else if (NPC.ai[1] == 2f) - { - // Set damage - NPC.damage = setDamage; - - NPC.ai[2] += 1f; - - float chargeTime = 60f - (20f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - - // Slow down - if (NPC.ai[2] >= chargeTime) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float deceleration = 0.8f - (0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - NPC.velocity *= deceleration; - - if (Math.Abs(NPC.velocity.X) < 0.1) - NPC.velocity.X = 0f; - if (Math.Abs(NPC.velocity.Y) < 0.1) - NPC.velocity.Y = 0f; - } - else - { - // Accelerative charge - float maxVelocity = 27f; - maxVelocity += 6f * enrageScale; - maxVelocity += 7.5f * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) - maxVelocity *= 1.2f; - - // Spawn Energy Bombs along the way - float energyBombFireRate = 8f; - if (NPC.ai[2] % energyBombFireRate == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = 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); - } - - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.velocity.SafeNormalize(Vector2.UnitY) * 60f, Vector2.Zero, type, damage, 0f, Main.myPlayer, 1f); - } - } - - if (NPC.velocity.Length() < maxVelocity) - { - NPC.velocity *= 1.06f; - if (NPC.velocity.Length() > maxVelocity) - { - NPC.velocity.Normalize(); - NPC.velocity *= maxVelocity; - } - } - - NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2; - } - - // Charge 2 times - if (NPC.ai[2] >= chargeTime * 1.3f) - { - NPC.ai[3] += 1f; - NPC.ai[2] = 0f; - - NPC.rotation = hoverRotation; - - float maxCharges = 2f; - if (NPC.ai[3] >= maxCharges) - { - NPC.ai[1] = 0f; - NPC.ai[3] = 0f; - } - else - NPC.ai[1] = 1f; - } - } - - // Laser and energy bomb barrage - else if (NPC.ai[1] == 3f) - { - float maxVelocity = 12f + (2.4f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - float acceleration = 0.16f + (0.32f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)); - maxVelocity += 6f * enrageScale; - acceleration += 0.08f * enrageScale; - - if (Main.getGoodWorld) - { - maxVelocity *= 1.15f; - acceleration *= 1.15f; - } - - float distanceFromTarget = 640f; - Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction; - float distanceFromDestination = (destination - NPC.Center).Length(); - Vector2 idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitX * direction); - - bool gettingIntoPosition = NPC.ai[2] == 0f; - if (NPC.Distance(Main.player[NPC.target].Center) < distanceFromTarget && gettingIntoPosition) - { - NPC.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); - } - else - { - NPC.SimpleFlyMovement(idealVelocity * maxVelocity * 0.5f, acceleration * 0.5f); - - // Fire 3 spreads of energy bombs and lasers - int totalSpreads = 6; - - // Fire rates - float laserBarrageFireRate = 45f; - float energyBombFireRate = 90f; - - NPC.ai[2] += 1f; - - // Energy bombs - if (NPC.ai[2] % energyBombFireRate == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = 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; - int numProj = 3; - int spread = 30; - float rotation = MathHelper.ToRadians(spread); - 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) * 60f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f); - } - } - - NPC.ai[3] += 1f; - } - - else if (NPC.ai[2] % laserBarrageFireRate == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = 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); - } - - float projectileSpeed = 8f + 2f * enrageScale; - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; - int numProj = 4; - int spread = 40; - float rotation = MathHelper.ToRadians(spread); - 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) * 60f, perturbedSpeed, type, damage, 0f, Main.myPlayer); - } - } - - NPC.ai[3] += 1f; - } - - // Charge - if (NPC.ai[3] >= totalSpreads) - { - NPC.ai[1] = 1f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - NPC.netUpdate = true; - } - } - } - } - } - - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; - - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) - { - NPC.lifeMax = (int)(NPC.lifeMax * 0.75f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - spriteBatch.Draw(TextureAssets.Npc[Type].Value, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0f); - - Texture2D glowTexture = GlowTexture.Value; - spriteBatch.Draw(glowTexture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, Color.White, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0f); - - return false; - } - - public override void HitEffect(NPC.HitInfo hit) - { - if (NPC.life > 0) - { - for (int i = 0; (double)i < hit.Damage / (double)NPC.lifeMax * 100D; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f); - - return; - } - - for (int i = 0; i < 150; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 2 * hit.HitDirection, -2f); - - if (!Main.dedServ) - { - for (int i = 0; i < 2; i++) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 2, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 9, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), Mod.Find("Foveanator2").Type, NPC.scale); - } - } - - for (int i = 0; i < 10; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Smoke, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].velocity *= 1.4f; - } - - for (int i = 0; i < 5; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default, 2.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 5f; - dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].velocity *= 3f; - } - - if (!Main.dedServ) - { - int gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y -= 1f; - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y -= 1f; - } - } - } -} diff --git a/NPCs/NormalNPCs/Foveanator.png b/NPCs/NormalNPCs/Foveanator.png deleted file mode 100644 index 67291fe4aa..0000000000 Binary files a/NPCs/NormalNPCs/Foveanator.png and /dev/null differ diff --git a/NPCs/NormalNPCs/FoveanatorGlow.png b/NPCs/NormalNPCs/FoveanatorGlow.png deleted file mode 100644 index d8b3325658..0000000000 Binary files a/NPCs/NormalNPCs/FoveanatorGlow.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Foveanator_Head_Boss.png b/NPCs/NormalNPCs/Foveanator_Head_Boss.png deleted file mode 100644 index 7c93efb49e..0000000000 Binary files a/NPCs/NormalNPCs/Foveanator_Head_Boss.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss.png b/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss.png deleted file mode 100644 index 6a6b7c7532..0000000000 Binary files a/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index f0d28063b9..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; @@ -36,10 +36,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 23da274c57..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; @@ -55,10 +54,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index dd5b9c3d62..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; @@ -96,10 +96,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index 923a6e30ad..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; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) 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 4e3236cde9..78e7fd1c13 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs @@ -25,9 +25,10 @@ namespace CalamityMod.NPCs.NormalNPCs private const int BoltShootGateValue = 60; private const int BoltShootGateValue_Death = 75; - private const int BoltShootGateValue_BossRush = 45; private const float LightTelegraphDuration = 45f; + public static int JewelBoltDamage = 10; // 40 + public override void SetStaticDefaults() { NPCID.Sets.NeedsExpertScaling[Type] = true; @@ -39,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; @@ -55,8 +56,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Despawn if (!CalamityPlayer.areThereAnyDamnBosses) @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Fire projectiles NPC.ai[0] += 1f; - if (NPC.ai[0] >= (bossRush ? BoltShootGateValue_BossRush : death ? BoltShootGateValue_Death : BoltShootGateValue)) + if (NPC.ai[0] >= (death ? BoltShootGateValue_Death : BoltShootGateValue)) { NPC.ai[0] = 0f; @@ -153,7 +153,6 @@ namespace CalamityMod.NPCs.NormalNPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = NPC.GetProjectileDamage(type); if (death) { int numProj = 4; @@ -161,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; @@ -194,7 +193,7 @@ namespace CalamityMod.NPCs.NormalNPCs float alph = 0f; - float colorTelegraphGateValue = (BossRushEvent.BossRushActive ? BoltShootGateValue_BossRush : (CalamityWorld.death ? BoltShootGateValue_Death : BoltShootGateValue)) - LightTelegraphDuration; + float colorTelegraphGateValue = (CalamityWorld.death ? BoltShootGateValue_Death : BoltShootGateValue) - LightTelegraphDuration; if (NPC.ai[0] > colorTelegraphGateValue) alph = MathHelper.Lerp(0f, 1f, (NPC.ai[0] - colorTelegraphGateValue) / LightTelegraphDuration); diff --git a/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs b/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs index 38cd0a6c25..3ec2597317 100644 --- a/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs +++ b/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs @@ -44,10 +44,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 0bd649cac1..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; @@ -42,10 +41,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 1419f7e2b8..7c121bb4a4 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -29,20 +29,15 @@ 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; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index eb62be6480..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 29e9400b94..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; @@ -35,10 +35,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index c666e97af9..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; @@ -41,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = ModContent.NPCType(); BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -87,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 6beacd3fc0..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; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = ModContent.NPCType(); BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 41b8e24088..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; @@ -36,10 +36,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = ModContent.NPCType(); BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) 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 d766fc1f04..0ab71a7709 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; @@ -45,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) @@ -81,7 +75,7 @@ namespace CalamityMod.NPCs.NormalNPCs bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { if (Main.rand.NextBool(5)) NPC.reflectsProjectiles = true; @@ -135,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { idealVelocity *= 1.2f; acceleration *= 1.4f; @@ -190,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 31fd92aaa5..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; @@ -46,10 +45,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index 6c1e55ff38..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; @@ -56,10 +56,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Rotdog.cs b/NPCs/NormalNPCs/Rotdog.cs index 71a8eab684..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; @@ -35,10 +35,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 343fafa2b4..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 = 0.1f; + 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(); @@ -53,10 +52,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -79,8 +74,6 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.velocity.Y == 0f) { - NPC.knockBackResist = 0f; - // Avoid cheap bullshit NPC.damage = 0; @@ -141,8 +134,6 @@ namespace CalamityMod.NPCs.NormalNPCs } else { - NPC.knockBackResist = 0.1f; - if (NPC.direction == 1 && NPC.velocity.X < 1f) { NPC.velocity.X += 0.1f; diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index c41c3b21dc..fc28052dc9 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Bestiary; @@ -28,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; @@ -42,10 +42,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -89,8 +85,8 @@ namespace CalamityMod.NPCs.NormalNPCs npcPos.X += velocity.X; npcPos.Y += velocity.Y; - int spread = Main.getGoodWorld ? 100 : 20; - for (int i = 0; i < (Main.getGoodWorld ? 10 : 2); i++) + int spread = CalamityWorld.LegendaryMode ? 100 : 20; + for (int i = 0; i < (CalamityWorld.LegendaryMode ? 10 : 2); i++) { velocity = Main.player[NPC.target].Center - npcPos; targetDist = velocity.Length(); @@ -408,7 +404,7 @@ namespace CalamityMod.NPCs.NormalNPCs { return 0f; } - return SpawnCondition.Sky.Chance * (Main.getGoodWorld ? 0.5f : 0.1f); + return SpawnCondition.Sky.Chance * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs deleted file mode 100644 index 76ea9c25c2..0000000000 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ /dev/null @@ -1,921 +0,0 @@ -using System; -using System.IO; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.DataStructures; -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.Chat; -using Terraria.GameContent.Achievements; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.NormalNPCs -{ - [AutoloadBossHead] - public class SkeletronPrime2 : ModNPC - { - public override string BossHeadTexture => $"Terraria/Images/NPC_Head_Boss_18"; - - public static Asset EyeTexture; - - public const int BombTimeLeft = 600; - - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 6; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; - NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); - if (!Main.dedServ) - { - EyeTexture = ModContent.Request("CalamityMod/ExtraTextures/SkeletronPrime2HeadGlow"); - } - } - - public override void SetDefaults() - { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.aiStyle = NPCAIStyleID.SkeletronPrimeHead; - NPC.GetNPCDamage(); - NPC.DR_NERD(0.2f); - - NPC.width = 80; - NPC.height = 102; - if (Main.tenthAnniversaryWorld) - NPC.scale *= 0.5f; - if (Main.getGoodWorld) - NPC.scale *= 1.1f; - - NPC.defense = 24; - NPC.lifeMax = 28000; - NPC.knockBackResist = 0f; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.boss = true; - NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundID.NPCDeath14; - NPC.Calamity().VulnerableToElectricity = true; - NPC.Calamity().VulnerableToSickness = false; - AnimationType = NPCID.SkeletronPrime; - Music = MusicID.Boss3; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(NPC.localAI[0]); - writer.Write(NPC.localAI[1]); - writer.Write(NPC.localAI[2]); - writer.Write(NPC.localAI[3]); - for (int i = 0; i < 4; i++) - writer.Write(NPC.Calamity().newAI[i]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - NPC.localAI[0] = reader.ReadSingle(); - NPC.localAI[1] = reader.ReadSingle(); - NPC.localAI[2] = reader.ReadSingle(); - NPC.localAI[3] = reader.ReadSingle(); - for (int i = 0; i < 4; i++) - NPC.Calamity().newAI[i] = reader.ReadSingle(); - } - - public override void BossHeadRotation(ref float rotation) - { - rotation = (NPC.ai[1] == 1f || NPC.ai[1] == 2f) ? NPC.rotation : 0f; - } - - public override void AI() - { - CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - - // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; - - // Spawn arms - if (calamityGlobalNPC.newAI[1] == 0f) - { - calamityGlobalNPC.newAI[1] = 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - // This head owns the Cannon and the Vice in Master Mode - int arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.PrimeCannon, NPC.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = NPC.whoAmI; - Main.npc[arm].target = NPC.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.PrimeVice, NPC.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = NPC.whoAmI; - Main.npc[arm].target = NPC.target; - Main.npc[arm].ai[3] = 150f; - Main.npc[arm].netUpdate = true; - } - - NPC.SyncExtraAI(); - } - - if (!Main.npc[(int)NPC.ai[0]].active || Main.npc[(int)NPC.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) - { - NPC.life = 0; - NPC.HitEffect(); - NPC.active = false; - NPC.netUpdate = true; - } - else - { - // Set direction to the other head's direction - NPC.direction = Main.npc[(int)NPC.ai[0]].direction; - - // Link the HP of both heads - if (NPC.life > Main.npc[(int)NPC.ai[0]].life) - NPC.life = Main.npc[(int)NPC.ai[0]].life; - - // Push away from the lead head if too close, pull closer if too far, if Mechdusa isn't real - if (!NPC.IsMechQueenUp) - { - float pushVelocity = 0.25f; - if (Vector2.Distance(NPC.Center, Main.npc[(int)NPC.ai[0]].Center) < 80f * NPC.scale) - { - if (NPC.position.X < Main.npc[(int)NPC.ai[0]].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; - - if (NPC.position.Y < Main.npc[(int)NPC.ai[0]].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } - else if (Vector2.Distance(NPC.Center, Main.npc[(int)NPC.ai[0]].Center) > 240f * NPC.scale) - { - if (NPC.position.X < Main.npc[(int)NPC.ai[0]].position.X) - NPC.velocity.X += pushVelocity; - else - NPC.velocity.X -= pushVelocity; - - if (NPC.position.Y < Main.npc[(int)NPC.ai[0]].position.Y) - NPC.velocity.Y += pushVelocity; - else - NPC.velocity.Y -= pushVelocity; - } - } - } - - // Check if arms are alive - bool cannonAlive = false; - bool laserAlive = false; - bool viceAlive = false; - bool sawAlive = false; - if (CalamityGlobalNPC.primeCannon != -1) - { - if (Main.npc[CalamityGlobalNPC.primeCannon].active) - cannonAlive = true; - } - if (CalamityGlobalNPC.primeLaser != -1) - { - if (Main.npc[CalamityGlobalNPC.primeLaser].active) - laserAlive = true; - } - if (CalamityGlobalNPC.primeVice != -1) - { - if (Main.npc[CalamityGlobalNPC.primeVice].active) - viceAlive = true; - } - if (CalamityGlobalNPC.primeSaw != -1) - { - if (Main.npc[CalamityGlobalNPC.primeSaw].active) - sawAlive = true; - } - bool allArmsDead = !cannonAlive && !laserAlive && !viceAlive && !sawAlive; - NPC.chaseable = allArmsDead; - - NPC.defense = NPC.defDefense; - - // Phases - bool phase2 = lifeRatio < 0.66f; - bool phase3 = lifeRatio < 0.33f; - bool spawnSpazmatism = lifeRatio < 0.5f && !bossRush && NPC.localAI[2] == 0f; - - // Spawn Spazmatism in Master Mode (just like Oblivion from Avalon) - if (spawnSpazmatism) - { - Player spazmatismSpawnPlayer = Main.player[Player.FindClosest(NPC.position, NPC.width, NPC.height)]; - SoundEngine.PlaySound(SoundID.Roar, spazmatismSpawnPlayer.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int spazmatism = NPC.NewNPC(NPC.GetBossSpawnSource(spazmatismSpawnPlayer.whoAmI), (int)spazmatismSpawnPlayer.Center.X, (int)spazmatismSpawnPlayer.Center.Y - 810, NPCID.Retinazer, 1); - if (spazmatism != Main.maxNPCs) - { - Main.npc[spazmatism].target = spazmatismSpawnPlayer.whoAmI; - Main.npc[spazmatism].timeLeft *= 20; - Main.npc[spazmatism].localAI[3] = 1f; - Main.npc[spazmatism].SyncVanillaLocalAI(); - string typeName = Main.npc[spazmatism].TypeName; - if (Main.dedServ && spazmatism < Main.maxNPCs) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, spazmatism); - - AchievementsHelper.CheckMechaMayhem(); - } - } - - NPC.localAI[2] = 1f; - NPC.SyncVanillaLocalAI(); - } - - // Despawn - if (Main.npc[(int)NPC.ai[0]].ai[1] == 3f) - NPC.ai[1] = 3f; - - // Activate daytime enrage - if (Main.IsItDay() && !bossRush && NPC.ai[1] != 3f && NPC.ai[1] != 2f) - { - // Heal - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int healAmt = NPC.life - 300; - if (healAmt < 0) - { - int absHeal = Math.Abs(healAmt); - NPC.life += absHeal; - NPC.HealEffect(absHeal, true); - NPC.netUpdate = true; - } - } - - NPC.ai[1] = 2f; - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - } - - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[1] == 5f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - - bool normalLaserRotation = NPC.localAI[1] % 2f == 0f; - - // Prevents cheap hits - bool canUseAttackInMaster = NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 350f; - - // 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 - bool otherHeadChargingOrSpinning = Main.npc[(int)NPC.ai[0]].ai[1] == 5f || Main.npc[(int)NPC.ai[0]].ai[1] == 1f; - - // Start spin phase after 1.875 seconds - NPC.ai[2] += phase3 ? 1.2f : 0.8f; - if (NPC.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || phase3) && canUseAttackInMaster) - { - bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 320f && - Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 400f; - - bool shouldCharge = !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; - if (shouldCharge) - { - NPC.ai[2] = 0f; - NPC.ai[1] = 1f; - NPC.netUpdate = true; - } - else if (shouldSpinAround || NPC.ai[1] != 4f) - { - if (shouldSpinAround) - { - NPC.localAI[3] = 300f; - NPC.SyncVanillaLocalAI(); - } - - NPC.ai[2] = 0f; - NPC.ai[1] = shouldSpinAround ? 5f : 1f; - NPC.netUpdate = true; - } - } - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation = NPC.velocity.X / 15f; - - float acceleration = (bossRush ? 0.16f : 0.12f) + (death ? 0.05f * (1f - lifeRatio) : 0f); - float accelerationMult = 1f; - if (!cannonAlive) - { - acceleration += 0.0125f; - accelerationMult += 0.25f; - } - if (!laserAlive) - { - acceleration += 0.0125f; - accelerationMult += 0.25f; - } - if (!viceAlive) - acceleration += 0.0125f; - if (!sawAlive) - acceleration += 0.0125f; - acceleration *= accelerationMult; - - float topVelocity = acceleration * 100f; - float deceleration = 0.7f; - - float headDecelerationUpDist = 0f; - float headDecelerationDownDist = 0f; - float headDecelerationHorizontalDist = 0f; - int headHorizontalDirection = ((!(Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X < NPC.Center.X)) ? 1 : (-1)); - if (NPC.IsMechQueenUp) - { - headDecelerationHorizontalDist = -150f * (float)headHorizontalDirection; - headDecelerationUpDist = 50f; - headDecelerationDownDist = 50f; - } - - if (NPC.position.Y > Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - (320f + headDecelerationUpDist)) - { - if (NPC.velocity.Y > 0f) - NPC.velocity.Y *= deceleration; - - NPC.velocity.Y -= acceleration; - - if (NPC.velocity.Y > topVelocity) - NPC.velocity.Y = topVelocity; - } - else if (NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - (360f + headDecelerationDownDist)) - { - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= deceleration; - - NPC.velocity.Y += acceleration; - - if (NPC.velocity.Y < -topVelocity) - NPC.velocity.Y = -topVelocity; - } - - if (NPC.Center.X > Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X + (400f + headDecelerationHorizontalDist)) - { - if (NPC.velocity.X > 0f) - NPC.velocity.X *= deceleration; - - NPC.velocity.X -= acceleration; - - if (NPC.velocity.X > topVelocity) - NPC.velocity.X = topVelocity; - } - if (NPC.Center.X < Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - (400f + headDecelerationHorizontalDist)) - { - if (NPC.velocity.X < 0f) - NPC.velocity.X *= deceleration; - - NPC.velocity.X += acceleration; - - if (NPC.velocity.X < -topVelocity) - NPC.velocity.X = -topVelocity; - } - } - - else - { - // Spinning - if (NPC.ai[1] == 1f) - { - NPC.defense *= 2; - NPC.damage = NPC.defDamage * 2; - - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; - - if (phase2 && Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= 60f) - { - NPC.localAI[0] = 0f; - - int totalProjectiles = bossRush ? 20 : death ? 12 : 10; - float radians = MathHelper.TwoPi / totalProjectiles; - int type = ProjectileID.FrostBeam; - 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 = 4.5f; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); - 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) * 140f, laserFireDirection, type, damage, 0f, Main.myPlayer, 1f, 0f); - Main.projectile[proj].timeLeft = 600; - } - NPC.localAI[1] += 1f; - } - } - - NPC.ai[2] += 1f; - if (NPC.ai[2] == 2f) - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Spin for 3 seconds then return to floating phase - float phaseTimer = 240f; - if (phase2 && !phase3) - phaseTimer += 60f; - - if (NPC.ai[2] >= (phaseTimer - (death ? 60f * (1f - lifeRatio) : 0f))) - { - NPC.ai[2] = 0f; - NPC.ai[1] = 4f; - NPC.localAI[0] = 0f; - } - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation += NPC.direction * 0.3f; - - Vector2 headPosition = NPC.Center; - float headTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headPosition.X; - float headTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headPosition.Y; - float headTargetDistance = (float)Math.Sqrt(headTargetX * headTargetX + headTargetY * headTargetY); - - float speed = bossRush ? 12f : 8f; - if (phase2) - speed += 0.5f; - if (phase3) - speed += 0.5f; - - if (headTargetDistance > 150f) - { - float baseDistanceVelocityMult = 1f + MathHelper.Clamp((headTargetDistance - 150f) * 0.0015f, 0.05f, 1.5f); - speed *= baseDistanceVelocityMult; - } - - if (NPC.IsMechQueenUp) - { - float mechdusaSpeedMult = (NPC.npcsFoundForCheckActive[NPCID.TheDestroyerBody] ? 0.6f : 0.75f); - speed *= mechdusaSpeedMult; - } - - headTargetDistance = speed / headTargetDistance; - NPC.velocity.X = headTargetX * headTargetDistance; - NPC.velocity.Y = headTargetY * headTargetDistance; - - if (NPC.IsMechQueenUp) - { - float mechdusaAccelMult = Vector2.Distance(NPC.Center, Main.player[Main.npc[(int)NPC.ai[0]].target].Center); - if (mechdusaAccelMult < 0.1f) - mechdusaAccelMult = 0f; - - if (mechdusaAccelMult < speed) - NPC.velocity = NPC.velocity.SafeNormalize(Vector2.Zero) * mechdusaAccelMult; - } - } - - // Daytime enrage - if (NPC.ai[1] == 2f) - { - NPC.damage = 1000; - calamityGlobalNPC.DR = 0.9999f; - calamityGlobalNPC.unbreakableDR = true; - - calamityGlobalNPC.CurrentlyEnraged = true; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation += NPC.direction * 0.3f; - - Vector2 enragedHeadPosition = NPC.Center; - float enragedHeadTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - enragedHeadPosition.X; - float enragedHeadTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - enragedHeadPosition.Y; - float enragedHeadTargetDist = (float)Math.Sqrt(enragedHeadTargetX * enragedHeadTargetX + enragedHeadTargetY * enragedHeadTargetY); - - float enragedHeadSpeed = 10f; - enragedHeadSpeed += enragedHeadTargetDist / 100f; - if (enragedHeadSpeed < 8f) - enragedHeadSpeed = 8f; - if (enragedHeadSpeed > 32f) - enragedHeadSpeed = 32f; - - enragedHeadTargetDist = enragedHeadSpeed / enragedHeadTargetDist; - NPC.velocity.X = enragedHeadTargetX * enragedHeadTargetDist; - NPC.velocity.Y = enragedHeadTargetY * enragedHeadTargetDist; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= 60f) - { - NPC.localAI[0] = 0f; - Vector2 headCenter = NPC.Center; - if (Collision.CanHit(headCenter, 1, 1, Main.player[Main.npc[(int)NPC.ai[0]].target].position, Main.player[Main.npc[(int)NPC.ai[0]].target].width, Main.player[Main.npc[(int)NPC.ai[0]].target].height)) - { - enragedHeadSpeed = 7f; - float enragedHeadSkullTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headCenter.X + Main.rand.Next(-20, 21); - float enragedHeadSkullTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21); - float enragedHeadSkullTargetDist = (float)Math.Sqrt(enragedHeadSkullTargetX * enragedHeadSkullTargetX + enragedHeadSkullTargetY * enragedHeadSkullTargetY); - enragedHeadSkullTargetDist = enragedHeadSpeed / enragedHeadSkullTargetDist; - enragedHeadSkullTargetX *= enragedHeadSkullTargetDist; - enragedHeadSkullTargetY *= enragedHeadSkullTargetDist; - - Vector2 value = new Vector2(enragedHeadSkullTargetX * 1f + Main.rand.Next(-50, 51) * 0.01f, enragedHeadSkullTargetY * 1f + Main.rand.Next(-50, 51) * 0.01f).SafeNormalize(Vector2.UnitY); - value *= enragedHeadSpeed; - value += NPC.velocity; - enragedHeadSkullTargetX = value.X; - enragedHeadSkullTargetY = value.Y; - - int type = ProjectileID.Skull; - headCenter += value * 5f; - int enragedSkulls = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, 250, 0f, Main.myPlayer, -1f, 0f); - Main.projectile[enragedSkulls].timeLeft = 300; - } - } - } - } - - // Despawning - if (NPC.ai[1] == 3f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - if (NPC.IsMechQueenUp) - { - int mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Retinazer); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].EncourageDespawn(5); - - mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Spazmatism); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].EncourageDespawn(5); - - if (!NPC.AnyNPCs(NPCID.Retinazer) && !NPC.AnyNPCs(NPCID.Spazmatism)) - { - mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.TheDestroyer); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].Transform(NPCID.TheDestroyerTail); - - NPC.EncourageDespawn(5); - } - - NPC.velocity.Y += 0.1f; - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= 0.95f; - - NPC.velocity.X *= 0.95f; - if (NPC.velocity.Y > 13f) - NPC.velocity.Y = 13f; - } - else - { - NPC.velocity.Y += 0.1f; - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= 0.9f; - - NPC.velocity.X *= 0.9f; - - if (NPC.timeLeft > 500) - NPC.timeLeft = 500; - } - } - - // 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; - - float bombSpawnDivisor = bossRush ? 14f : death ? 22f - (float)Math.Round(5f * (1f - lifeRatio)) : 22f; - float totalBombs = 6f; - int bombSpread = bossRush ? 250 : death ? 125 : 100; - - // Spin for about 3 seconds - float spinVelocity = 24f; - if (NPC.ai[2] == 2f) - { - // Play angry noise - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Set spin direction - if (Main.player[Main.npc[(int)NPC.ai[0]].target].velocity.X > 0f) - calamityGlobalNPC.newAI[0] = 1f; - else if (Main.player[Main.npc[(int)NPC.ai[0]].target].velocity.X < 0f) - calamityGlobalNPC.newAI[0] = -1f; - else - calamityGlobalNPC.newAI[0] = Main.player[Main.npc[(int)NPC.ai[0]].target].direction; - - // Set spin velocity - NPC.velocity.X = MathHelper.Pi * NPC.localAI[3] / spinVelocity; - NPC.velocity *= -calamityGlobalNPC.newAI[0]; - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - - // Maintain velocity and spit homing bombs - else if (NPC.ai[2] > 2f) - { - NPC.velocity = NPC.velocity.RotatedBy(MathHelper.Pi / spinVelocity * -calamityGlobalNPC.newAI[0]); - if (NPC.ai[2] == 3f) - NPC.velocity *= 0.6f; - - if (NPC.ai[2] % bombSpawnDivisor == 0f) - { - NPC.localAI[0] += 1f; - - if (Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 64f) - { - SoundEngine.PlaySound(SoundID.Item61, NPC.Center); - CreateParticles(NPC, new Vector2(NPC.Center.X + Main.rand.Next(NPC.width / 2), NPC.Center.Y + 4f)); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 headCenter = NPC.Center; - float enragedHeadSpeed = 6f + (death ? 2f * (1f - lifeRatio) : 0f); - float enragedHeadBombTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headCenter.X + Main.rand.Next(-20, 21); - float enragedHeadBombTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21); - float enragedHeadBombTargetDist = (float)Math.Sqrt(enragedHeadBombTargetX * enragedHeadBombTargetX + enragedHeadBombTargetY * enragedHeadBombTargetY); - enragedHeadBombTargetDist = enragedHeadSpeed / enragedHeadBombTargetDist; - enragedHeadBombTargetX *= enragedHeadBombTargetDist; - enragedHeadBombTargetY *= enragedHeadBombTargetDist; - - Vector2 value = new Vector2(enragedHeadBombTargetX + Main.rand.Next(-bombSpread, bombSpread + 1) * 0.01f, enragedHeadBombTargetY + Main.rand.Next(-bombSpread, bombSpread + 1) * 0.01f).SafeNormalize(Vector2.UnitY); - value *= enragedHeadSpeed; - enragedHeadBombTargetX = value.X; - enragedHeadBombTargetY = value.Y; - - int type = ProjectileID.BombSkeletronPrime; - 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 enragedBombs = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadBombTargetX, enragedHeadBombTargetY, type, damage, 0f, Main.myPlayer, -1f); - Main.projectile[enragedBombs].timeLeft = BombTimeLeft; - Main.projectile[enragedBombs].tileCollide = false; - } - } - - // Go to floating phase, or spinning phase if in phase 2 - if (NPC.localAI[0] >= totalBombs) - { - NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY); - - // Fly overhead and spit spreads of bombs into the air if on low health - NPC.ai[1] = phase3 ? 6f : 1f; - NPC.ai[2] = 0f; - NPC.localAI[3] = 0f; - NPC.localAI[0] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.SyncVanillaLocalAI(); - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - } - } - } - - // Fly overhead and spit bombs - if (NPC.ai[1] == 6f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - NPC.rotation = NPC.velocity.X / 15f; - - float flightVelocity = bossRush ? 28f : death ? 25f : 22f; - float flightAcceleration = bossRush ? 1.16f : death ? 0.96f : 0.76f; - - Vector2 destination = new Vector2(Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X, Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - 420f); - NPC.SimpleFlyMovement((destination - NPC.Center).SafeNormalize(Vector2.UnitY) * flightVelocity, flightAcceleration); - - // Spit bombs and then go to floating phase - NPC.localAI[3] += 1f; - if (Vector2.Distance(NPC.Center, destination) < 160f || NPC.ai[2] > 0f || NPC.localAI[3] > 120f) - { - float bombSpawnDivisor = death ? 50f : 60f; - float totalBombSpreads = 2f; - NPC.ai[2] += 1f; - if (NPC.ai[2] % bombSpawnDivisor == 0f) - { - NPC.localAI[0] += 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int totalProjectiles = bossRush ? 24 : 12; - float radians = MathHelper.TwoPi / totalProjectiles; - int type = ProjectileID.BombSkeletronPrime; - 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 = 12f; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); - Vector2 upwardVelocity = Vector2.UnitY * velocity; - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 bombVelocity = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f + bombVelocity.SafeNormalize(Vector2.UnitY) * 15f, bombVelocity - upwardVelocity, type, damage, 0f, Main.myPlayer, -2f); - Main.projectile[proj].timeLeft = BombTimeLeft; - Main.projectile[proj].tileCollide = false; - } - NPC.localAI[1] += 1f; - } - - SoundEngine.PlaySound(SoundID.Item62, NPC.Center); - CreateParticles(NPC, new Vector2(NPC.Center.X, NPC.Center.Y + 4f), 5); - - if (NPC.localAI[0] >= totalBombSpreads) - { - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.localAI[3] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.localAI[0] = 0f; - NPC.SyncVanillaLocalAI(); - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - } - } - } - } - } - - private void CreateParticles(NPC npc, Vector2 position, int amountMultiplier = 1) - { - int firstDustCloudParticleAmount = 30 * amountMultiplier; - int secondDustCloudParticleAmount = 20 * amountMultiplier; - int goreAmount = 2 * amountMultiplier; - - for (int dustIndex = 0; dustIndex < firstDustCloudParticleAmount; dustIndex++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 1.4f; - } - - for (int dustIndex = 0; dustIndex < secondDustCloudParticleAmount; dustIndex++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 3.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 7f; - dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 3f; - } - - for (int goreIndex = 0; goreIndex < goreAmount; goreIndex++) - { - float goreVelocityMultiplier = 0.4f; - if (goreIndex >= goreAmount / 2) - goreVelocityMultiplier = 0.8f; - - int gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y -= 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y -= 1f; - } - } - - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; - - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) - { - NPC.lifeMax = (int)(NPC.lifeMax * 0.75f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override bool CheckActive() => false; - - public override bool CheckDead() - { - // Kill the lead head if he's still alive when this head dies - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == NPCID.SkeletronPrime && nPC.life > 0) - { - nPC.life = 0; - nPC.HitEffect(); - nPC.checkDead(); - nPC.active = false; - nPC.netUpdate = true; - } - } - - return true; - } - - public override void HitEffect(NPC.HitInfo hit) - { - if (NPC.life <= 0) - { - if (!Main.dedServ) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_1").Type, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_2").Type, NPC.scale); - - int gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y += 1f; - - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y += 1f; - - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y -= 1f; - - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y -= 1f; - } - - for (int i = 0; i < 10; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 1.4f; - } - - for (int i = 0; i < 5; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 5f; - - dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 3f; - } - } - } - } -} diff --git a/NPCs/NormalNPCs/SkeletronPrime2.png b/NPCs/NormalNPCs/SkeletronPrime2.png deleted file mode 100644 index c019c31308..0000000000 Binary files a/NPCs/NormalNPCs/SkeletronPrime2.png and /dev/null differ diff --git a/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png b/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png deleted file mode 100644 index 38362cb253..0000000000 Binary files a/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index 54d7a9714c..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; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index d866ccbd01..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; @@ -47,10 +47,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) 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 360d470790..9ad32c868c 100644 --- a/NPCs/NormalNPCs/WildBumblebirb.cs +++ b/NPCs/NormalNPCs/WildBumblebirb.cs @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -158,7 +154,7 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerIdleTargetDist.Normalize(); swarmerIdleTargetDist *= swarmerIdleSpeed; NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; } else if (NPC.velocity.Length() > 2f) @@ -206,7 +202,7 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerChargeTargetDist.Normalize(); swarmerChargeTargetDist *= swarmerChargeSpeed; NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; NPC.ForceNetUpdate(); @@ -234,7 +230,7 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerDecelerateTargetDist.Normalize(); swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) @@ -251,7 +247,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = NPC.defDamage; NPC.velocity = swarmerDecelerateTargetDist; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) @@ -313,7 +309,7 @@ namespace CalamityMod.NPCs.NormalNPCs 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.damage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), 45, 0f, Main.myPlayer, ai0.ToRotation(), ai); } } } diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 80a086b0d8..8546cfcaf7 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; @@ -64,10 +64,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = true; if (Main.zenithWorld) NPC.scale = 1.5f; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 58beddcec3..784c9cd5f4 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; @@ -81,10 +81,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 8427304eff..6d089b7204 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -55,19 +55,15 @@ 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; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index b278e299f7..56c020c681 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; @@ -88,10 +88,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 32f84de137..ced5a43f1d 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; @@ -68,10 +68,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = true; if (Main.zenithWorld) NPC.scale = 2f; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 1d6b35bf42..d45c0316c4 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; @@ -110,9 +119,6 @@ namespace CalamityMod.NPCs.OldDuke NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -193,13 +199,12 @@ namespace CalamityMod.NPCs.OldDuke float lifeRatio = NPC.life / (float)NPC.lifeMax; // Variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; float exhaustionGateValue = 360f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) exhaustionGateValue *= 0.5f; float numberOfAttacksBeforeExhaustion = 12f; @@ -213,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; @@ -230,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; } @@ -271,15 +274,7 @@ namespace CalamityMod.NPCs.OldDuke chargeVelocity = expertMode ? 24f : 23f; } - if (bossRush) - { - idlePhaseTimer = 35; - idlePhaseAcceleration *= 1.25f; - idlePhaseVelocity *= 1.2f; - chargeTime -= 3; - chargeVelocity *= 1.25f; - } - else if (death) + if (death) { idlePhaseTimer = 51; idlePhaseAcceleration *= 1.05f; @@ -297,29 +292,29 @@ namespace CalamityMod.NPCs.OldDuke } // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.MaliceMode) chargeVelocity *= 1.25f; if (exhausted) idlePhaseVelocity *= 0.25f; // Variables - int maxToothBallBelches = bossRush ? 5 : death ? 4 : 3; - int toothBallBelchPhaseDivisor = bossRush ? 24 : death ? 30 : 40; + int maxToothBallBelches = death ? 4 : 3; + int toothBallBelchPhaseDivisor = death ? 30 : 40; int toothBallBelchPhaseTimer = toothBallBelchPhaseDivisor * maxToothBallBelches; - float toothBallBelchPhaseAcceleration = bossRush ? 0.95f : death ? 0.6f : 0.55f; - float toothBallBelchPhaseVelocity = bossRush ? 14f : death ? 10f : 9f; + float toothBallBelchPhaseAcceleration = death ? 0.6f : 0.55f; + float toothBallBelchPhaseVelocity = death ? 10f : 9f; float toothBallFinalVelocity = death ? 14f : revenge ? 13f : 12f; float goreVelocityX = death ? 8f : revenge ? 7.5f : expertMode ? 7f : 6f; float goreVelocityY = death ? 10.5f : revenge ? 10f : expertMode ? 9.5f : 8f; - float sharkronVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float sharkronVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; int attackTimer = 120; int phaseTransitionTimer = 180; int teleportPauseTimer = 30; - int toothBallSpinPhaseDivisor = bossRush ? 27 : death ? 32 : 45; + int toothBallSpinPhaseDivisor = death ? 32 : 45; int toothBallSpinTimer = maxToothBallBelches * toothBallSpinPhaseDivisor; float spinTime = toothBallSpinTimer / 2f; - float toothBallSpinToothBallVelocity = bossRush ? 14f : death ? 9.5f : 9f; + float toothBallSpinToothBallVelocity = death ? 9.5f : 9f; float spinAttackSpeed = Main.zenithWorld ? 44f : 22f; float spinSpeed = MathHelper.TwoPi / spinTime; @@ -365,7 +360,8 @@ namespace CalamityMod.NPCs.OldDuke if (exhausted) { - NPC.Calamity().canBreakPlayerDefense = false; + // Disable contact damage while tired + NPC.damage = 0; // Play exhausted sound if (calamityGlobalNPC.newAI[0] % 60f == 0f && Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f) @@ -388,12 +384,11 @@ 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); } } - calamityGlobalNPC.newAI[0] -= bossRush ? 1.5f : 1f; + calamityGlobalNPC.newAI[0] -= 1f; if (calamityGlobalNPC.newAI[0] <= 0f) { calamityGlobalNPC.newAI[0] = 0f; @@ -402,14 +397,14 @@ namespace CalamityMod.NPCs.OldDuke } // Enrage variable - bool enrage = !bossRush && + bool enrage = !BossRushEvent.BossRushActive && (player.position.Y < 300f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 8000f && player.position.X < (Main.maxTilesX * 16 - 8000))); // Check for the flipped Abyss if (Main.remixWorld) { - enrage = !bossRush && + enrage = !BossRushEvent.BossRushActive && (player.position.Y < Main.UnderworldLayer * 16 * 0.8f || player.position.Y > Main.UnderworldLayer * 16 || (player.position.X > 8000f && player.position.X < (Main.maxTilesX * 16 - 8000))); } @@ -425,11 +420,11 @@ namespace CalamityMod.NPCs.OldDuke bool biomeEnraged = NPC.localAI[1] <= 0f; - NPC.Calamity().CurrentlyEnraged = biomeEnraged || bossRush; + NPC.Calamity().CurrentlyEnraged = biomeEnraged; // Increased DR while transitioning phases and not exhausted if (!exhausted) - calamityGlobalNPC.DR = (NPC.ai[0] == -1f || NPC.ai[0] == 4f || NPC.ai[0] == 9f) ? (bossRush ? 0.99f : 0.75f) : 0.5f; + calamityGlobalNPC.DR = (NPC.ai[0] == -1f || NPC.ai[0] == 4f || NPC.ai[0] == 9f) ? 0.75f : 0.5f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = NPC.ai[0] == -1f || NPC.ai[0] == 4f || NPC.ai[0] == 9f; @@ -450,12 +445,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 (CalamityWorld.MaliceMode) chargeTime *= 2; // Set variables for spawn effects @@ -572,7 +567,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 @@ -642,9 +637,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); @@ -755,11 +747,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 (CalamityWorld.MaliceMode && NPC.ai[2] % 10f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -823,9 +812,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); @@ -909,9 +895,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); @@ -931,7 +914,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { 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); @@ -956,9 +939,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); @@ -978,7 +958,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { 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); @@ -1005,9 +985,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); @@ -1130,11 +1107,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 (CalamityWorld.MaliceMode && NPC.ai[2] % 8f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -1190,9 +1164,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) { @@ -1200,10 +1171,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) @@ -1274,9 +1244,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); @@ -1290,20 +1257,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 = Main.getGoodWorld ? 40 : 20; + int totalGore = CalamityWorld.LegendaryMode ? 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { 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); } } } @@ -1339,9 +1305,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); @@ -1361,7 +1324,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { 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); @@ -1388,9 +1351,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) @@ -1525,11 +1485,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 (CalamityWorld.MaliceMode && NPC.ai[2] % 6f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -1585,7 +1542,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 @@ -1650,9 +1607,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); @@ -1666,20 +1620,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 = Main.getGoodWorld ? 40 : 20; + int totalGore = CalamityWorld.LegendaryMode ? 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { 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); } } } @@ -1696,7 +1649,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { 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); @@ -1721,9 +1674,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) { @@ -1731,10 +1681,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) @@ -1809,7 +1758,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) @@ -2092,7 +2040,7 @@ namespace CalamityMod.NPCs.OldDuke return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -2166,8 +2114,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 8d259c4bd9..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; @@ -45,20 +48,15 @@ namespace CalamityMod.NPCs.OldDuke NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.65f, 0.55f, 0f); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.rotation += NPC.velocity.X * 0.05f; @@ -117,7 +115,7 @@ namespace CalamityMod.NPCs.OldDuke float velocity = death ? 14f : revenge ? 13f : 12f; if (expertMode) { - float speedUpMult = bossRush ? 0.01f : 0.005f; + float speedUpMult = 0.005f; velocity += Vector2.Distance(player.Center, NPC.Center) * speedUpMult; } @@ -147,7 +145,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.velocity.X = (NPC.velocity.X * inertia + targetXDist) / (inertia + 1f); NPC.velocity.Y = (NPC.velocity.Y * inertia + targetYDist) / (inertia + 1f); - float toothBallAccel = bossRush ? 0.65f : 0.5f; + float toothBallAccel = 0.5f; foreach (var n in Main.ActiveNPCs) { if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) @@ -188,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; @@ -197,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); } } @@ -216,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; @@ -259,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 e2b4fdfe64..ea7de4d8dd 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) @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.OldDuke NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -74,10 +70,9 @@ namespace CalamityMod.NPCs.OldDuke { Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.7f * NPC.Opacity, 0.9f * NPC.Opacity, 0f); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead) { @@ -106,12 +101,12 @@ namespace CalamityMod.NPCs.OldDuke // Fly up bool upwardAI = NPC.ai[3] < 0f; - float flyTowardTargetGateValue = bossRush ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; - float extraTime = bossRush ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; + float flyTowardTargetGateValue = death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; + float extraTime = death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; float aiGateValue = flyTowardTargetGateValue + extraTime; float dieGateValue = aiGateValue + extraTime * 4f; float fallDownGateValue = aiGateValue + extraTime; - float maxVelocity = bossRush ? 22f : death ? 20f : revenge ? 19f : expertMode ? 18f : 16f; + float maxVelocity = death ? 20f : revenge ? 19f : expertMode ? 18f : 16f; if (NPC.ai[0] == 0f) { @@ -146,7 +141,7 @@ namespace CalamityMod.NPCs.OldDuke Vector2 targetDistance = Main.player[NPC.target].Center - NPC.Center; targetDistance.Normalize(); targetDistance *= scaleFactor2; - float inertia = bossRush ? 20f : death ? 23f : revenge ? 25f : expertMode ? 27f : 30f; + float inertia = death ? 23f : revenge ? 25f : expertMode ? 27f : 30f; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetDistance) / inertia; NPC.velocity.Normalize(); NPC.velocity *= scaleFactor2; @@ -212,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 && Main.getGoodWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) { 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) @@ -273,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 360e1a19fa..5811af7d54 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,8 @@ namespace CalamityMod.NPCs.Other public override void ModifyNPCLoot(NPCLoot npcLoot) { double pisquaredover6 = Math.Pow(MathHelper.Pi, 2) / 6; - npcLoot.AddIf(() => CalamityWorld.LegendaryMode && CalamityWorld.revenge, ModContent.ItemType()); // guaranteed in legendarev mode - npcLoot.AddIf(() => !(CalamityWorld.LegendaryMode && CalamityWorld.revenge), ModContent.ItemType(), 27); // otherwise 1 in 27 + 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(), 1, 22, (int)(pisquaredover6 * 100)); } } diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index cbc5e97425..18063cf7e3 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -39,12 +39,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 20; // 40 NPC.width = 60; NPC.height = 60; NPC.defense = 8; - NPC.LifeMaxNERB(2700, 3240, 80000); + NPC.LifeMaxNERB(2160, 2600, 80000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -60,9 +60,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -72,10 +70,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -147,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 04b29437b1..94bbae9e1f 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -36,13 +36,13 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 14; // 28 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 40; NPC.defense = 6; - NPC.LifeMaxNERB(180, 216, 7000); + NPC.LifeMaxNERB(144, 172, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -58,9 +58,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -72,16 +70,11 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.realLife = -1; @@ -114,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; @@ -130,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(); @@ -151,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; @@ -207,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) @@ -286,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); } } } @@ -323,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 0ef54560de..160109d293 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -34,12 +34,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 42; NPC.height = 42; NPC.defense = 4; - NPC.LifeMaxNERB(1200, 1440, 50000); + NPC.LifeMaxNERB(960, 1152, 50000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -55,9 +55,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -142,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 600cdb43e7..ab2fd8ced9 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -12,6 +12,7 @@ using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.NPCs.Perforator @@ -25,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() @@ -48,17 +47,20 @@ 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; NPC.defense = 4; - NPC.LifeMaxNERB(2700, 3240, 80000); + NPC.LifeMaxNERB(2160, 2600, 80000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -73,9 +75,7 @@ namespace CalamityMod.NPCs.Perforator NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -85,10 +85,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -106,24 +102,21 @@ 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(); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -135,23 +128,6 @@ namespace CalamityMod.NPCs.Perforator Player player = Main.player[NPC.target]; - // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCrimson || bossRush)) - enrageScale += 1f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) - enrageScale += 1f; - // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -160,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); } @@ -223,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), @@ -239,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); } } } @@ -365,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 @@ -537,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) @@ -636,11 +598,8 @@ namespace CalamityMod.NPCs.Perforator } } - public override void BossLoot(ref string name, ref int potionType) - { - name = CalamityUtils.GetTextValue("NPCs.PerforatorLarge"); - potionType = ItemID.HealingPotion; - } + public override LocalizedText DeathMessage => CalamityUtils.GetText("NPCs.PerforatorLarge"); + public override void BossLoot(ref int potionType) => potionType = ItemID.HealingPotion; public override bool SpecialOnKill() { diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 2638f557a3..9d2065858e 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -11,6 +11,7 @@ using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.NPCs.Perforator @@ -24,7 +25,6 @@ namespace CalamityMod.NPCs.Perforator public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfMediumDeath"); public static Asset GlowTexture; - public override void SetStaticDefaults() { NPCID.Sets.BossBestiaryPriority.Add(Type); @@ -48,13 +48,13 @@ 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; NPC.defense = 2; - NPC.LifeMaxNERB(180, 216, 7000); + NPC.LifeMaxNERB(144, 172, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -69,9 +69,7 @@ namespace CalamityMod.NPCs.Perforator NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -83,10 +81,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -104,16 +98,9 @@ namespace CalamityMod.NPCs.Perforator public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - float enrageScale = bossRush ? 1f : 0f; - if ((NPC.position.Y / 16f) < Main.worldSurface || bossRush) - enrageScale += 1f; - if (!Main.player[NPC.target].ZoneCrimson || bossRush) - enrageScale += 1f; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Total body segments float totalSegments = GetMediumPerforatorSegmentsCount(); @@ -129,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); } @@ -166,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; @@ -181,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; @@ -441,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) @@ -559,24 +531,20 @@ 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); } } } - public override void BossLoot(ref string name, ref int potionType) - { - name = CalamityUtils.GetTextValue("NPCs.PerforatorMedium"); - potionType = ItemID.HealingPotion; - } + public override LocalizedText DeathMessage => CalamityUtils.GetText("NPCs.PerforatorMedium"); + public override void BossLoot(ref int potionType) => potionType = ItemID.HealingPotion; public override bool SpecialOnKill() { @@ -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 b0120e825c..7e21656207 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -12,6 +12,7 @@ using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.NPCs.Perforator @@ -25,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() @@ -53,12 +51,12 @@ 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; - NPC.LifeMaxNERB(1200, 1440, 50000); + NPC.LifeMaxNERB(960, 1152, 50000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -73,9 +71,7 @@ namespace CalamityMod.NPCs.Perforator NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -85,10 +81,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -104,39 +96,11 @@ 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 bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - // Enrage - if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!Main.player[NPC.target].ZoneCrimson || bossRush)) - enrageScale += 1f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) - enrageScale += 1f; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -146,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); } @@ -183,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; } @@ -454,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) @@ -557,11 +508,8 @@ namespace CalamityMod.NPCs.Perforator } } - public override void BossLoot(ref string name, ref int potionType) - { - name = CalamityUtils.GetTextValue("NPCs.PerforatorSmall"); - potionType = ItemID.HealingPotion; - } + public override LocalizedText DeathMessage => CalamityUtils.GetText("NPCs.PerforatorSmall"); + public override void BossLoot(ref int potionType) => potionType = ItemID.HealingPotion; public override bool SpecialOnKill() { diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 144a0ed936..5cdfd90c16 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(6000, 7200, 270000); + 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; @@ -84,9 +97,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -109,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() @@ -139,13 +149,12 @@ namespace CalamityMod.NPCs.Perforator if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) NPC.TargetClosest(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Variables for ichor blob phase - float blobPhaseGateValue = bossRush ? 450f : 600f; + float blobPhaseGateValue = 600f; bool floatAboveToFireBlobs = NPC.ai[2] >= blobPhaseGateValue - 120f; Player player = Main.player[NPC.target]; @@ -155,36 +164,16 @@ namespace CalamityMod.NPCs.Perforator // Phases based on life percentage bool phase2 = lifeRatio < 0.7f; - bool phase3 = medium && revenge; - // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; + bool spawnSmall = CalamityWorld.LegendaryMode ? lifeRatio < 0.85f : lifeRatio < 0.75f; + bool spawnMedium = CalamityWorld.LegendaryMode ? lifeRatio < 0.60f : lifeRatio < 0.50f; + bool spawnLarge = CalamityWorld.LegendaryMode ? lifeRatio < 0.45f : lifeRatio < 0.25f; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCrimson || bossRush)) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - 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; @@ -200,6 +189,8 @@ namespace CalamityMod.NPCs.Perforator return; } } + + // Natural despawn prevention else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; @@ -208,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); @@ -242,79 +233,141 @@ namespace CalamityMod.NPCs.Perforator else wormsAlive = 0; - // Do not spit from side mouth while the large worm is alive - // Death Mode ignores this - if (largeWormAlive && !death) - phase3 = false; - NPC.Calamity().DR = wormsAlive * 0.3f; - if (NPC.ai[3] == 0f && NPC.life > 0) - NPC.ai[3] = NPC.lifeMax; - - bool canSpawnWorms = !small || !medium || !large || Main.getGoodWorld; - 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 * (Main.getGoodWorld ? 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 (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); - } - 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 (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); + } + 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) @@ -329,7 +382,7 @@ namespace CalamityMod.NPCs.Perforator // Emit ichor blobs if (phase2) { - if (wormsAlive == 0 || large || bossRush || floatAboveToFireBlobs || (CalamityWorld.LegendaryMode && CalamityWorld.revenge)) + if (wormsAlive == 0 || largeSpawned || floatAboveToFireBlobs || CalamityWorld.LegendaryMode) { NPC.ai[2] += 1f; if (NPC.ai[2] >= blobPhaseGateValue) @@ -337,10 +390,30 @@ namespace CalamityMod.NPCs.Perforator if (NPC.ai[2] < blobPhaseGateValue + 300f) { if (NPC.velocity.Length() > 0.5f) - NPC.velocity *= bossRush ? 0.94f : 0.96f; + 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; @@ -358,31 +431,28 @@ 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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++) { Vector2 blobVelocity = new Vector2(Main.rand.Next(-blobSpread, blobSpread + 1), Main.rand.Next(-blobSpread, blobSpread + 1)); blobVelocity.Normalize(); - blobVelocity *= Main.rand.Next(400, 801) * (bossRush ? 0.02f : 0.01f); + blobVelocity *= Main.rand.Next(400, 801) * 0.01f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) blobVelocity *= Main.rand.NextFloat() + 1f; float blobVelocityYAdd = Math.Abs(blobVelocity.Y) * 0.25f; if (blobVelocity.Y < 2f) blobVelocity.Y = 2f + blobVelocityYAdd; - // Fall a bit further or shorter depending on which blob it is - float fallFurtherDistance = 48f * (i - numBlobs / 2); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 50f, blobVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y + fallFurtherDistance); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 50f, blobVelocity, type, IchorBlobDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -391,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) { @@ -401,71 +468,13 @@ 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; } - // Side mouth starts spitting when it opens - if (phase3) - { - NPC.localAI[2] += 1f; - if (NPC.frame.Y / (TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type]) == 5 && NPC.localAI[2] >= 0f) - { - // Ensure it only spits once - // Spits half as much while the medium worm is alive - NPC.localAI[2] = mediumWormAlive ? -70f : -10f; - - Vector2 centerOffset = new Vector2(NPC.direction == 1 ? 52f : -52f, -4f); - Vector2 mouthLocation = NPC.Center + centerOffset; - Vector2 spitVelocity = (mouthLocation + (Vector2.UnitX * 100f * NPC.direction) - mouthLocation).SafeNormalize(Vector2.UnitY) * 6f; - - SoundEngine.PlaySound(SoundID.Item17, mouthLocation); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int maxProjectiles = 3; - Vector2 dustSpawnBox = new Vector2(12f, 12f); - Vector2 dustSpawnOffset = dustSpawnBox * 0.5f; - for (int i = 0; i < maxProjectiles; i++) - { - bool ichor = Main.rand.NextBool(); - int type = ichor ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Vector2 randomizedProjectileSpawnLocation = mouthLocation + Main.rand.NextVector2CircularEdge(4f, 4f); - Vector2 randomizedProjectileVelocity = spitVelocity + Main.rand.NextVector2CircularEdge(1.5f, 1.5f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), randomizedProjectileSpawnLocation, randomizedProjectileVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); - - float dustSpeed = Main.rand.NextFloat(3.0f, 9.0f); - float angleRandom = 0.05f; - Vector2 dustVelocity = new Vector2(dustSpeed, 0.0f).RotatedBy(randomizedProjectileVelocity.ToRotation()); - dustVelocity = dustVelocity.RotatedBy(-angleRandom); - dustVelocity = dustVelocity.RotatedByRandom(2.0f * angleRandom); - - if (ichor) - { - for (int j = 0; j < 4; j++) - { - int ichorDust = Dust.NewDust(randomizedProjectileSpawnLocation - dustSpawnOffset, (int)dustSpawnBox.X, (int)dustSpawnBox.Y, DustID.Ichor); - Main.dust[ichorDust].velocity = dustVelocity; - } - } - else - { - for (int j = 0; j < 4; j++) - { - int bloodDust = Dust.NewDust(randomizedProjectileSpawnLocation - dustSpawnOffset, (int)dustSpawnBox.X, (int)dustSpawnBox.Y, DustID.Blood); - Main.dust[bloodDust].velocity = dustVelocity; - Main.dust[bloodDust].scale = 2f; - } - } - } - } - } - } - if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[0] += 1f; @@ -474,24 +483,23 @@ namespace CalamityMod.NPCs.Perforator NPC.localAI[0] = 0f; SoundEngine.PlaySound(GeyserShoot, NPC.Center); - bool ichor = Main.rand.NextBool(); - int type = ichor ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int numProj = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; - if (phase3) - numProj = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numProj *= 2; int spread = 75; float velocity = 8f; Vector2 destination = wormsAlive > 0 ? player.Center : NPC.Center - Vector2.UnitY * 100f; - Vector2 projectileVelocity = new Vector2(Vector2.Normalize(destination - NPC.Center).X * velocity, -velocity); + Vector2 projectileVelocity = new Vector2(Utils.DirectionTo(NPC.Center, destination).X * velocity, -velocity); float rotation = MathHelper.ToRadians(spread); Vector2 dustSpawnBox = new Vector2(12f, 12f); Vector2 dustSpawnOffset = dustSpawnBox * 0.5f; for (int i = 0; i < numProj; i++) { + bool ichor = Main.rand.NextBool(); + int type = ichor ? ModContent.ProjectileType() : ModContent.ProjectileType(); + 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); Vector2 projectileSpawnLocation = NPC.Center + Vector2.Normalize(perturbedSpeed) * 50f; @@ -535,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; @@ -551,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; @@ -560,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; @@ -569,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; } @@ -579,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); } } @@ -600,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; } @@ -623,10 +628,10 @@ 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 string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.HealingPotion; } @@ -677,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 @@ -702,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++) @@ -732,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; @@ -742,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; @@ -750,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 710b6bf4db..8259cead41 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -34,12 +34,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 16; // 32 NPC.width = 60; NPC.height = 78; NPC.defense = 12; - NPC.LifeMaxNERB(2700, 3240, 80000); + NPC.LifeMaxNERB(2160, 2600, 80000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -55,9 +55,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -143,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) @@ -235,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 1c83b3ec71..88fb7306fd 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -36,13 +36,13 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 50; NPC.defense = 10; - NPC.LifeMaxNERB(180, 216, 7000); + NPC.LifeMaxNERB(144, 172, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -58,9 +58,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -72,16 +70,11 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.realLife = -1; @@ -102,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; @@ -117,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; @@ -168,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) @@ -267,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); } } } @@ -284,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 433f7586b5..5078662f3f 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -34,12 +34,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 40; NPC.height = 34; NPC.defense = 8; - NPC.LifeMaxNERB(1200, 1440, 50000); + NPC.LifeMaxNERB(960, 1152, 50000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -55,9 +55,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -143,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) @@ -235,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 065874a933..8b293fff79 100644 --- a/NPCs/PlagueEnemies/Melter.cs +++ b/NPCs/PlagueEnemies/Melter.cs @@ -31,20 +31,16 @@ 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(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PestilentSlime.cs b/NPCs/PlagueEnemies/PestilentSlime.cs index 72f79c03b4..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; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.PlagueEnemies BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs index c7ae9751ce..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; @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.PlagueEnemies BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs index d3666be1d0..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; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.PlagueEnemies BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 0374f876c4..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; @@ -61,10 +60,6 @@ namespace CalamityMod.NPCs.PlagueEnemies { NPC.scale = 2f; } - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/Plagueshell.cs b/NPCs/PlagueEnemies/Plagueshell.cs index 55d9b3004b..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; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/Viruling.cs b/NPCs/PlagueEnemies/Viruling.cs index d8e5832bbd..df650e78ee 100644 --- a/NPCs/PlagueEnemies/Viruling.cs +++ b/NPCs/PlagueEnemies/Viruling.cs @@ -30,20 +30,16 @@ 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(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 7b264b2ddc..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; @@ -46,18 +45,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.noTileCollide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Lighting.AddLight(NPC.Center, 0.015f, 0.1f, 0f); @@ -112,7 +106,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { NPC.localAI[1] += 1f; float timeBeforeExploding = 480f + NPC.ai[3] * 2f; - float homingDuration = (bossRush ? 430f : death ? 340f : revenge ? 290f : expertMode ? 240f : 150f) + NPC.ai[3] * 2f; + float homingDuration = (death ? 340f : revenge ? 290f : expertMode ? 240f : 150f) + NPC.ai[3] * 2f; if (NPC.localAI[1] == timeBeforeExploding) { CheckDead(); @@ -134,7 +128,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { NPC.noTileCollide = false; - if (NPC.velocity.Length() < (bossRush ? 25f : 20f)) + if (NPC.velocity.Length() < 20f) NPC.velocity *= 1.01f; if (Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) @@ -266,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 6146ad8433..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; @@ -44,17 +44,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; Lighting.AddLight(NPC.Center, 0.03f, 0.2f, 0f); @@ -78,7 +73,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 vector = Main.player[NPC.target].Center - NPC.Center; float distanceRequiredForExplosion = 90f; - float timeBeforeExplosion = (bossRush ? 1000f : death ? 740f : revenge ? 520f : 400f) + NPC.ai[3] * 4f; + float timeBeforeExplosion = (death ? 740f : revenge ? 520f : 400f) + NPC.ai[3] * 4f; if (vector.Length() < distanceRequiredForExplosion || NPC.ai[0] >= timeBeforeExplosion) { CheckDead(); @@ -94,7 +89,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } NPC.TargetClosest(true); - float velocity = (bossRush ? 14f : death ? 12f : revenge ? 10f : 8f) + NPC.ai[3] * 0.04f; + float velocity = (death ? 12f : revenge ? 10f : 8f) + NPC.ai[3] * 0.04f; Vector2 npcDirection = new Vector2(NPC.Center.X + (float)(NPC.direction * 20), NPC.Center.Y + 6f); float targetX = player.position.X + (float)player.width * 0.5f - npcDirection.X; float targetY = player.Center.Y - npcDirection.Y; @@ -102,7 +97,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float npcSpeed = velocity / targetDistance; targetX *= npcSpeed; targetY *= npcSpeed; - float inertia = (bossRush ? 35f : death ? 40f : revenge ? 45f : 50f) - NPC.ai[3] * 0.25f; + float inertia = (death ? 40f : revenge ? 45f : 50f) - NPC.ai[3] * 0.25f; NPC.velocity.X = (NPC.velocity.X * inertia + targetX) / (inertia + 1f); NPC.velocity.Y = (NPC.velocity.Y * inertia + targetY) / (inertia + 1f); } @@ -156,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 79c8333645..43581aab22 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,16 +101,13 @@ 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; NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -158,10 +158,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.height = (int)(NPC.frame.Height * (charging ? 1.5f : 1.8f)); // Mode variables - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -176,7 +175,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float challengeAmt = (1f - lifeRatio) * 100f; float nukeBarrageChallengeAmt = (0.5f - lifeRatio) * 200f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { challengeAmt *= 1.5f; nukeBarrageChallengeAmt *= 1.5f; @@ -190,7 +189,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Light @@ -209,7 +207,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Missile countdown if (halfLife && MissileCountdown == 0) - MissileCountdown = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 300 : 600; + MissileCountdown = CalamityWorld.LegendaryMode ? 300 : 600; if (MissileCountdown > 1) MissileCountdown--; @@ -230,7 +228,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 distFromPlayer = player.Center - NPC.Center; // Enrage - if (!player.ZoneJungle && !bossRush) + if (!player.ZoneJungle && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -238,25 +236,22 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; float enrageScale = death ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1.5f; } if (enrageScale > 1.5f) enrageScale = 1.5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrageScale += 0.5f; - if (bossRush) - enrageScale = 2f; - - bool diagonalDash = (revenge && phase2) || bossRush; + bool diagonalDash = (revenge && phase2); if (NPC.ai[0] != 0f && NPC.ai[0] != 4f) NPC.rotation = NPC.velocity.X * 0.02f; @@ -545,7 +540,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.velocity *= 1.01f; // Spawn honey in legendary rev+ - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge && calamityGlobalNPC.newAI[0] % 6f == 0f) + if (CalamityWorld.LegendaryMode && calamityGlobalNPC.newAI[0] % 6f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -632,7 +627,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath calamityGlobalNPC.newAI[0] += 1f; if ((Vector2.Distance(NPC.Center, player.Center) < 640f && canHitTarget) || calamityGlobalNPC.newAI[0] >= 180f) { - NPC.ai[0] = (phase3 || bossRush) ? 5f : 1f; + NPC.ai[0] = phase3 ? 5f : 1f; NPC.ai[1] = 0f; calamityGlobalNPC.newAI[0] = 0f; @@ -803,7 +798,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.direction = playerLocation < 0 ? 1 : -1; NPC.spriteDirection = NPC.direction; - if (NPC.ai[2] > ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 3f : 5f)) + if (NPC.ai[2] > (CalamityWorld.LegendaryMode ? 3f : 5f)) { NPC.ai[0] = -1f; NPC.ai[1] = 2f; @@ -868,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; } @@ -914,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; @@ -979,15 +974,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath baseVelocity *= 0.4f; } - int missiles = bossRush ? 16 : MissileProjectiles; - int spread = bossRush ? 18 : 24; + int spread = 24; if (!gaussMode) { - for (int i = 0; i < missiles; i++) + for (int i = 0; i < MissileProjectiles; i++) { - Vector2 spawn = NPC.Center; // Normal = 96, Boss Rush = 144 - spawn.X += i * (int)(spread * 1.125) - (missiles * (spread / 2)); // Normal = -96 to 93, Boss Rush = -144 to 156 - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / missiles))); + Vector2 spawn = NPC.Center; + spawn.X += i * (int)(spread * 1.125) - (MissileProjectiles * (spread / 2)); + Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / MissileProjectiles))); Projectile.NewProjectile(NPC.GetSource_FromAI(), spawn, velocity, type, damage, 0f, Main.myPlayer, nukeBarrageChallengeAmt, player.position.Y); } } @@ -1315,7 +1309,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -1345,7 +1339,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1383,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 5e0b097a77..25af8a694d 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 && CalamityWorld.revenge)) + if (!chargePhase || CalamityWorld.LegendaryMode) { NPC.ai[2] += 1f; float shootMineGateValue = 150f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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] += (Main.getGoodWorld ? 1.5f : 0.5f) + SPEEN; + NPC.ai[1] += (CalamityWorld.LegendaryMode ? 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 d5de2b05cd..de5e306d6a 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.knockBackResist = 0f; @@ -57,9 +57,6 @@ namespace CalamityMod.NPCs.Polterghast NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadRotation(ref float rotation) @@ -97,10 +94,9 @@ namespace CalamityMod.NPCs.Polterghast { CalamityGlobalNPC.ghostBossClone = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active) { @@ -121,7 +117,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector = NPC.Center; float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float colorChangeTime = 180f; @@ -142,7 +138,7 @@ namespace CalamityMod.NPCs.Polterghast float velocity = 3f; float acceleration = 0.03f; - if (!player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0) + if (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0) { despawnTimer--; if (despawnTimer <= 0) @@ -176,26 +172,21 @@ namespace CalamityMod.NPCs.Polterghast } // Predictiveness - Vector2 predictionVector = chargePhase && bossRush ? player.velocity * 20f : Vector2.Zero; - Vector2 lookAt = player.Center + predictionVector; + Vector2 lookAt = player.Center; Vector2 rotationVector = lookAt - vector; // Rotation if (NPC.Calamity().newAI[3] == 0f) { - float playerXDestination = player.Center.X + predictionVector.X - vector.X; - float playerYDestination = player.Center.Y + predictionVector.Y - vector.Y; + float playerXDestination = player.Center.X - vector.X; + float playerYDestination = player.Center.Y - vector.Y; NPC.rotation = (float)Math.Atan2(playerYDestination, playerXDestination) + MathHelper.PiOver2; } 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; @@ -232,7 +223,7 @@ namespace CalamityMod.NPCs.Polterghast float movementLimitedDistance = (float)Math.Sqrt(movementLimitedXDist * movementLimitedXDist + movementLimitedYDist * movementLimitedYDist); float maxDistanceFromHooks = expertMode ? 650f : 500f; - if (speedBoost || bossRush) + if (speedBoost) maxDistanceFromHooks += 250f; if (death) maxDistanceFromHooks += maxDistanceFromHooks * 0.1f * (1f - lifeRatio); @@ -311,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; } @@ -352,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) { @@ -440,7 +422,7 @@ namespace CalamityMod.NPCs.Polterghast spriteEffects = SpriteEffects.FlipHorizontally; float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; @@ -544,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 34c64b4665..cd6f59240f 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -65,27 +65,27 @@ namespace CalamityMod.NPCs.Polterghast public static List creepySounds = new List { - NPCs.DevourerofGods.DevourerofGodsHead.AttackSound, - NPCs.Providence.Providence.HolyRaySound, - NPCs.ExoMechs.Ares.AresBody.EnragedSound, - NPCs.ExoMechs.Ares.AresBody.LaserStartSound, - NPCs.ExoMechs.Thanatos.ThanatosHead.VentSound, - NPCs.SupremeCalamitas.SupremeCalamitas.SepulcherSummonSound, - NPCs.SupremeCalamitas.SupremeCalamitas.SpawnSound, - NPCs.Ravager.RavagerBody.LimbLossSound, - NPCs.HiveMind.HiveMind.RoarSound, - NPCs.Yharon.Yharon.RoarSound, - NPCs.DesertScourge.DesertScourgeHead.RoarSound, - NPCs.OldDuke.OldDuke.RoarSound, - NPCs.Abyss.ReaperShark.SearchRoarSound, - NPCs.Abyss.ReaperShark.EnragedRoarSound, - NPCs.Abyss.LuminousCorvina.ScreamSound, - NPCs.Abyss.DevilFish.MaskBreakSound, - NPCs.PrimordialWyrm.PrimordialWyrmHead.ChargeSound, - NPCs.GreatSandShark.GreatSandShark.RoarSound, - NPCs.AcidRain.Mauler.RoarSound, - NPCs.AstrumDeus.AstrumDeusHead.DeathSound, - NPCs.AstrumAureus.AstrumAureus.HitSound, + DevourerofGods.DevourerofGodsHead.AttackSound, + Providence.Providence.HolyRaySound, + ExoMechs.Ares.AresBody.EnragedSound, + ExoMechs.Ares.AresBody.LaserStartSound, + ExoMechs.Thanatos.ThanatosHead.VentSound, + SupremeCalamitas.SupremeCalamitas.SepulcherSummonSound, + SupremeCalamitas.SupremeCalamitas.SpawnSound, + Ravager.RavagerBody.LimbLossSound, + HiveMind.HiveMind.RoarSound, + Yharon.Yharon.RoarSound, + DesertScourge.DesertScourgeHead.RoarSound, + OldDuke.OldDuke.RoarSound, + ReaperShark.SearchRoarSound, + ReaperShark.EnragedRoarSound, + LuminousCorvina.ScreamSound, + DevilFish.MaskBreakSound, + PrimordialWyrm.PrimordialWyrmHead.ChargeSound, + GreatSandShark.GreatSandShark.RoarSound, + AcidRain.Mauler.RoarSound, + AstrumDeus.AstrumDeusHead.DeathSound, + AstrumAureus.AstrumAureus.HitSound, SoundID.ScaryScream, SoundID.DD2_KoboldFlyerHurt }; @@ -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; @@ -124,9 +131,6 @@ namespace CalamityMod.NPCs.Polterghast NPC.HitSound = HitSound; NPC.DeathSound = SoundID.NPCDeath39; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -203,12 +207,11 @@ namespace CalamityMod.NPCs.Polterghast // Variables Vector2 vector = NPC.Center; - bool bossRush = BossRushEvent.BossRushActive; bool speedBoost = false; bool despawnBoost = false; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Phases bool phase2 = lifeRatio < (death ? 0.9f : revenge ? 0.8f : expertMode ? 0.65f : 0.5f); @@ -222,7 +225,7 @@ namespace CalamityMod.NPCs.Polterghast // Velocity and acceleration calamityGlobalNPC.newAI[0] += 1f; float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; bool chargePhase = calamityGlobalNPC.newAI[0] >= chargePhaseGateValue; @@ -331,7 +334,7 @@ namespace CalamityMod.NPCs.Polterghast } } - bool despawn = !player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0; + bool despawn = !player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0; if (despawn) { despawnTimer--; @@ -416,26 +419,19 @@ namespace CalamityMod.NPCs.Polterghast float baseProjectileVelocity = speedBoost ? 9.375f : 7.5f; // Predictiveness - Vector2 predictionVector = chargePhase && bossRush ? player.velocity * 20f : Vector2.Zero; - Vector2 lookAt = player.Center + predictionVector; + Vector2 lookAt = player.Center; Vector2 rotationVector = lookAt - vector; // Rotation if (calamityGlobalNPC.newAI[3] == 0f) { - float playerXDestination = player.Center.X + predictionVector.X - vector.X; - float playerYDestination = player.Center.Y + predictionVector.Y - vector.Y; + float playerXDestination = player.Center.X - vector.X; + float playerYDestination = player.Center.Y - vector.Y; NPC.rotation = (float)Math.Atan2(playerYDestination, playerXDestination) + MathHelper.PiOver2; } 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; @@ -472,7 +468,7 @@ namespace CalamityMod.NPCs.Polterghast float movementLimitedDistance = (float)Math.Sqrt(movementLimitedXDist * movementLimitedXDist + movementLimitedYDist * movementLimitedYDist); float maxDistanceFromHooks = expertMode ? 650f : 500f; - if (speedBoost || bossRush) + if (speedBoost) maxDistanceFromHooks += 250f; if (death) maxDistanceFromHooks += maxDistanceFromHooks * 0.1f * (1f - lifeRatio); @@ -542,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 @@ -558,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; } @@ -587,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) @@ -668,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) @@ -693,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++) @@ -712,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; } } @@ -773,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) @@ -798,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++) @@ -817,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; } } @@ -894,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; @@ -907,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++) @@ -949,7 +932,7 @@ namespace CalamityMod.NPCs.Polterghast } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1120,7 +1103,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; @@ -1226,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 a31142c7f1..44a72cfd55 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 && revenge) ? 12f : 120f)) + if (NPC.ai[2] > ((CalamityWorld.LegendaryMode) ? 12f : 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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 81ecc448d3..d898aa06cd 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; @@ -212,7 +219,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm // Target variable Player player = Main.player[NPC.target]; - bool targetDownDeep = player.Calamity().ZoneAbyssLayer4 || BossRushEvent.BossRushActive; + bool targetDownDeep = player.Calamity().ZoneAbyssLayer4; bool targetOnMount = player.mount.Active; // Check whether enraged for the sake of the HP bar UI @@ -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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { lightningRainDuration *= 0.5f; eidolonWyrmPhaseDuration *= 0.25f; @@ -344,7 +351,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Adjust opacity @@ -448,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.15f; float turnSpeed = baseVelocity * 0.015f; @@ -647,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; } } @@ -941,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); } } @@ -1148,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) @@ -1476,7 +1479,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1525,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 4afdca7d56..7080a84d05 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,16 +87,13 @@ 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; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -153,10 +155,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Rotation NPC.rotation = NPC.velocity.X * 0.005f; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -359,7 +360,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float goLowOrHighDistance = 540f; // Side swap variables for Phase 2 - float defenderCommanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float defenderCommanderGuardPhase2Duration = death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float moveToOtherSideInPhase2GateValue = defenderCommanderGuardPhase2Duration - 120f; float timeBeforeMoveToOtherSideInPhase2Reset = moveToOtherSideInPhase2GateValue * 2f; float totalGoLowDurationPhase2 = 210f; @@ -367,18 +368,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; - if (Main.getGoodWorld) + float maxChargeVelocity = death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 2f; - float inertia = bossRush ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; + float inertia = death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (!phase1) inertia *= 0.75f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; bool speedUp = Vector2.Distance(NPC.Center, player.Center) > 960f; @@ -456,8 +457,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (!goLow && !goLowPhase2 && !goHigh) calamityGlobalNPC.newAI[0] = -NPC.direction; - float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (Main.getGoodWorld) + float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; if (healerAlive) velocity *= 0.8f; @@ -493,7 +494,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 targetVector = destination - NPC.Center; Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; - float phaseGateValue = bossRush ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; + float phaseGateValue = death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; bool continueShootingProjectiles = phase1 || (NPC.ai[2] < (phaseGateValue * 5f)); if (continueShootingProjectiles) @@ -507,7 +508,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Alternate between firing profaned spears and holy fire // Shoot holy blasts in final phase NPC.ai[2] += 1f; - float projectileShootGateValue = bossRush ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; + float projectileShootGateValue = death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; if (NPC.ai[2] % projectileShootGateValue == 0f) { if (phase1) @@ -521,10 +522,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool shootSpear = NPC.ai[2] % (projectileShootGateValue * 2f) == 0f; - float projectileVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + 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; @@ -534,8 +535,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (fireExtraProjectiles && shootSpear) { - int baseProjectileAmt = bossRush ? 4 : 2; - int spread = bossRush ? 18 : 10; + int baseProjectileAmt = 2; + int spread = 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -554,18 +555,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians else { // Shoot holy blasts - float holyBlastVelocity = bossRush ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; + float holyBlastVelocity = death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; int projTimeLeft = (int)(2000f / holyBlastVelocity); 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 @@ -667,7 +663,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = bossRush ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; + float phaseGateValue = death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -688,7 +684,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = bossRush ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; + float velocityMult = death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -732,10 +728,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); } } } @@ -791,8 +785,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool targetRanAwayAndWillNowBeFucked = NPC.ai[2] == 1f; bool boostVelocityToCatchUp = NPC.ai[1] == 0f || targetRanAwayAndWillNowBeFucked; - float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (Main.getGoodWorld) + float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; if (boostVelocityToCatchUp) velocity *= 2f; @@ -803,7 +797,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; float totalSpears = 12f; - float shootDuration = bossRush ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; + float shootDuration = death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; float dontShootTime = shootDuration * 0.3f; float phaseGateValue = dontShootTime + shootDuration; @@ -848,16 +842,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians } else if (NPC.ai[1] % spearShootDivisor == 0f) { - float spearVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (Main.getGoodWorld) + float spearVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + if (CalamityWorld.LegendaryMode) 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++) @@ -866,8 +858,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] % (spearShootDivisor * 3) == 0f || targetRanAwayAndWillNowBeFucked) { knockbackVelocity *= 2f; - int baseProjectileAmt = bossRush ? 8 : expertMode ? 6 : 4; - int spread = bossRush ? 60 : expertMode ? 50 : 40; + int baseProjectileAmt = expertMode ? 6 : 4; + int spread = expertMode ? 50 : 40; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -877,12 +869,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; @@ -903,10 +895,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians } float laserGateValue = 120f; - float velocity = bossRush ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; + float velocity = death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; if (NPC.ai[1] < laserGateValue) velocity *= 6f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; calamityGlobalNPC.newAI[0] = -NPC.direction; @@ -924,7 +916,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Limit Y velocity while firing laser if (NPC.ai[1] >= laserGateValue) { - float speedCap = Main.getGoodWorld ? 4f : 2f; + float speedCap = CalamityWorld.LegendaryMode ? 4f : 2f; if (NPC.velocity.Y > speedCap) NPC.velocity.Y = speedCap; if (NPC.velocity.Y < -speedCap) @@ -959,7 +951,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { if (NPC.ai[2] == laserGateValue) { - float rotation = bossRush ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; + float rotation = death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f) SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.Center); @@ -973,23 +965,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 && revenge) + if (CalamityWorld.LegendaryMode) { 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; @@ -1206,7 +1195,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians return false; } - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.SuperHealingPotion; + public override void BossLoot(ref int potionType) => potionType = ItemID.SuperHealingPotion; public override void ModifyNPCLoot(NPCLoot npcLoot) { @@ -1273,13 +1262,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 8c0774d5d3..f8fe31cd81 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; @@ -76,10 +81,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -242,17 +243,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Get the Guardian Commander's target Player player = Main.player[Main.npc[CalamityGlobalNPC.doughnutBoss].target]; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase1 = healerAlive; NPC.chaseable = !phase1; // Phase durations - float commanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float commanderGuardPhase2Duration = death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float timeBeforeRocksRespawnInPhase2 = 90f; float throwRocksGateValue = 60f; @@ -261,8 +261,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; - if (Main.getGoodWorld) + float maxChargeVelocity = death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; // Whether the commander is calling all guardians together for the laser attack @@ -381,8 +381,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - float moveVelocity = bossRush ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; - if (Main.getGoodWorld) + float moveVelocity = death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; + if (CalamityWorld.LegendaryMode) moveVelocity *= 1.25f; if (healerAlive) moveVelocity *= 0.8f; @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Lay a holy bomb every once in a while in phase 1 and while not doing the laser attack if (!commanderUsingLaser) { - float projectileShootGateValue = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float projectileShootGateValue = death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; NPC.ai[1] += 1f; if (NPC.ai[1] >= projectileShootGateValue) { @@ -444,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); } } } @@ -457,7 +455,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = (commanderUsingLaser || commanderGoingLowOrHighInPhase1) ? 10f : 15f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -489,7 +487,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] >= -throwRocksGateValue) { NPC.velocity *= 0.8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.velocity *= 0.5f; } @@ -501,18 +499,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians float shootMoltenBlastsGateValue = commanderGuardPhase2Duration / moltenBlastsDivisor; if (NPC.ai[1] % shootMoltenBlastsGateValue == 0f && !commanderGoingLowOrHighInPhase2) { - float moltenBlastVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float moltenBlastVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; int projTimeLeft = (int)(2400f / moltenBlastVelocity); 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 @@ -555,7 +548,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = commanderGoingLowOrHighInPhase2 ? 8f : 15f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -608,7 +601,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = bossRush ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; + float phaseGateValue = death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -629,7 +622,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = bossRush ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; + float velocityMult = death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -641,7 +634,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else if (NPC.localAI[2] == 1f) { // Charge towards target - float inertia = bossRush ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; + float inertia = death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetVector * (NPC.velocity.Length() + (0.111111117f * inertia))) / inertia; // Stop charging towards the player when within a certain distance @@ -672,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); } } } @@ -947,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 5a23446c69..fda7a1b29a 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; @@ -89,10 +94,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -108,7 +109,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians }); } - public float GetStarShootSlowDownGateValue() => BossRushEvent.BossRushActive ? 180f : CalamityWorld.death ? 210f : CalamityWorld.revenge ? 225f : Main.expertMode ? 240f : 270f; + public float GetStarShootSlowDownGateValue() => CalamityWorld.death ? 210f : CalamityWorld.revenge ? 225f : Main.expertMode ? 240f : 270f; public float GetStarShootGateValue() => GetStarShootSlowDownGateValue() + 60f; @@ -164,10 +165,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Get the Guardian Commander's target Player player = Main.player[Main.npc[CalamityGlobalNPC.doughnutBoss].target]; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -193,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; @@ -201,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; } @@ -216,8 +215,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool useCrystalShards = AIState == (float)Phase.CrystalShards; - float velocity = useCrystalShards ? (bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); - if (Main.getGoodWorld) + float velocity = useCrystalShards ? (death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; float idealDistanceFromDestination = useCrystalShards ? 80f : 160f; @@ -251,7 +250,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = 10f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -267,7 +266,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { // Increment timer AITimer += 1f; - float crystalShootGateValue = bossRush ? 140f : death ? 180f : revenge ? 200f : expertMode ? 220f : 260f; + float crystalShootGateValue = death ? 180f : revenge ? 200f : expertMode ? 220f : 260f; float crystalShootPhaseDuration = crystalShootGateValue + crystalShootGateValue * 0.25f; // Generate dust that scales with how close the crystals are to firing @@ -303,8 +302,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = bossRush ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; + int totalProjectiles = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; float speedX = -12f; float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); float speedY = -4f; @@ -320,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); } } } @@ -343,7 +341,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, shootFrom); - int totalFlameProjectiles = bossRush ? 20 : 16; + int totalFlameProjectiles = 16; int totalRings = revenge ? 3 : 2; int healingStarChance = revenge ? 8 : expertMode ? 6 : 4; double radians = MathHelper.TwoPi / totalFlameProjectiles; @@ -360,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; @@ -404,10 +400,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Move towards a location above the player if (distanceFromDestination.Length() > idealDistanceFromDestination) { - float inertia = bossRush ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; + float inertia = death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; if (lifeRatio < 0.5f) inertia *= 0.8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 64ea8d4e8b..234672c46b 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; @@ -142,10 +142,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.timeLeft = 1800; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Spin and fly at the target if ((Main.npc[CalamityGlobalNPC.doughnutBossDefender].ai[0] != 0f && Main.npc[CalamityGlobalNPC.doughnutBossDefender].ai[1] >= -60f) || NPC.Calamity().newAI[0] < 0f) @@ -159,7 +158,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Distance the rock travels before it starts to fall down float maxChargeDistance = 4800f; - float chargeSpeed = bossRush ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; + float chargeSpeed = death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; float fallDownGateValue = maxChargeDistance / chargeSpeed; // Fall down after some time and blow up if inside tiles @@ -209,7 +208,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Start off slow Vector2 finalVelocity = NPC.SafeDirectionTo(player.Center, -Vector2.UnitY) * chargeSpeed; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) finalVelocity *= Main.rand.NextFloat(1f, 1.7f); NPC.Calamity().newAI[2] = finalVelocity.X; @@ -229,7 +228,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Push away from each other in Death and Boss Rush if (death) { - float pushVelocity = bossRush ? 0.2f : 0.15f; + float pushVelocity = 0.15f; foreach (NPC n in Main.ActiveNPCs) { if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) @@ -257,7 +256,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Rotate faster and charge NPC.Calamity().newAI[1] += 1f; - float chargeGateValue = bossRush ? 60f : death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; + float chargeGateValue = death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; chargeGateValue += chargeGateValue * 0.5f * NPC.ai[1]; float anglularSpeed = NPC.Calamity().newAI[1] / chargeGateValue; anglularSpeed = 0.05f + anglularSpeed * 0.2f; @@ -279,7 +278,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.damage = 0; // Distance from Defender Guardian - double maxDistance = bossRush ? 360D : death ? 340D : revenge ? 330D : expertMode ? 320D : MinMaxDistance; + double maxDistance = death ? 340D : revenge ? 330D : expertMode ? 320D : MinMaxDistance; double rateOfChangeIncrease = (maxDistance / MinMaxDistance) - 1D; double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + rateOfChangeIncrease; if (NPC.Calamity().newAI[0] == 0f) diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index ee8f6aa180..eb17e4fab3 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index a89548e32b..349951bee9 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index e9295deaa6..79901f95c9 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7a97449c25..3ba404d415 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,11 +273,8 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.25f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -358,12 +367,10 @@ namespace CalamityMod.NPCs.Providence Player player = Main.player[NPC.target]; // Enraged bool and Color shifting - bool bossRush = BossRushEvent.BossRushActive; - bool getFuckedAI = Main.zenithWorld; if (getFuckedAI) NPC.localAI[1] = (float)BossMode.Rainbow; - else if (hasBeenGivenFullPower || bossRush) // Enraged behavior + else if (hasBeenGivenFullPower) // Enraged behavior NPC.localAI[1] = (float)BossMode.Enraged; else NPC.localAI[1] = (float)BossMode.Normal; @@ -414,24 +421,7 @@ 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 = !bossRush && 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; + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && fullPowerAI; // Change dust type while enraged int dustType = ProvUtils.GetDustID(); @@ -450,13 +440,9 @@ namespace CalamityMod.NPCs.Providence // Spear phase float spearRateIncrease = 1f - lifeRatio; - float bossRushSpearRateIncrease = 0.25f; float baseSpearRate = 18f; float spearRate = 1f + spearRateIncrease; - if (bossRush) - spearRate += bossRushSpearRateIncrease; - // Projectile fire rate multiplier double attackRateMult = 1D; @@ -654,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; @@ -860,7 +832,7 @@ namespace CalamityMod.NPCs.Providence // Velocity and acceleration float speedIncreaseTimer = fullPowerAI ? 75f : death ? 120f : 150f; - bool increaseSpeed = calamityGlobalNPC.newAI[0] > speedIncreaseTimer || bossRush; + bool increaseSpeed = calamityGlobalNPC.newAI[0] > speedIncreaseTimer; float accelerationBoost = death ? 0.3f * (1f - lifeRatio) : 0.2f * (1f - lifeRatio); float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); float acceleration = (expertMode ? 1.1f : 1.05f) + accelerationBoost; @@ -878,13 +850,11 @@ namespace CalamityMod.NPCs.Providence else if (increaseSpeed) { velocity += (calamityGlobalNPC.newAI[0] - speedIncreaseTimer) * 0.04f; - if (velocity > 30f || bossRush) + if (velocity > 30f) velocity = 30f; - if (bossRush) - acceleration = 2f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.2f; acceleration *= 1.2f; @@ -900,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 -= Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y -= CalamityWorld.LegendaryMode ? 0.4f : 0.2f; if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200 - NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y += CalamityWorld.LegendaryMode ? 0.4f : 0.2f; float speedCap = laserPhaseSlow ? 2f : 6f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) speedCap *= 1.5f; if (NPC.velocity.Y > speedCap) @@ -928,8 +898,8 @@ namespace CalamityMod.NPCs.Providence int phase = 0; // Holy ray in hallow, Crystal in hell - bool useLaser = (phase2 && biomeType == 1) || bossRush; - bool useCrystal = (phase2 && biomeType == 2) || bossRush; + bool useLaser = (phase2 && biomeType == 1) || BossRushEvent.BossRushActive; + bool useCrystal = (phase2 && biomeType == 2) || BossRushEvent.BossRushActive; // Unique pattern for Death Mode and Boss Rush if (death) @@ -1161,7 +1131,7 @@ namespace CalamityMod.NPCs.Providence NPC.ai[3] += 1f; int shootBoost = death ? (int)Math.Round(5f * (1f - lifeRatio)) : (int)Math.Round(4f * (1f - lifeRatio)); - int projectileShootGateValue = (bossRush ? 18 : expertMode ? 24 : 26) - shootBoost; + int projectileShootGateValue = (expertMode ? 24 : 26) - shootBoost; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1176,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) @@ -1206,8 +1176,6 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? (int)Math.Round(6f * (1f - lifeRatio)) : (int)Math.Round(5f * (1f - lifeRatio)); int projectileShootGateValue = (expertMode ? 36 : 39) - shootBoost; - if (bossRush) - projectileShootGateValue = 27; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1226,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); } } @@ -1255,7 +1223,7 @@ namespace CalamityMod.NPCs.Providence } float divisor = (expertMode ? 2f : 3f) + (float)Math.Floor(3f * lifeRatio) + (attackRateMult > 1D ? (float)Math.Ceiling(attackRateMult * 1.6) : 0f); - int totalFlameProjectiles = bossRush ? 45 : 36; + int totalFlameProjectiles = 36; int chains = 4; float interval = totalFlameProjectiles / chains * divisor; double patternInterval = Math.Floor(NPC.ai[3] / interval); @@ -1276,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 @@ -1299,7 +1263,7 @@ namespace CalamityMod.NPCs.Providence { NPC.ai[2] = 0f; - totalFlameProjectiles = bossRush ? 20 : 16; + totalFlameProjectiles = 16; if (NPC.ai[3] % (divisor * totalFlameProjectiles) == 0f) { calamityGlobalNPC.newAI[1] += 1f; @@ -1313,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); } } } @@ -1343,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; @@ -1388,7 +1347,7 @@ namespace CalamityMod.NPCs.Providence if (!Main.dedServ) { Player player2 = Main.LocalPlayer; - bool inLiquid = (player2.wet || player2.honeyWet) && !player2.lavaWet; + bool inLiquid = player2.Calamity().countsAsAnyWet && !player2.lavaWet; if (!player2.dead && player2.active && Vector2.Distance(player2.Center, NPC.Center) < 2800f && !inLiquid) { @@ -1445,8 +1404,6 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? (int)Math.Round(5f * (1f - lifeRatio)) : (int)Math.Round(4f * (1f - lifeRatio)); int projectileShootGateValue = (expertMode ? 24 : 26) - shootBoost; - if (bossRush) - projectileShootGateValue = 18; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1461,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) @@ -1490,7 +1447,7 @@ namespace CalamityMod.NPCs.Providence NPC.ai[3] += 1f; int shootBoost = death ? (int)Math.Round(12f * (1f - lifeRatio)) : (int)Math.Round(10f * (1f - lifeRatio)); - int projectileShootGateValue = (bossRush ? 54 : expertMode ? 73 : 77) - shootBoost; + int projectileShootGateValue = (expertMode ? 73 : 77) - shootBoost; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1506,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); } } @@ -1549,7 +1506,7 @@ namespace CalamityMod.NPCs.Providence if (calamityGlobalNPC.newAI[2] % 2f == 0f) { - int totalSpearProjectiles = bossRush ? 15 : 12; + int totalSpearProjectiles = 12; double radians = MathHelper.TwoPi / totalSpearProjectiles; Vector2 spinningPoint = Vector2.Normalize(new Vector2(-calamityGlobalNPC.newAI[1], -cocoonProjVelocity)); @@ -1565,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 && revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, holySpearDamage, 0f, Main.myPlayer); + if (CalamityWorld.LegendaryMode) + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1592,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 && revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); + if (CalamityWorld.LegendaryMode) + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } @@ -1684,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); } } @@ -1746,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); @@ -1955,8 +1912,6 @@ namespace CalamityMod.NPCs.Providence } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool CheckDead() { NPC.life = 1; @@ -2099,7 +2054,7 @@ namespace CalamityMod.NPCs.Providence npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedProvidence, ModContent.ItemType(), desc: DropHelper.FirstKillText); } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -2543,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) @@ -2765,7 +2719,29 @@ namespace CalamityMod.NPCs.Providence // These will be used for almost every single one of her projectiles, so it's useful to have. public static class ProvUtils { - public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld && !BossRushEvent.BossRushActive; + 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); diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 78144eff7a..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; @@ -44,10 +47,6 @@ namespace CalamityMod.NPCs.Ravager NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) @@ -122,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; @@ -138,6 +136,7 @@ namespace CalamityMod.NPCs.Ravager } } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 1003555aee..589c2fea98 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; @@ -100,9 +106,6 @@ namespace CalamityMod.NPCs.Ravager NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -149,10 +152,9 @@ namespace CalamityMod.NPCs.Ravager { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -227,22 +229,14 @@ namespace CalamityMod.NPCs.Ravager if (immunePhase) { NPC.dontTakeDamage = true; - if (bossRush) - { - if (!Main.dedServ) - { - if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && revenge) - Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); - } - } } else { NPC.dontTakeDamage = false; - if (!Main.dedServ) + foreach (Player p in Main.ActivePlayers) { - if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && revenge) - Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); + if (!p.dead && revenge) + p.AddBuff(ModContent.BuffType(), 2); } } @@ -253,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)); @@ -497,7 +491,7 @@ namespace CalamityMod.NPCs.Ravager NPC.ai[1] += 1f; } - float jumpGateValue = Main.getGoodWorld ? 0f : 180f; + float jumpGateValue = CalamityWorld.LegendaryMode ? 0f : 180f; if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -526,11 +520,11 @@ namespace CalamityMod.NPCs.Ravager if (revenge) { - float multiplier = bossRush ? 0.003f : 0.0015f; + float multiplier = 0.0015f; if (distanceBelowTarget > 0f) calamityGlobalNPC.newAI[1] += 1f + distanceBelowTarget * multiplier; - float speedMultLimit = bossRush ? 3f : 2f; + float speedMultLimit = 2f; if (calamityGlobalNPC.newAI[1] > speedMultLimit) calamityGlobalNPC.newAI[1] = speedMultLimit; @@ -594,7 +588,7 @@ namespace CalamityMod.NPCs.Ravager bool anyRockPillars = NPC.AnyNPCs(ModContent.NPCType()); bool anyFlamePillars = NPC.AnyNPCs(ModContent.NPCType()); - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if (!expertMode || anyRockPillars || anyFlamePillars) SoundEngine.PlaySound(PillarSound, NPC.Center); @@ -613,7 +607,7 @@ namespace CalamityMod.NPCs.Ravager 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f * NPC.scale + Vector2.Normalize(perturbedSpeed) * 30f * NPC.scale, perturbedSpeed, type, RockDamage, 0f, Main.myPlayer); } } } @@ -636,12 +630,12 @@ namespace CalamityMod.NPCs.Ravager { SoundEngine.PlaySound(PillarSound, NPC.Center); } - if (!anyRockPillars || Main.getGoodWorld) + if (!anyRockPillars || CalamityWorld.LegendaryMode) { 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 || Main.getGoodWorld) + else if (!anyFlamePillars || CalamityWorld.LegendaryMode) { 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()); @@ -721,7 +715,7 @@ namespace CalamityMod.NPCs.Ravager { if (phase2) { - float stopBeforeFallTime = bossRush ? 25f : 30f; + float stopBeforeFallTime = 30f; if (!anyHeadActive) stopBeforeFallTime -= 15f; else if (expertMode) @@ -738,7 +732,7 @@ namespace CalamityMod.NPCs.Ravager NPC.damage = NPC.defDamage; float fallSpeedBoost = !anyHeadActive ? 1.8f : death ? 1.8f * (1f - lifeRatio) : 1.2f * (1f - lifeRatio); - float fallSpeed = (bossRush ? 1.8f : 1.2f) + fallSpeedBoost; + float fallSpeed = 1.2f + fallSpeedBoost; if (calamityGlobalNPC.newAI[1] > 1f) fallSpeed *= calamityGlobalNPC.newAI[1]; @@ -755,7 +749,7 @@ namespace CalamityMod.NPCs.Ravager if (NPC.Bottom.Y < player.position.Y) { float fallSpeedBoost = !anyHeadActive ? 0.9f : death ? 0.9f * (1f - lifeRatio) : 0.6f * (1f - lifeRatio); - float fallSpeed = (bossRush ? 0.9f : 0.6f) + fallSpeedBoost; + float fallSpeed = 0.6f + fallSpeedBoost; if (calamityGlobalNPC.newAI[1] > 1f) fallSpeed *= calamityGlobalNPC.newAI[1]; @@ -766,7 +760,7 @@ namespace CalamityMod.NPCs.Ravager } else { - float velocityMult = bossRush ? 2f : 1.8f; + float velocityMult = 1.8f; float velocityXChange = 0.2f + Math.Abs(NPC.Center.X - player.Center.X) * 0.001f; float velocityXBoost = !anyHeadActive ? 6f : death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); @@ -815,11 +809,6 @@ namespace CalamityMod.NPCs.Ravager { float gravity = phase2 ? 0f : 0.45f; float maxFallSpeed = reduceFallSpeed ? 12f : phase2 ? 24f : 15f; - if (bossRush && !reduceFallSpeed) - { - gravity *= 1.25f; - maxFallSpeed *= 1.25f; - } if (calamityGlobalNPC.newAI[1] > 1f && !reduceFallSpeed) maxFallSpeed *= calamityGlobalNPC.newAI[1]; @@ -836,7 +825,7 @@ namespace CalamityMod.NPCs.Ravager player = Main.player[NPC.target]; } - int distanceFromTarget = player.dead ? 1600 : bossRush ? 8400 : 5600; + int distanceFromTarget = player.dead ? 1600 : 5600; if (Vector2.Distance(NPC.Center, player.Center) > distanceFromTarget) { NPC.TargetClosest(); @@ -849,6 +838,7 @@ namespace CalamityMod.NPCs.Ravager } } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { @@ -908,7 +898,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) @@ -1009,7 +998,7 @@ namespace CalamityMod.NPCs.Ravager target.AddBuff(ModContent.BuffType(), 480); } - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; + public override void BossLoot(ref int potionType) => potionType = ItemID.GreaterHealingPotion; public override void OnKill() { diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 84cda3e20c..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; @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index b8855ebe09..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; @@ -52,15 +52,10 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - //Main.NewText(NPC.ai[0]); if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active) { if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 30bb9c4e1e..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; @@ -49,10 +52,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -95,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 b2aaf4dd89..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; @@ -47,10 +50,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -65,9 +64,8 @@ namespace CalamityMod.NPCs.Ravager Player player = Main.player[Main.npc[CalamityGlobalNPC.scavenger].target]; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool provy = DownedBossSystem.downedProvidence && !bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; @@ -107,11 +105,10 @@ namespace CalamityMod.NPCs.Ravager NPC.rotation = headRotation; NPC.ai[1] += 1f; - bool fireProjectiles = NPC.ai[1] >= (bossRush ? 240f : 480f); + bool fireProjectiles = NPC.ai[1] >= 480f; 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) @@ -123,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 @@ -134,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 6c55b7750e..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; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 41f8232445..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; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 08344e4ead..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; @@ -36,10 +36,6 @@ namespace CalamityMod.NPCs.Ravager NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -100,7 +96,7 @@ namespace CalamityMod.NPCs.Ravager } NPC.noTileCollide = true; - NPC.velocity.X = (BossRushEvent.BossRushActive ? 15 : 12) * NPC.direction; + NPC.velocity.X = 12 * NPC.direction; NPC.velocity.Y = -28.5f; NPC.ai[0] = 1f; NPC.ai[1] = 0f; @@ -128,7 +124,7 @@ namespace CalamityMod.NPCs.Ravager } } } - + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override bool CheckActive() => false; public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index fbb89d335d..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; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.Signus NPC.HitSound = SoundID.NPCHit53; NPC.DeathSound = SoundID.NPCDeath44; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -117,8 +113,6 @@ namespace CalamityMod.NPCs.Signus bool revenge = CalamityWorld.revenge; float playerDistNormMult = revenge ? 24f : 22f; - if (BossRushEvent.BossRushActive) - playerDistNormMult = 30f; CalamityRegularEnemyAI.DungeonSpiritAI(NPC, Mod, playerDistNormMult, 0f, true); } diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index 69af4f8c13..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; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.Signus NPC.HitSound = SoundID.NPCHit53; NPC.DeathSound = SoundID.NPCDeath44; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index eb3761f198..cceffde46d 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; @@ -89,9 +95,6 @@ namespace CalamityMod.NPCs.Signus NPC.HitSound = SoundID.NPCHit49; NPC.DeathSound = SoundID.NPCDeath51; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -129,21 +132,20 @@ namespace CalamityMod.NPCs.Signus CalamityGlobalNPC.signus = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Vector2 vectorCenter = NPC.Center; double lifeRatio = NPC.life / (double)NPC.lifeMax; - lifeToAlpha = (int)((Main.getGoodWorld ? 200D : 100D) * (1D - lifeRatio)); + lifeToAlpha = (int)((CalamityWorld.LegendaryMode ? 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 = bossRush ? 9f : death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; - float chargeVelocity = bossRush ? 16f : death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; - if (Main.getGoodWorld) + float inertia = death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; + float chargeVelocity = death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; + if (CalamityWorld.LegendaryMode) { inertia *= 0.5f; chargeVelocity *= 1.15f; @@ -197,7 +199,7 @@ namespace CalamityMod.NPCs.Signus else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (lifeToAlpha < (Main.getGoodWorld ? 100 : 50) && NPC.ai[0] != 1f) + if (lifeToAlpha < (CalamityWorld.LegendaryMode ? 100 : 50) && NPC.ai[0] != 1f) { for (int i = 0; i < 2; i++) { @@ -237,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; @@ -251,7 +250,7 @@ namespace CalamityMod.NPCs.Signus if (phase3 || revenge) NPC.knockBackResist = 0f; - float speed = bossRush ? 20f : revenge ? 15f : expertMode ? 14f : 12f; + float speed = revenge ? 15f : expertMode ? 14f : 12f; if (expertMode) speed += death ? 6f * (float)(1D - lifeRatio) : 4f * (float)(1D - lifeRatio); @@ -263,7 +262,7 @@ namespace CalamityMod.NPCs.Signus playerYDist *= playerDistance; float inertia2 = 50f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia2 *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia2 + playerXDist) / (inertia2 + 1f); @@ -288,17 +287,14 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 0f) { - // Avoid cheap bullshit - NPC.damage = 0; - if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.localAI[1] += bossRush ? 1.5f : 1f; + NPC.localAI[1] += 1f; if (expertMode) NPC.localAI[1] += death ? 3f * (float)(1D - lifeRatio) : 2f * (float)(1D - lifeRatio); - if (NPC.localAI[1] >= (Main.getGoodWorld ? 0f : 120f)) + if (NPC.localAI[1] >= (CalamityWorld.LegendaryMode ? 0f : 120f)) { NPC.localAI[1] = 0f; @@ -345,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)); @@ -356,7 +352,7 @@ namespace CalamityMod.NPCs.Signus Main.dust[dust].fadeIn = 1f; } - NPC.alpha += bossRush ? 3 : 2; + NPC.alpha += 2; if (expertMode) NPC.alpha += death ? (int)Math.Round(4.5D * (1D - lifeRatio)) : (int)Math.Round(3D * (1D - lifeRatio)); @@ -381,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); @@ -465,15 +460,12 @@ 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; NPC.spriteDirection = NPC.direction; - float divisor = expertMode ? (bossRush ? 10f : death ? 12f : revenge ? 15f : 20f) - (float)Math.Ceiling(5D * (1D - lifeRatio)) : 20f; + float divisor = expertMode ? (death ? 12f : revenge ? 15f : 20f) - (float)Math.Ceiling(5D * (1D - lifeRatio)) : 20f; float scytheBarrageTime = divisor * 3f; float scytheBarrageCooldown = divisor * 3f; @@ -496,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; } @@ -513,8 +503,8 @@ namespace CalamityMod.NPCs.Signus } } - float maxVelocityY = bossRush ? 1.5f : death ? 2.5f : 3f; - float maxVelocityX = bossRush ? 5f : death ? 7f : 8f; + float maxVelocityY = death ? 2.5f : 3f; + float maxVelocityX = death ? 7f : 8f; if (NPC.position.Y > player.position.Y - 250f) { @@ -573,7 +563,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalLamps = (Main.getGoodWorld && !Main.zenithWorld) ? 10 : 5; + int totalLamps = (CalamityWorld.LegendaryMode && !Main.zenithWorld) ? 10 : 5; if (NPC.CountNPCS(ModContent.NPCType()) < totalLamps) { bool buffed = false; @@ -632,10 +622,7 @@ namespace CalamityMod.NPCs.Signus if (calamityGlobalNPC.newAI[0] == 0f) // Line up the charge { - // Avoid cheap bullshit - NPC.damage = 0; - - float velocity = bossRush ? 18f : revenge ? 16f : expertMode ? 15f : 14f; + float velocity = revenge ? 16f : expertMode ? 15f : 14f; if (expertMode) velocity += death ? 6f * (float)(1D - lifeRatio) : 4f * (float)(1D - lifeRatio); @@ -670,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; @@ -697,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; @@ -712,15 +690,14 @@ namespace CalamityMod.NPCs.Signus if ((phase2 || buffed) && NPC.ai[2] % 3f == 0f) { SoundEngine.PlaySound(SoundID.Item73, NPC.Center); - int type = (CalamityWorld.LegendaryMode && revenge) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = (CalamityWorld.LegendaryMode && revenge) ? 60 : NPC.GetProjectileDamage(type); + int type = (CalamityWorld.LegendaryMode) ? ModContent.ProjectileType() : ModContent.ProjectileType(); Vector2 velocity = Main.zenithWorld ? new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)) : Vector2.Zero; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) { velocity = new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)); } 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); } } @@ -750,9 +727,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; @@ -916,7 +890,7 @@ namespace CalamityMod.NPCs.Signus return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -984,7 +958,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 9d19bc6ba6..ab8ea6601f 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -20,17 +20,20 @@ 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 360 : 180; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 360 : 180; NPC.knockBackResist = 0.7f; AnimationType = NPCID.Slimer; NPC.lavaImmune = false; @@ -40,10 +43,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -84,8 +83,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 e8df94c69d..35eb93535f 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -23,14 +23,14 @@ 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 180 : 90; + NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : CalamityWorld.LegendaryMode ? 180 : 90; NPC.knockBackResist = 0.9f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; @@ -40,10 +40,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -85,14 +81,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 4cb9744c71..70d731eb17 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -22,14 +22,14 @@ 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 220 : 110; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 220 : 110; NPC.knockBackResist = 0.8f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 9f321b1817..635c400287 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -26,17 +26,19 @@ 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 260 : 130; + NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : CalamityWorld.LegendaryMode ? 260 : 130; NPC.knockBackResist = 0.7f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -101,7 +103,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 07b540a747..92b31f87e7 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; @@ -49,9 +50,6 @@ namespace CalamityMod.NPCs.SlimeGod AIType = -1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -82,10 +80,9 @@ namespace CalamityMod.NPCs.SlimeGod CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); CalamityGlobalNPC.slimeGodRed = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -97,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 @@ -112,10 +109,10 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; // How fast the slime slams down - float slamVelocity = bossRush ? 20f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; // Used for how fast the slime animates NPC.aiAction = 0; @@ -155,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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) @@ -188,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; @@ -223,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 @@ -241,9 +237,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - enraged = true; - if (NPC.localAI[1] != 1f) { if (enraged) @@ -342,7 +335,7 @@ namespace CalamityMod.NPCs.SlimeGod } } - float distanceSpeedBoost = NPC.Distance(player.Center) * (bossRush ? 0.008f : 0.005f); + float distanceSpeedBoost = NPC.Distance(player.Center) * 0.005f; if (NPC.ai[0] == 0f) { @@ -569,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; @@ -604,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); } } @@ -719,7 +711,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -752,7 +744,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index c366736034..c45b32cdef 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,15 +49,11 @@ 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; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -86,10 +82,9 @@ namespace CalamityMod.NPCs.SlimeGod CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); CalamityGlobalNPC.slimeGodPurple = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -98,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 && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; NPC.aiAction = 0; // Get a target @@ -131,7 +126,7 @@ namespace CalamityMod.NPCs.SlimeGod if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) @@ -160,12 +155,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - { - enraged = true; - hyperMode = true; - } - // For animating the wings NPC.localAI[0] += 1f; @@ -272,7 +261,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.timeLeft > 10) { NPC.ai[1] += 1f; - int idleTime = bossRush ? 30 : death ? 75 : revenge ? 90 : 120; + int idleTime = death ? 75 : revenge ? 90 : 120; if (NPC.ai[1] >= idleTime) { NPC.ai[1] = 0f; @@ -319,10 +308,9 @@ namespace CalamityMod.NPCs.SlimeGod { if (Main.netMode != NetmodeID.MultiplayerClient) { - int numProjectiles = Main.getGoodWorld ? 12 : death ? 6 : 4; + int numProjectiles = CalamityWorld.LegendaryMode ? 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); @@ -353,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 @@ -387,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); } } } @@ -436,14 +424,13 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.ai[1] == 1f) { NPC.ai[3] += 1f; - float slimeDropGateValue = bossRush ? 10f : death ? 20f : revenge ? 25f : expertMode ? 30f : 40f; + float slimeDropGateValue = death ? 20f : revenge ? 25f : expertMode ? 30f : 40f; if (NPC.ai[3] % slimeDropGateValue == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { 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; @@ -467,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); @@ -498,16 +485,16 @@ namespace CalamityMod.NPCs.SlimeGod // Charge variables float chargeVelocityMult = 0.1f; - float maxChargeVelocity = (bossRush || enraged) ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; - if (Main.getGoodWorld) + float maxChargeVelocity = enraged ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 2f; - float inertia = (bossRush || enraged) ? 100f : death ? 110f : revenge ? 114f : expertMode ? 120f : 130f; + float inertia = death ? 110f : revenge ? 114f : expertMode ? 120f : 130f; if (lifeRatio < 0.75f) inertia *= 0.8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; // Start charge @@ -544,7 +531,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = setDamage; NPC.ai[2] += 1f; - float phaseGateValue = (bossRush || enraged) ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; + float phaseGateValue = enraged ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; if (NPC.ai[2] >= phaseGateValue) { NPC.ai[1] = 2f; @@ -562,7 +549,7 @@ namespace CalamityMod.NPCs.SlimeGod // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = (bossRush || enraged) ? 1.15f : death ? 1.13f : revenge ? 1.12f : expertMode ? 1.11f : 1.1f; + float velocityMult = enraged ? 1.15f : death ? 1.13f : revenge ? 1.12f : expertMode ? 1.11f : 1.1f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -651,7 +638,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -684,7 +671,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -763,13 +750,12 @@ namespace CalamityMod.NPCs.SlimeGod public static void FlyMovement(NPC npc, bool slimeBombardment = false) { // Difficulty bools - bool bossRush = BossRushEvent.BossRushActive; bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; bool ableToDropSlime = npc.ai[1] == 1f; - float flyVelocity = bossRush ? 20f : death ? 15f : revenge ? 12.5f : 10f; - float flyAcceleration = bossRush ? 0.24f : death ? 0.18f : revenge ? 0.15f : 0.12f; + float flyVelocity = death ? 15f : revenge ? 12.5f : 10f; + float flyAcceleration = death ? 0.18f : revenge ? 0.15f : 0.12f; if (slimeBombardment) { diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index b6fe65cfe7..df352658d5 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -60,7 +60,6 @@ namespace CalamityMod.NPCs.SlimeGod public static readonly SoundStyle ShotSound = new("CalamityMod/Sounds/Custom/SlimeGodShot", 2); public static readonly SoundStyle BigShotSound = new("CalamityMod/Sounds/Custom/SlimeGodBigShot", 2); - public static Asset ZenithSeedEyeTexture; public static Asset EyeTexture; public static Asset OverlayTexture; @@ -73,35 +72,26 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetStaticDefaults() { NPCID.Sets.BossBestiaryPriority.Add(Type); - NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() - { - Scale = 0.5f, - PortraitScale = 0.6f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/SlimeGod_Bestiary", - PortraitPositionXOverride = 40, - PortraitPositionYOverride = 40 - }; - value.Position.X += 65; - value.Position.Y += 35; - NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; NPCID.Sets.MPAllowedEnemies[Type] = true; if (!Main.dedServ) { - ZenithSeedEyeTexture = ModContent.Request("CalamityMod/NPCs/SlimeGod/SlimeGodEyes", AssetRequestMode.AsyncLoad); EyeTexture = ModContent.Request("CalamityMod/NPCs/SlimeGod/ExtraTextures/SlimeGodCoreEye", AssetRequestMode.AsyncLoad); OverlayTexture = ModContent.Request("CalamityMod/NPCs/SlimeGod/ExtraTextures/SlimeGodCoreOverlay", AssetRequestMode.AsyncLoad); } } + 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 6; @@ -111,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(); @@ -122,9 +112,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -212,13 +199,11 @@ namespace CalamityMod.NPCs.SlimeGod Lighting.AddLight(NPC.Center, light.X, light.Y, light.Z); CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - CalamityGlobalNPC.slimeGod = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // For animating the eye NPC.localAI[0] += 1f; @@ -504,7 +489,7 @@ namespace CalamityMod.NPCs.SlimeGod if (expertMode && aggressionLevel >= (int)AggressionLevel.FireProjectiles) { - float divisor = bossRush ? 50f : death ? 90f : revenge ? 120f : 150f; + float divisor = death ? 90f : revenge ? 120f : 150f; divisor -= (aggressionLevel - 1) * 10f; if (aggressionLevel == (int)AggressionLevel.DoEverythingMoreOften) divisor *= 0.5f; @@ -518,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); } } } @@ -546,9 +529,7 @@ namespace CalamityMod.NPCs.SlimeGod flySpeed += 3f; if (phase2) flySpeed *= 1.1f; - if (bossRush) - flySpeed *= 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) flySpeed *= 1.3f; Vector2 flyDestination = aggressionLevel >= (int)AggressionLevel.ChargeAtPlayer ? player.Center : player.Center - Vector2.UnitY * 320f; @@ -590,9 +571,9 @@ namespace CalamityMod.NPCs.SlimeGod float maxInertiaDistance = 600f; float totalInertiaAdjustmentDistance = maxInertiaDistance - minInertiaDistance; float distanceFromInertiaAdjustmentCutoff = distanceFromFlyDestination - minInertiaDistance; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) maxInertia *= 0.8f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) maxInertia *= Main.rand.NextFloat(0.2f, 1f); float inertia = distanceFromFlyDestination >= maxInertiaDistance ? maxInertia : @@ -636,10 +617,9 @@ namespace CalamityMod.NPCs.SlimeGod Texture2D texture = TextureAssets.Npc[Type].Value; Texture2D eyeTexture = EyeTexture.Value; Texture2D overlayTexture = OverlayTexture.Value; - Texture2D pog = ZenithSeedEyeTexture.Value; // Used for animating the eye - if (NPC.localAI[0] % 6f == 0f) + if (NPC.localAI[0] % 6f == 0f && !NPC.IsABestiaryIconDummy) { eyeFrameDrawn++; if (eyeFrameX == 0) @@ -703,9 +683,6 @@ namespace CalamityMod.NPCs.SlimeGod // Draw the overlay spriteBatch.Draw(overlayTexture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, drawColorAlpha, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - if (Main.zenithWorld) - spriteBatch.Draw(pog, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, drawColorAlpha, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - return false; } @@ -730,7 +707,7 @@ namespace CalamityMod.NPCs.SlimeGod return minDist <= 40f * NPC.scale; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.HealingPotion; } diff --git a/NPCs/SlimeGod/SlimeGodEyes.png b/NPCs/SlimeGod/SlimeGodEyes.png deleted file mode 100644 index dda0f23656..0000000000 Binary files a/NPCs/SlimeGod/SlimeGodEyes.png and /dev/null differ diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index dfd3f73e7d..985b530688 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; @@ -58,9 +57,6 @@ namespace CalamityMod.NPCs.SlimeGod AIType = -1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -97,10 +93,9 @@ namespace CalamityMod.NPCs.SlimeGod if (CalamityGlobalNPC.slimeGodRed < 0 || !Main.npc[CalamityGlobalNPC.slimeGodRed].active) CalamityGlobalNPC.slimeGodRed = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -112,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 @@ -127,10 +122,10 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; // How fast the slime slams down - float slamVelocity = bossRush ? 22.25f : death ? 18.25f : revenge ? 16.5f : expertMode ? 15.5f : 13.5f; + float slamVelocity = death ? 18.25f : revenge ? 16.5f : expertMode ? 15.5f : 13.5f; // Used for how fast the slime animates NPC.aiAction = 0; @@ -172,9 +167,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - enraged = true; - if (NPC.localAI[1] != 1f) { if (enraged) @@ -274,7 +266,7 @@ namespace CalamityMod.NPCs.SlimeGod } } - float distanceSpeedBoost = NPC.Distance(player.Center) * (bossRush ? 0.008f : 0.005f); + float distanceSpeedBoost = NPC.Distance(player.Center) * 0.005f; if (NPC.ai[0] == 0f) { @@ -481,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; @@ -510,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 @@ -544,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); } } } @@ -658,7 +649,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -691,7 +682,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index bbbd3c5e50..b827299dcf 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; @@ -58,9 +57,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -97,10 +93,9 @@ namespace CalamityMod.NPCs.SlimeGod if (CalamityGlobalNPC.slimeGodPurple < 0 || !Main.npc[CalamityGlobalNPC.slimeGodPurple].active) CalamityGlobalNPC.slimeGodPurple = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -109,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 @@ -123,10 +118,10 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; - float scale = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; // How fast the slime slams down - float slamVelocity = bossRush ? 20f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; NPC.aiAction = 0; NPC.noTileCollide = false; @@ -165,12 +160,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - { - enraged = true; - hyperMode = true; - } - // Slow down dramatically while teleporting if (NPC.ai[0] == 5f || NPC.ai[0] == 6f) { @@ -264,7 +253,7 @@ namespace CalamityMod.NPCs.SlimeGod } } - float distanceSpeedBoost = NPC.Distance(player.Center) * (bossRush ? 0.008f : 0.005f); + float distanceSpeedBoost = NPC.Distance(player.Center) * 0.005f; if (NPC.ai[0] == 0f) { @@ -415,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); @@ -423,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); } } } @@ -509,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; @@ -541,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); } } @@ -576,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); } } } @@ -688,7 +675,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -721,7 +708,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 0519194931..ec54f5f5de 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; @@ -60,22 +62,17 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -101,10 +98,9 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life > Main.npc[(int)NPC.ai[1]].life) NPC.life = Main.npc[(int)NPC.ai[1]].life; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Shed armor bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; @@ -146,7 +142,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire a barrage of lasers every 5 seconds - float laserBarrageGateValue = bossRush ? 200f : 300f; + float laserBarrageGateValue = 300f; if (Main.npc[(int)NPC.ai[2]].localAI[0] % laserBarrageGateValue == 0f) { float bodySegmentDivisor = death ? 6 : revenge ? 5 : expertMode ? 4 : 3; @@ -156,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; } } @@ -236,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) + (bossRush ? 3f : 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,10 +242,9 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -273,7 +252,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -299,17 +278,16 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -369,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 e2488b3a43..2254d75035 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(); @@ -112,22 +116,17 @@ namespace CalamityMod.NPCs.StormWeaver NPC.noTileCollide = true; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -171,14 +170,13 @@ namespace CalamityMod.NPCs.StormWeaver { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (CalamityServerConfig.Instance.BossesStopWeather) CalamityWorld.StopRain(); - else if (!Main.raining && !bossRush) + else if (!Main.raining && !BossRushEvent.BossRushActive) CalamityWorld.StartRain(); float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -193,7 +191,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.3f; // Update armored settings to naked settings - if (phase2 && (!CalamityWorld.LegendaryMode || !revenge)) + if (phase2 && !CalamityWorld.LegendaryMode) { // Spawn armor gore, roar and set other crucial variables if (!NPC.chaseable) @@ -280,7 +278,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Used for body and tail projectile firing timings in phase 1 - if (!phase2 || (CalamityWorld.LegendaryMode && revenge)) + if (!phase2 || CalamityWorld.LegendaryMode) NPC.localAI[0] += 1f; } @@ -333,8 +331,8 @@ namespace CalamityMod.NPCs.StormWeaver Vector2 npcCenter = NPC.Center; float targetCenterX = Main.player[NPC.target].Center.X; float targetCenterY = Main.player[NPC.target].Center.Y; - float velocity = (phase2 ? 12f : 10f) + (bossRush ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); - float acceleration = (phase2 ? 0.24f : 0.2f) + (bossRush ? 0.12f : revenge ? 0.08f : expertMode ? 0.04f : 0f); + float velocity = (phase2 ? 12f : 10f) + (revenge ? 1.5f : expertMode ? 1f : 0f); + float acceleration = (phase2 ? 0.24f : 0.2f) + (revenge ? 0.08f : expertMode ? 0.04f : 0f); // Start charging at the player when in phase 2 if (phase2) @@ -358,7 +356,7 @@ namespace CalamityMod.NPCs.StormWeaver bool useTornadoes = calamityGlobalNPC.newAI[3] % 2f != 0f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) @@ -468,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; @@ -520,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; } } @@ -540,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); } } } @@ -558,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) { @@ -621,7 +618,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.4f; acceleration *= 1.4f; @@ -676,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); } } } @@ -780,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) @@ -818,7 +801,7 @@ namespace CalamityMod.NPCs.StormWeaver SoundEngine.PlaySound(SoundID.Thunder, NPC.Center); // Start a storm when in third phase. Don't do this during Boss Rush - if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu) || calamityGlobalNPC.newAI[1] > 0f || bossRush) + if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu) || calamityGlobalNPC.newAI[1] > 0f || BossRushEvent.BossRushActive) return; CalamityWorld.StartRain(true, true); @@ -840,18 +823,17 @@ namespace CalamityMod.NPCs.StormWeaver CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && (!CalamityWorld.LegendaryMode || !revenge); + bool phase2 = lifeRatio < 0.8f && !CalamityWorld.LegendaryMode; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -877,21 +859,20 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; 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); } @@ -954,7 +935,7 @@ namespace CalamityMod.NPCs.StormWeaver return true; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 4fb551873c..f4a1862d72 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; @@ -59,22 +61,17 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -114,9 +111,8 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life > Main.npc[(int)NPC.ai[1]].life) NPC.life = Main.npc[(int)NPC.ai[1]].life; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; // Shed armor bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; @@ -150,12 +146,11 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire a lightning orb every 5 seconds - float spawnOrbGateValue = bossRush ? 200f : 300f; + float spawnOrbGateValue = 300f; 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); } } } @@ -232,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) + (bossRush ? 3f : 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,10 +238,9 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -269,7 +248,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -303,21 +282,20 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; 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); } @@ -372,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 2c4804bbdd..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; @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/AquaticUrchin.cs b/NPCs/SulphurousSea/AquaticUrchin.cs index bdcea410e6..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; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 4034dc9a41..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; @@ -49,10 +49,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index 828b72422d..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; @@ -48,10 +47,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index 52d003d45a..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; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index 8e3d11ea47..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; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index eb6d2b20c1..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; @@ -52,10 +51,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) 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/CarrionSwallower.cs b/NPCs/SunkenSea/CarrionSwallower.cs index 82f8a7ca67..0d092cd892 100644 --- a/NPCs/SunkenSea/CarrionSwallower.cs +++ b/NPCs/SunkenSea/CarrionSwallower.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.SunkenSea SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; //Banner = NPC.type; //BannerItem = ModContent.ItemType(); - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index f822cd01b0..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; @@ -107,10 +108,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[3] { ModContent.GetInstance().Type, ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -164,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) @@ -211,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; @@ -229,6 +228,8 @@ namespace CalamityMod.NPCs.SunkenSea } else { + NPC.damage = originalDamage; + if (NPC.velocity.Y < 0) { ShellRotation += 0.065f; @@ -256,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) @@ -298,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 @@ -306,7 +309,7 @@ namespace CalamityMod.NPCs.SunkenSea if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, velocity, ModContent.ProjectileType(), NPC.damage / 2, 1); + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, velocity, ModContent.ProjectileType(), Main.hardMode ? 30 : 15, 1); } for (int i = 0; i < 9; i++) { @@ -328,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 ce3fe26a48..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; @@ -92,10 +91,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 5c7057d29f..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; @@ -104,10 +104,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -243,7 +239,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(NPC.damage * 0.5f), 0, ai1: NPC.whoAmI + 1); + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 12, 0, ai1: NPC.whoAmI + 1); } } // Reset diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 67822c3cf0..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; @@ -79,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -132,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/HauntedChum.cs b/NPCs/SunkenSea/HauntedChum.cs index b065138b84..a0b1ebf8d9 100644 --- a/NPCs/SunkenSea/HauntedChum.cs +++ b/NPCs/SunkenSea/HauntedChum.cs @@ -44,9 +44,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.noGravity = true; NPC.noTileCollide = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/SunkenSea/Jellyghoul.cs b/NPCs/SunkenSea/Jellyghoul.cs index 22d502e83c..d9d6a532e0 100644 --- a/NPCs/SunkenSea/Jellyghoul.cs +++ b/NPCs/SunkenSea/Jellyghoul.cs @@ -68,10 +68,6 @@ namespace CalamityMod.NPCs.SunkenSea // Banner = NPC.type; //BannerItem = ModContent.ItemType(); SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/KelpieSeadragon.cs b/NPCs/SunkenSea/KelpieSeadragon.cs index 74c29cbde3..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; @@ -80,9 +80,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -202,7 +199,7 @@ namespace CalamityMod.NPCs.SunkenSea { Vector2 spawnPos = new Vector2(NPC.Center.X + NPC.direction * 18, NPC.position.Y + 22); Vector2 projSpeed = spawnPos.DirectionTo(currentTarget.Center).SafeNormalize(Vector2.Zero) * 6; - Projectile.NewProjectile(NPC.GetSource_FromThis(), spawnPos, projSpeed, ModContent.ProjectileType(), NPC.damage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromThis(), spawnPos, projSpeed, ModContent.ProjectileType(), 10, 0f); } } // Squash and stretch diff --git a/NPCs/SunkenSea/LazarusLampfish.cs b/NPCs/SunkenSea/LazarusLampfish.cs index 7106f1ef69..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; @@ -102,9 +102,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -231,7 +228,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + (NPC.rotation - (NPC.spriteDirection == 1 ? 0 : MathHelper.Pi)).ToRotationVector2() * 40, Vector2.Zero, ModContent.ProjectileType(), (int)(NPC.damage * 0.5f), 1); + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + (NPC.rotation - (NPC.spriteDirection == 1 ? 0 : MathHelper.Pi)).ToRotationVector2() * 40, Vector2.Zero, ModContent.ProjectileType(), 20, 1); } SoundEngine.PlaySound(SoundID.NPCDeath7 with { Pitch = 0.4f }, NPC.Center); } diff --git a/NPCs/SunkenSea/Leerslug.cs b/NPCs/SunkenSea/Leerslug.cs index d95830fd0d..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; @@ -67,10 +67,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void ReceiveExtraAI(BinaryReader reader) 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/PodobooKoi.cs b/NPCs/SunkenSea/PodobooKoi.cs index 0b6dcdb2e2..22b3f9f7c3 100644 --- a/NPCs/SunkenSea/PodobooKoi.cs +++ b/NPCs/SunkenSea/PodobooKoi.cs @@ -102,10 +102,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToWater = true; //Banner = NPC.type; //BannerItem = ModContent.ItemType(); - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index e4a4fa9c1c..027c5905b4 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() diff --git a/NPCs/SunkenSea/Polyperil.cs b/NPCs/SunkenSea/Polyperil.cs index dd6144516b..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(); @@ -75,9 +75,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/PolyperilTentacle.cs b/NPCs/SunkenSea/PolyperilTentacle.cs index 5c3be05d15..f7bd01e49f 100644 --- a/NPCs/SunkenSea/PolyperilTentacle.cs +++ b/NPCs/SunkenSea/PolyperilTentacle.cs @@ -62,12 +62,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = 0; // Banner = NPC.type; // BannerItem = ModContent.ItemType(); - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index 3b23f038bb..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; @@ -80,10 +79,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) 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 8864d2a5f5..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; @@ -118,10 +118,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToWater = false; NPC.waterMovementSpeed = 1; NPC.GravityIgnoresLiquid = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/SandProwlerNested.cs b/NPCs/SunkenSea/SandProwlerNested.cs index 421bb088f3..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; @@ -103,10 +103,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); - NPC.waterMovementSpeed = 1f; } 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 7b967eb4e4..a695aaf629 100644 --- a/NPCs/SunkenSea/Sharkoon.cs +++ b/NPCs/SunkenSea/Sharkoon.cs @@ -193,16 +193,12 @@ 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; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } #endregion 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 64e154dd6f..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; @@ -91,10 +91,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToWater = true; NPC.Calamity().VulnerableToCold = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void ReceiveExtraAI(BinaryReader reader) @@ -483,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 d99d6832ea..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; @@ -172,7 +173,7 @@ namespace CalamityMod.NPCs.SunkenSea { SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 12), ModContent.ProjectileType(), NPC.damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 12), ModContent.ProjectileType(), 15, 0f, Main.myPlayer); for (int i = 0; i <= 12; i++) { float variance = Main.rand.NextFloat(-0.6f, 0.6f); @@ -231,7 +232,7 @@ namespace CalamityMod.NPCs.SunkenSea if (time % 2 == 0) { SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 0.2f, Pitch = 0.4f * sine, MaxInstances = 30 }, NPC.Center); - Projectile proj = Projectile.NewProjectileDirect(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 6), ModContent.ProjectileType(), NPC.damage * target.statLifeMax2, 0f, Main.myPlayer); + Projectile proj = Projectile.NewProjectileDirect(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 6), ModContent.ProjectileType(), 15 * target.statLifeMax2, 0f, Main.myPlayer); proj.friendly = true; proj.hostile = false; } diff --git a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs index 32fd48411e..21313f7e11 100644 --- a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs +++ b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs @@ -104,31 +104,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas else NPC.alpha = HeadSegment.alpha; - /*AttackTimer += BossRushEvent.BossRushActive ? 1.5f : 1f; - float attackgate = !HeadSegment.Calamity().unbreakableDR && Main.zenithWorld ? 450f : 900f; - if (AttackTimer >= attackgate && NoStartAttack <= 0) - { - AttackTimer = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = 4; - float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = 1f; - float projectileVelocityToPass = 15f; - - Vector2 spinningPoint = Vector2.Normalize(new Vector2(-velocity, -velocity)); - 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, 0f, projectileVelocityToPass); - } - NPC.netUpdate = true; - } - SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); - }*/ - if (Main.npc.IndexInRange((int)NPC.ai[1])) { Vector2 offsetToAheadSegment = AheadSegment.Center - NPC.Center; diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index 244db411f1..1e171f6b9c 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -201,8 +201,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 segmentLocation = NPC.Center; float targetX = CalamityGlobalNPC.SCal < 0 ? 0 : Main.npc[CalamityGlobalNPC.SCal].position.X + (Main.player[NPC.target].width / 2); float targetY = CalamityGlobalNPC.SCal < 0 ? 0 : Main.npc[CalamityGlobalNPC.SCal].position.Y + (Main.player[NPC.target].height / 2); - float sepMaxSpeed = BossRushEvent.BossRushActive ? 22.5f : 20f; - float sepAcceleration = (BossRushEvent.BossRushActive ? 0.2f : 0.175f) + (0.37f - AttackCooldown * 0.0015f); + float sepMaxSpeed = 20f; + float sepAcceleration = 0.175f + (0.37f - AttackCooldown * 0.0015f); float fasterMaxSpeed = sepMaxSpeed * 1.3f; float slowerMaxSpeed = sepMaxSpeed * 0.7f; @@ -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 ce3a029a3b..7d8bdd188c 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; @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.spriteDirection = (Target.Center.X < NPC.Center.X).ToDirectionInt(); timer++; - int shootRate = BossRushEvent.BossRushActive ? 120 : 180; + int shootRate = 180; if (timer > shootRate) { foreach (NPC seeker in Main.ActiveNPCs) @@ -162,10 +162,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float targetDist = Vector2.Distance(Target.Center, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (BossRushEvent.BossRushActive) - damage /= 2; - float velocity = 5f; float projectileVelocityToPass = velocity * 3f; Vector2 shootVelocity = (Target.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; @@ -181,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); @@ -210,7 +206,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(spark2); } - float distanceFromSCal = Main.getGoodWorld ? 300f : 225f; + float distanceFromSCal = CalamityWorld.LegendaryMode ? 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 a9f4887dc0..94eb32e22f 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; @@ -274,9 +280,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -445,39 +448,19 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (CalamityServerConfig.Instance.BossesStopWeather) CalamityWorld.StopRain(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // 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 && revenge && permafrost)); + bool zenithAI = Main.zenithWorld && (!permafrost || (CalamityWorld.LegendaryMode && 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()); - if (bossRush) - { - bulletHellblastDamage /= 2; - barrageDamage /= 2; - fireblastDamage /= 2; - gigablastDamage /= 2; - monsterDamage /= 2; - waveDamage /= 2; - hellblastDamage /= 2; - } - int bulletHellblast = zenithAI ? ModContent.ProjectileType() : ModContent.ProjectileType(); int barrage = ModContent.ProjectileType(); int gigablast = zenithAI ? ModContent.ProjectileType() : ModContent.ProjectileType(); @@ -489,7 +472,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int bodyHeight = 42; int baseBulletHellProjectileGateValue = revenge ? 8 : expertMode ? 9 : 10; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseBulletHellProjectileGateValue -= 2; Vector2 vectorCenter = NPC.Center; @@ -506,7 +489,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!startText) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalSummonText"; if (permafrost) @@ -684,13 +667,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region Enrage and DR - if ((spawnArena && !player.Hitbox.Intersects(safeBox)) || bossRush) + if (spawnArena && !player.Hitbox.Intersects(safeBox)) { - float projectileVelocityMultCap = (!player.Hitbox.Intersects(safeBox) && spawnArena) ? 2f : 1.35f; + float projectileVelocityMultCap = 2f; uDieLul = MathHelper.Clamp(uDieLul * 1.01f, 1f, projectileVelocityMultCap); - protectionBoost = !bossRush; - if (!player.Hitbox.Intersects(safeBox)) - protectionBoost = true; + protectionBoost = true; } else { @@ -777,7 +758,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas forcefieldOpacity = Utils.GetLerpValue(0.1f, 0.6f, NPC.Opacity, true); if (NPC.alpha >= 230) { - if (DownedBossSystem.downedCalamitas && !bossRush) + if (DownedBossSystem.downedCalamitas && !BossRushEvent.BossRushActive) { // Create a teleport line effect Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, permafrost ? Color.Cyan : Color.Red); @@ -863,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); } } } @@ -967,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++; @@ -988,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); } } } @@ -1026,7 +1007,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH2Text"; if (permafrost) @@ -1100,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) @@ -1113,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); } } } @@ -1151,7 +1132,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH3Text"; if (permafrost) @@ -1272,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; @@ -1307,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++; @@ -1318,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); } } } @@ -1356,7 +1338,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH4Text"; if (permafrost) @@ -1441,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++; @@ -1461,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); } } } @@ -1507,7 +1489,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (permafrost) key = "Mods.CalamityMod.Status.Boss.PermafrostBH5Text"; - if (!bossRush) + if (!BossRushEvent.BossRushActive) { if (DownedBossSystem.downedCalamitas && !permafrost) key += "Rematch"; @@ -1611,14 +1593,14 @@ 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; } - if (!hasDoneDeathAnim && !bossRush) // Scrapped death animation for Scal + if (!hasDoneDeathAnim && !BossRushEvent.BossRushActive) // Scrapped death animation for Scal { attackPause = 5; Dust.QuickDustLine(NPC.Center, safeBox.Center() + new Vector2(0, -30), 500f, permafrost ? Color.Cyan : Color.Red); @@ -1708,7 +1690,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - if (bossRush) + if (BossRushEvent.BossRushActive) NPC.Center = initialRitualPosition + new Vector2(0, -30); if (NPC.velocity.Y < 8f) @@ -1716,11 +1698,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!canDespawn) NPC.velocity.X *= 0.965f; - if (DownedBossSystem.downedCalamitas || bossRush) + if (DownedBossSystem.downedCalamitas || BossRushEvent.BossRushActive) { if (giveUpCounter == 720) { - if (bossRush) + if (BossRushEvent.BossRushActive) { NPC.chaseable = true; NPC.dontTakeDamage = false; @@ -1742,15 +1724,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.NPCLoot(); } } - else if (giveUpCounter == 900 && !bossRush) + else if (giveUpCounter == 900 && !BossRushEvent.BossRushActive) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText1", textColor); } - else if (giveUpCounter == 600 && !bossRush) + else if (giveUpCounter == 600 && !BossRushEvent.BossRushActive) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText2", textColor); } - else if (giveUpCounter == 300 && !bossRush) + else if (giveUpCounter == 300 && !BossRushEvent.BossRushActive) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText3", textColor); } @@ -1810,7 +1792,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText4"; if (permafrost) @@ -1826,7 +1808,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired4 && lifeRatio <= 0.02f) { - if (!bossRush && !permafrost) + if (!BossRushEvent.BossRushActive && !permafrost) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText3"; if (DownedBossSystem.downedCalamitas) @@ -1840,7 +1822,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired3 && lifeRatio <= 0.04f) { - if (!bossRush && !permafrost) + if (!BossRushEvent.BossRushActive && !permafrost) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText2"; if (DownedBossSystem.downedCalamitas) @@ -1854,7 +1836,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired2 && lifeRatio <= 0.06f) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText1"; if (permafrost) @@ -1925,7 +1907,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas #region TransformSeekerandBrotherTriggers if (!halfLife && lifeRatio <= 0.45f && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalPhase2Text"; if (permafrost) @@ -1943,7 +1925,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (!secondStage) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalSeekerRingText"; if (permafrost) @@ -1970,9 +1952,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { SoundEngine.PlaySound(SoundID.Item74, NPC.Center); - int totalSeekers = Main.getGoodWorld ? 20 : 10; + int totalSeekers = CalamityWorld.LegendaryMode ? 20 : 10; int degreesBetweenEachSeeker = 360 / totalSeekers; - int distanceFromSCal = Main.getGoodWorld ? 300 : 225; + int distanceFromSCal = CalamityWorld.LegendaryMode ? 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); @@ -2063,6 +2045,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.dontTakeDamage = true; NPC.chaseable = false; NPC.damage = 0; + attackPause = 5; if (!canDespawn) NPC.velocity *= 0.95f; @@ -2182,7 +2165,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2236,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; } } @@ -2255,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; } } @@ -2279,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; } } @@ -2296,7 +2279,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2398,7 +2381,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2455,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); } } } @@ -2477,7 +2460,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2525,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); } } @@ -2539,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; @@ -2748,7 +2732,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2800,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; } } @@ -2818,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; } } @@ -2842,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; } } @@ -2857,7 +2841,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2931,7 +2915,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2988,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); } } } @@ -3015,7 +2999,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -3065,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); } } @@ -3397,7 +3381,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #region Loot - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -3787,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 f20fb06bb9..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; @@ -94,9 +96,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.localAI[1] = 500; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -181,13 +180,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Increase DR if the target leaves SCal's arena. - NPC.Calamity().DR = SupremeCataclysm.NormalBrothersDR; + NPC.Calamity().DR = NormalBrothersDR; if (Main.npc[CalamityGlobalNPC.SCal].ModNPC().IsTargetOutsideOfArena) NPC.Calamity().DR = SupremeCalamitas.enragedDR; @@ -326,7 +324,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else if (BigAttackTimer > PreBigAttackPause) { // Shoot fists. - float fireRate = BossRushEvent.BossRushActive ? 2f : MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (broIsAlive == false ? death ? 1.32f : 1.1f : 1); + float fireRate = MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (!broIsAlive ? death ? 1.32f : 1.1f : 1); PunchCounter += fireRate; if (PunchCounter >= PunchCounterLimit) @@ -339,9 +337,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + int damage = Main.zenithWorld ? SupremeCatastrophe.SlashDamage : FistDamage; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -391,9 +387,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { // Shoot fists. - float fireRate = BossRushEvent.BossRushActive ? 2.8f : MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio); + float fireRate = MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio); if (broIsAlive == false) - fireRate = BossRushEvent.BossRushActive ? 3.5f + (29 - BigAttackLimit) * 0.45f : MathHelper.Lerp(3f, (4f + (29 - BigAttackLimit) * 0.45f), 1f - totalLifeRatio) * 1.2f; + fireRate = MathHelper.Lerp(3f, (4f + (29 - BigAttackLimit) * 0.45f), 1f - totalLifeRatio) * 1.2f; if (Phase2 && BigAttackLimit == 0) fireRate = 1; @@ -407,9 +403,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + 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) @@ -423,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 596c9706a8..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; @@ -87,9 +90,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.localAI[1] = 500; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -175,10 +175,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Increase DR if the target leaves SCal's arena. NPC.Calamity().DR = SupremeCataclysm.NormalBrothersDR; @@ -274,11 +273,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas dashAttackTimer--; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; - - 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) { @@ -308,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); @@ -373,7 +368,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else if (BigAttackTimer > PreBigAttackPause) { // Shoot sword slashes. - float fireRate = BossRushEvent.BossRushActive ? 2f : MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (broIsAlive == false ? death ? 1.25f : 1.05f : 1); + float fireRate = MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (!broIsAlive ? death ? 1.25f : 1.05f : 1); SlashCounter += fireRate; if (SlashCounter >= SlashCounterLimit) { @@ -385,9 +380,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + int damage = Main.zenithWorld ? SupremeCataclysm.FistDamage : SlashDamage; Vector2 slashSpawnPosition = NPC.Center + Vector2.UnitX * 125f * NPC.direction; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -439,7 +432,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { // Shoot sword slashes. - float fireRate = BossRushEvent.BossRushActive ? 2.8f : MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio) * (broIsAlive == false ? 1.35f : 1); + float fireRate = MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio) * (!broIsAlive ? 1.35f : 1); if (Phase2 && BigAttackLimit == 0) fireRate = 1; SlashCounter += fireRate; @@ -452,14 +445,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + 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/Archmage.cs b/NPCs/TownNPCs/Archmage.cs index de022694e1..9d51ae5deb 100644 --- a/NPCs/TownNPCs/Archmage.cs +++ b/NPCs/TownNPCs/Archmage.cs @@ -170,7 +170,6 @@ namespace CalamityMod.NPCs.TownNPCs .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(5)) .Add(ModContent.ItemType()) .Add(ModContent.ItemType(), Condition.PlayerCarriesItem(ModContent.ItemType())) - .Add(ItemID.IceCream, Condition.HappyEnoughToSellPylons, Condition.InSnow) .Register(); } diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index f843890b83..b0eb9f89bf 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.TownNPCs public override List SetNPCNameList() => new List() { - // Patron names + // Dedicated names "Xplizzy", // <@!98826096237109248> (whitegiraffe) "Freakish", // <@!750363283520749598> (freak5650) "Calder", // <@!601897959176798228> (hardlightcaster) @@ -116,6 +116,7 @@ namespace CalamityMod.NPCs.TownNPCs "Jackie", // <@!353241811717718016> (jackalchan) "Ishmael", // <@!840416568000381046> (vanillaoyster) "Ariallis", // <@!518231218806980609> (ariallis) + "Shade", // <@!613133259563466755> (shade__storm) // Original names this.GetLocalizedValue("Name.Laura"), diff --git a/NPCs/TownNPCs/SeaKing.cs b/NPCs/TownNPCs/SeaKing.cs index 3c39586f46..4ff9da3fd5 100644 --- a/NPCs/TownNPCs/SeaKing.cs +++ b/NPCs/TownNPCs/SeaKing.cs @@ -206,8 +206,6 @@ namespace CalamityMod.NPCs.TownNPCs .Add(ModContent.ItemType()) .AddWithCustomValue(ItemID.TruffleWorm, Item.buyPrice(gold: 20), Condition.Hardmode) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40), downedOldDuke) - .AddWithCustomValue(ItemID.ShrimpPoBoy, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons, Condition.InBeach) - .AddWithCustomValue(ItemID.Fries, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons, Condition.InBeach, Condition.DownedEyeOfCthulhu) .Register(); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index f8756c948e..8d979d3d03 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -16,13 +16,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses private const float SpinVelocity = 12f; private const int SpinRadius = 45; + // Rev+ exclusive + public static int BloodShotDamage = 11; // 44 + public static bool BuffedBrainofCthulhuAI(NPC npc, Mod mod) { // whoAmI variable NPC.crimsonBoss = npc.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -34,28 +36,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - bool enrage = true; - 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 = bossRush ? 1.5f : death ? 0.5f : 0f; - if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 0.5f; - } - if (!Main.player[npc.target].ZoneCrimson || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - // Despawn check - bool despawn = Main.player[npc.target].dead && !bossRush; + bool despawn = (Main.player[npc.target].dead || !Main.player[npc.target].ZoneCrimson) && !BossRushEvent.BossRushActive; // Despawn if (despawn) @@ -69,9 +51,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) { @@ -107,7 +86,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 2 if (npc.ai[0] < 0f) { - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.brainOfGravity = npc.whoAmI; // Spawn gore @@ -205,7 +184,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; @@ -236,15 +215,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 (Main.getGoodWorld) + float nonChargeSpeed = (death ? 25.5f : 18f) + velocityBoost; + if (CalamityWorld.LegendaryMode) 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; } @@ -290,8 +269,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 (Main.getGoodWorld) + npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 10f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; + if (CalamityWorld.LegendaryMode) npc.velocity *= 1.15f; } } @@ -333,10 +312,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.velocity *= 1.15f; } } @@ -345,7 +324,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; @@ -423,7 +402,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) @@ -441,7 +419,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; @@ -456,7 +434,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) @@ -479,7 +456,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; @@ -571,8 +548,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; @@ -699,7 +676,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; @@ -728,7 +705,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float targetYDistPhase1 = Main.player[npc.target].Center.Y - brainCenterPhase1.Y; float targetDistancePhase1 = (float)Math.Sqrt(targetXDistPhase1 * targetXDistPhase1 + targetYDistPhase1 * targetYDistPhase1); float maxMoveVelocity = (death ? 4f : 1.5f) + velocityScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) maxMoveVelocity *= 2f; if (targetDistancePhase1 < maxMoveVelocity) @@ -772,8 +749,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); @@ -859,23 +836,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target 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 = bossRush ? enrageScaleMax : 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; @@ -884,7 +850,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; @@ -898,10 +864,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; @@ -930,8 +894,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; @@ -986,8 +949,7 @@ 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) { @@ -997,7 +959,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f : Vector2.Zero); Vector2 targetDirection = destination - npc.Center; targetDirection = targetDirection.SafeNormalize(Vector2.UnitY); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { targetDirection *= chargeVelocity + 6f; npc.velocity = (npc.velocity * 49f + targetDirection) / 50f; @@ -1028,8 +990,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; @@ -1052,7 +1013,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int GetBrainOfCthuluCreepersCountRevDeath() { - return CalamityWorld.LegendaryMode ? 40 : Main.getGoodWorld ? 35 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 20; + return CalamityWorld.LegendaryMode ? 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 d75e76189f..404908d767 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(); @@ -35,8 +42,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Phases - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase2 = lifeRatio < 0.85f || death; bool phase3 = lifeRatio < 0.7f || death; bool phase4 = lifeRatio < (death ? 0.8f : 0.55f); @@ -53,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); @@ -70,24 +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 (bossRush) + if (CalamityWorld.LegendaryMode) { iceMistFireRate = 40; - iceMistSpeed = 14f; - iceMistAmt = 3; - fireballFireRate = 8; - fireballSpeed *= 1.2f; - lightningOrbPhaseTime = 90; - ancientLightSpawnRate = 20; - ancientLightAmt = 4; - idleTime = 20; - } - - if (Main.getGoodWorld) - { - iceMistFireRate = 30; iceMistSpeed = 15f; - fireballFireRate = 6; + fireballFireRate = 8; fireballSpeed *= 1.25f; lightningOrbPhaseTime = 60; ancientLightSpawnRate = 10; @@ -108,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) @@ -530,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); } } } @@ -1065,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); } } @@ -1094,8 +1087,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedAncientDoomAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; npc.damage = npc.defDamage = 0; float duration = 420f; float spawnAnimTime = 120f; @@ -1194,11 +1186,11 @@ 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) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs index ddaa634383..389bca8d8b 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs @@ -24,6 +24,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static float borderScalar = 0f; public static Vector2 lastDeerclopsPosition; + // Vanilla values + public static int IceSpikeDamage = 13; // 52 + public static int DebrisDamage = 18; // 72 + public static int HandDamage = 10; // 40 + public static bool BuffedDeerclopsAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -34,16 +39,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = (float)npc.life / (float)npc.lifeMax; // Difficulty bools - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // 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) { @@ -64,7 +65,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; @@ -129,7 +130,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]) @@ -171,14 +172,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool useFrontIceSpikeAttack = Math.Abs(distanceFromTarget2.X) >= Math.Abs(distanceFromTarget2.Y) * distanceCheckMultiplier || distanceFromTarget2.Length() < 48f; bool useEitherIceSpikeAttack = distanceFromTarget2.Y <= (float)(100 + targetData.Height) && distanceFromTarget2.Y >= -200f; - // Can only use ice spikes a maximum of twice in a row before doing something else - float iceSpikeAttackLimit = 2f; + // Can only use ice spikes a maximum of three times in a row before doing something else + float iceSpikeAttackLimit = 3f; bool doNotUseIceSpikes = calamityGlobalNPC.newAI[1] >= iceSpikeAttackLimit; if (!doNotUseIceSpikes) { // Deerclops must be this close to its target on the X axis to do the ice spike attack // This distance increases at lower HP because the ice spikes get bigger - float iceSpikesDistanceGateValue = 120f + MathHelper.Lerp(0f, 120f, 1f - lifeRatio); + float iceSpikesDistanceGateValue = 120f + MathHelper.Lerp(0f, 60f, 1f - lifeRatio); if (Math.Abs(distanceFromTarget2.X) < iceSpikesDistanceGateValue && useEitherIceSpikeAttack && npc.velocity.Y == 0f && npc.localAI[1] >= 2f) { npc.velocity.X = 0f; @@ -206,9 +207,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - // Can only use rubble a maximum of thrice in a row before doing something else - // This also takes into account the ice spike limit - float rubbleAttackLimit = 3f; + // Can only use rubble and ice spikes a maximum of four times in a row before doing something else + float rubbleAttackLimit = 4f; bool doNotUseRubble = calamityGlobalNPC.newAI[1] >= rubbleAttackLimit; float rubbleGateValue = death ? 160f : 200f; if (!doNotUseRubble) @@ -272,7 +272,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) @@ -316,7 +316,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) @@ -357,7 +357,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); } } } @@ -377,7 +377,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) @@ -408,17 +408,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.TargetClosest(); if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = (death ? 11 : 9) + (int)MathHelper.Lerp(0f, 7f, 1f - lifeRatio); + int totalProjectiles = (death ? 20 : 16) + (int)MathHelper.Lerp(0f, 7f, 1f - lifeRatio); float velocityMultIncrement = ((totalProjectiles + 1) / (float)totalProjectiles) - 1f; - float randomRadialOffset = MathHelper.ToRadians(MathHelper.Lerp(0f, death ? 360f : 270f, 1f - lifeRatio)); + float randomRadialOffset = Main.rand.NextFloat(MathHelper.ToRadians(MathHelper.Lerp(0f, death ? 360f : 270f, 1f - lifeRatio))); float radians = MathHelper.TwoPi / totalProjectiles + randomRadialOffset; - float velocity = (death ? 10.5f : 8f) + MathHelper.Lerp(0f, 4f, 1f - lifeRatio); + float velocity = 12f + MathHelper.Lerp(0f, 4f, 1f - lifeRatio); Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { 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); + 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, HandDamage, 0f, Main.myPlayer); } } } @@ -580,7 +580,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; @@ -603,12 +603,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 @@ -620,13 +620,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); @@ -634,10 +634,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; @@ -666,12 +666,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; @@ -699,13 +699,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); @@ -714,7 +714,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 daf09376b2..5bb3ee3d51 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -27,14 +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_BossRush = 150f; 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; @@ -67,8 +71,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < DRIncreaseTime; @@ -122,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 = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - // Phase for flying at the player bool flyAtTarget = (calamityGlobalNPC.newAI[3] >= FlightPhaseGateValue && startFlightPhase) || hasSpawnDR; @@ -179,7 +175,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Total segment variable - int totalSegments = Main.getGoodWorld ? 100 : 80; + int totalSegments = CalamityWorld.LegendaryMode ? 100 : 80; // Calculate aggression based on how many broken segments there are float brokenSegmentAggressionMultiplier = 1f; @@ -219,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; @@ -237,7 +229,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speed *= brokenSegmentAggressionMultiplier; turnSpeed *= brokenSegmentAggressionMultiplier; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { segmentVelocity *= 1.2f; speed *= 1.2f; @@ -247,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 && !bossRush) - { - 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) { @@ -316,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; } @@ -349,7 +329,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (calamityGlobalNPC.newAI[0] % 30f == 0f) { - float velocity = bossRush ? 6f : death ? 5.333f : 5f; + float velocity = death ? 5.333f : 5f; int type = ProjectileID.DeathLaser; switch (calamityGlobalNPC.destroyerLaserColor) { @@ -365,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) { @@ -387,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; } } @@ -428,9 +396,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - if (calamityGlobalNPC.newAI[2] > 0f || bossRush) - calamityGlobalNPC.destroyerLaserColor = 2; - npc.SyncDestroyerLaserColor(); } @@ -504,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(); @@ -530,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; @@ -554,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; } @@ -738,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; @@ -1026,43 +970,12 @@ 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; } public static bool BuffedProbeAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool oblivionAlive = npc.ai[1] == 1f; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1073,8 +986,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (targetData.Type == NPCTargetType.Player) targetDead = Main.player[npc.target].dead; - float velocity = bossRush ? 12f : death ? 8.4f : 7.2f; - float acceleration = bossRush ? 0.1f : death ? 0.07f : 0.06f; + float velocity = death ? 8.4f : 7.2f; + float acceleration = death ? 0.07f : 0.06f; float deceleration = 1f - acceleration; if (targetDead) @@ -1104,12 +1017,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < Main.maxNPCs; i++) { - if (death && !bossRush && npc.ai[1] == 0f) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - npc.ai[1] = 1f; - } - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type) { Vector2 otherProbeDist = Main.npc[i].Center - npc.Center; @@ -1182,27 +1089,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((npc.justHit && !death) || targetDead) npc.localAI[0] = 0f; - float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : bossRush ? ProbeLaserGateValue_BossRush : ProbeLaserGateValue_Rev; + float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : ProbeLaserGateValue_Rev; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= laserGateValue) { npc.localAI[0] = 0f; 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 = oblivionAlive ? 2 : death ? 3 : 1; + int totalProjectiles = death ? 3 : 1; Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; if (NPC.IsMechQueenUp) { @@ -1224,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 db6cf34ce5..a717274bf3 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(); @@ -19,8 +23,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Variables - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool deathModeSurprise = lifeRatio >= 0.9f && death; bool phase2 = lifeRatio < (death ? 0.6f : 0.7f); bool phase3 = lifeRatio < (death ? 0.3f : 0.4f); @@ -30,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 @@ -58,7 +61,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idlePhaseVelocity = 10f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { idlePhaseAcceleration *= 1.15f; idlePhaseVelocity *= 1.15f; @@ -86,7 +89,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity *= 1.13f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; int bubbleBelchPhaseTimer = death ? 60 : 80; @@ -94,7 +97,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float bubbleBelchPhaseAcceleration = death ? 0.35f : 0.3f; float bubbleBelchPhaseVelocity = death ? 5.5f : 5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { bubbleBelchPhaseAcceleration *= 1.5f; bubbleBelchPhaseVelocity *= 1.5f; @@ -106,13 +109,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int teleportPhaseTimer = 30; - int bubbleSpinPhaseTimer = bossRush ? 45 : death ? 90 : 120; + int bubbleSpinPhaseTimer = death ? 90 : 120; int bubbleSpinPhaseDivisor = death ? 3 : 4; float bubbleSpinBubbleVelocity = death ? 8f : 7f; float bubbleSpinPhaseVelocity = 20f; float bubbleSpinPhaseRotation = MathHelper.TwoPi / (bubbleSpinPhaseTimer / 2); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) bubbleSpinBubbleVelocity *= 1.5f; int spawnEffectPhaseTimer = 75; @@ -144,21 +147,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Enrage variable - bool enrage = !bossRush && + bool enrage = !BossRushEvent.BossRushActive && (player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400))); - calamityGlobalNPC.CurrentlyEnraged = !bossRush && enrage; + calamityGlobalNPC.CurrentlyEnraged = enrage; // Make him always able to take damage npc.dontTakeDamage = false; // Increased DR during phase transitions - calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? (bossRush ? 0.99f : 0.625f) : 0.15f; + calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? 0.625f : 0.15f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f; // Enrage - if (enrage || bossRush) + if (enrage) { bubbleBelchPhaseTimer = 20; bubbleBelchPhaseDivisor = 1; @@ -172,11 +175,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bubbleSpinPhaseDivisor = 1; bubbleSpinBubbleVelocity = 15f; - if (!bossRush) - { - setDamage *= 2; - npc.defense = npc.defDefense * 3; - } + npc.damage *= 2; + npc.defense = npc.defDefense * 3; } if (death) @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeTime += Main.rand.Next(5, 66); // Spawn cthulhunadoes in phase 3 - if (phase3AI && ((!phase4 && !deathModeSurprise) || Main.getGoodWorld)) + if (phase3AI && ((!phase4 && !deathModeSurprise) || CalamityWorld.LegendaryMode)) { calamityGlobalNPC.newAI[0] += 1f; float timeGateValue = 600f; @@ -228,15 +228,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses rateOfRotation = 0.01f; Vector2 rotationVector = player.Center - npc.Center; - if (!player.dead && bossRush && phase4) - { - // Rotate to show direction of predictive charge - if (npc.ai[0] == 10f) - { - rateOfRotation = 0.1f; - rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - npc.Center) * chargeVelocity; - } - } float rotationSpeed = (float)Math.Atan2(rotationVector.Y, rotationVector.X); if (npc.spriteDirection == 1) @@ -268,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 @@ -326,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); @@ -444,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; @@ -477,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); @@ -525,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); @@ -564,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); @@ -589,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); @@ -714,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; @@ -747,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); @@ -792,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); @@ -819,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) { @@ -864,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) { @@ -960,7 +918,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; // Velocity and rotation - npc.velocity = Vector2.Normalize(player.Center + (bossRush && phase4 ? player.velocity * 20f : Vector2.Zero) - npc.Center) * chargeVelocity; + npc.velocity = Vector2.Normalize(player.Center - npc.Center) * chargeVelocity; npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); // Direction @@ -998,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; @@ -1054,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 50a819dfd8..f2d3702a09 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -17,12 +17,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses private const int TotalDeathModeWorms = 4; public const float DRIncreaseTime = 600f; + // Rev+ exclusive + 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 bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Causes it to split far more in death mode if ((((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && death) || CalamityWorld.LegendaryMode) @@ -38,26 +40,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, CalamityTargetingParameters.BossDefaults); - bool enrage = true; - 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) || bossRush) - { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; - enrageScale += 0.5f; - } - if (!Main.player[npc.target].ZoneCorrupt || bossRush) - { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - // Total body segments float totalSegments = GetEaterOfWorldsSegmentsCountRevDeath(); @@ -78,7 +60,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; @@ -94,7 +76,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] -= 1f; int vileSpitGateValue = (int)MathHelper.Lerp(death ? 45f : 90f, 900f, lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) vileSpitGateValue = (int)(vileSpitGateValue * 0.5f); Vector2 vileSpitShootLocation = npc.Center + npc.velocity; @@ -111,7 +93,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; } @@ -122,13 +104,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)) @@ -151,21 +130,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); } } @@ -356,10 +323,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++) @@ -380,32 +344,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) @@ -414,7 +378,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses segmentAcceleration += (npc.justHit ? 0.16f : 0.04f); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { segmentVelocity += 4f; segmentAcceleration += 0.05f; @@ -451,7 +415,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int npcWidth = npc.width; npcWidth = (int)(npcWidth * npc.scale); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npcWidth = 62; targetDistance = (targetDistance - npcWidth) / targetDistance; @@ -542,13 +506,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses targetPosY *= timeToReachTarget; // Despawn - bool shouldDespawn = npc.type == NPCID.EaterofWorldsHead && Main.player[npc.target].dead; - if (shouldDespawn && !bossRush) + 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; @@ -569,13 +533,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; @@ -654,7 +618,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) @@ -706,38 +670,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) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index 96ddd8c381..b4672ca23f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -12,13 +12,33 @@ 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(); // Difficulty bools. - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Rotation npc.rotation = npc.velocity.X * 0.005f; @@ -34,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; @@ -44,9 +69,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.life == npc.lifeMax && dayTimeEnrage && !npc.AI_120_HallowBoss_IsGenuinelyEnraged()) npc.ai[3] += 2f; - npc.Calamity().CurrentlyEnraged = !bossRush && dayTimeEnrage; - - int projectileDamageMultiplier = dayTimeEnrage ? 2 : 1; + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && dayTimeEnrage; Vector2 rainbowStreakDistance = new Vector2(-250f, -350f); Vector2 everlastingRainbowDistance = new Vector2(0f, -450f); @@ -73,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) lessTimeSpentPerPhaseMultiplier *= 0.2f; float extraPhaseTime; @@ -151,7 +174,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; float idleTimer = phase2 ? (death ? 10f : 15f) : (death ? 20f : 30f); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) idleTimer *= 0.5f; if (idleTimer < 10f) idleTimer = 10f; @@ -354,7 +377,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); NPCAimedTarget targetData5 = npc.GetTargetData(); bool despawnFlag = false; - if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !bossRush) + if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !BossRushEvent.BossRushActive) { if (!Main.dayTime) despawnFlag = true; @@ -406,7 +429,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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()); @@ -540,7 +563,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) @@ -620,9 +643,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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); @@ -676,7 +699,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; // Increase durability. - calamityGlobalNPC.DR = shouldBeInPhase2ButIsStillInPhase1 ? 0.99f : (bossRush ? 0.99f : 0.575f); + calamityGlobalNPC.DR = shouldBeInPhase2ButIsStillInPhase1 ? 0.99f : 0.575f; int totalSunDances = phase2 ? 2 : 3; float sunDanceGateValue = dayTimeEnrage ? 35f : death ? 40f : 50f; @@ -693,7 +716,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; @@ -813,7 +836,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) { @@ -895,7 +918,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()); @@ -936,7 +959,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 { @@ -1065,7 +1089,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) @@ -1142,7 +1166,7 @@ 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) @@ -1211,7 +1235,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shouldDespawn = false; if (!trueDespawnFlag) { - if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !bossRush) + if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !BossRushEvent.BossRushActive) { if (!Main.dayTime) shouldDespawn = true; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index 81121e90df..d948eacfd0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -14,6 +14,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { private const float ProjectileOffset = 50f; + // Vanilla values + public static float Phase2ContactDamageMult = 1.2f; // 36 + public static float Phase3ContactDamageMult = 1.333f; // 40 + public static int BloodShotDamage = 8; // 32 + public static bool BuffedEyeofCthulhuAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -23,8 +28,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Phases float phase2LifeRatio = death ? 0.75f : 0.6f; @@ -42,14 +46,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Servant and projectile velocity, the projectile velocity is multiplied by 2 float servantAndProjectileVelocity = death ? 10f : 6f; - - float enrageScale = bossRush ? 2.25f : death ? 0.5f : 0f; - if (Main.IsItDay()) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - npc.reflectsProjectiles = false; // Get a target @@ -118,33 +114,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { hoverSpeed += 3f; hoverAcceleration += 0.08f; @@ -173,7 +159,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; float servantSpawnGateValue = death ? 10f : 40f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) servantSpawnGateValue *= 0.8f; if (npc.ai[3] >= servantSpawnGateValue && shootProjectile) @@ -192,7 +178,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) @@ -201,8 +187,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; } } @@ -217,16 +202,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed += 4f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -236,11 +217,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeDelay -= 30; float slowDownGateValue = chargeDelay * (death ? 0.85f : 0.65f); @@ -248,15 +226,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.velocity *= 0.99f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) @@ -276,9 +251,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; } @@ -289,9 +261,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; @@ -304,10 +273,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.reflectsProjectiles = true; if (npc.ai[0] == 1f) @@ -326,28 +292,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation += npc.ai[2]; float phaseChangeRate = death ? 2f : 1f; - float servantSpawnGateValue = Main.getGoodWorld ? 4f : 20f; + float servantSpawnGateValue = CalamityWorld.LegendaryMode ? 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) servantSpawnVelocity *= 3f; Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset; if (Main.netMode != NetmodeID.MultiplayerClient) { - int spawnType = NPCID.ServantofCthulhu; - if (death) - { - int maxBloodServants = 2; - bool spawnBloodServant = NPC.CountNPCS(ModContent.NPCType()) < maxBloodServants; - if (spawnBloodServant) - spawnType = ModContent.NPCType(); - } - - int servantSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, spawnType, 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; @@ -416,27 +373,15 @@ 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); + npc.damage = (int)Math.Round(npc.defDamage * (phase3 ? Phase3ContactDamageMult : Phase2ContactDamageMult)); 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); @@ -457,7 +402,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { hoverSpeed += 1f; hoverAcceleration += 0.1f; @@ -480,14 +425,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; } } @@ -505,22 +449,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed *= 1.2f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -530,9 +468,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); @@ -540,9 +475,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; @@ -565,9 +497,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); @@ -581,9 +510,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; @@ -591,12 +517,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; @@ -662,9 +584,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); @@ -676,9 +595,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; @@ -699,9 +615,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; } @@ -712,14 +625,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)); @@ -730,9 +640,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; @@ -759,39 +666,22 @@ 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; - int spawnType = NPCID.ServantofCthulhu; - bool spawnServant = false; - float enrageScaleToPass = enrageScale; - if (death) - { - int maxBloodServants = 2; - bool spawnBloodServant = NPC.CountNPCS(ModContent.NPCType()) < maxBloodServants; - if (spawnBloodServant) - { - spawnType = ModContent.NPCType(); - spawnServant = true; - enrageScaleToPass += 0.5f; - } - else - { - int maxServants = death ? 1 : 2; - spawnServant = (penultimatePhaseDeath || finalPhaseRev) ? false : NPC.CountNPCS(NPCID.ServantofCthulhu) < maxServants; - } - } - else - { - int maxServants = death ? (finalPhaseDeath ? 1 : penultimatePhaseDeath ? 2 : 3) : (finalPhaseRev ? 2 : 4); - spawnServant = NPC.CountNPCS(NPCID.ServantofCthulhu) < maxServants; - } + int maxServants = death ? (finalPhaseDeath ? 1 : penultimatePhaseDeath ? 2 : 3) : (finalPhaseRev ? 2 : 4); + bool spawnServant = NPC.CountNPCS(NPCID.ServantofCthulhu) < maxServants; if (spawnServant) + { SoundEngine.PlaySound(SoundID.NPCDeath13, servantSpawnCenter); + for (int m = 0; m < 10; m++) + Dust.NewDust(servantSpawnCenter, 20, 20, DustID.Blood, servantSpawnVelocity.X * 0.4f, servantSpawnVelocity.Y * 0.4f, 0, default, 1f); + } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (spawnServant) { - int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, spawnType, 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; @@ -801,8 +691,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (!CalamityWorld.LegendaryMode) { 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; } @@ -821,12 +710,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } } - - if (spawnServant) - { - for (int m = 0; m < 10; m++) - Dust.NewDust(servantSpawnCenter, 20, 20, DustID.Blood, servantSpawnVelocity.X * 0.4f, servantSpawnVelocity.Y * 0.4f, 0, default, 1f); - } } float requiredDistanceForHorizontalCharge = 160f; @@ -871,14 +754,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; @@ -888,9 +767,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); @@ -902,9 +778,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; @@ -917,8 +790,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 b7bc32aaa0..bbbacdbfe6 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(); @@ -22,8 +29,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Phases - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.5f; bool phase4 = lifeRatio < 0.25f; @@ -32,13 +38,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; - int numFists = death ? 2 : 1; - for (int i = 0; i < numFists; i++) - { - float fistPunchTimeOffset = i * 30f; - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft, 0, 0f, fistPunchTimeOffset); - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight, 0, 0f, fistPunchTimeOffset); - } + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft, 0); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight, 0); NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 3, (int)npc.Center.Y - 57, NPCID.GolemHead); } @@ -51,8 +52,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Enrage if the target isn't inside the temple - // Turbo enrage if target isn't inside the temple and it's Boss Rush or For the Worthy - bool enrage = true; + // Turbo enrage if target isn't inside the temple and it's For the Worthy + bool enrage = !BossRushEvent.BossRushActive; bool turboEnrage = false; if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) { @@ -63,15 +64,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrage = true; - npc.Calamity().CurrentlyEnraged = !bossRush && (enrage || turboEnrage); + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && (enrage || turboEnrage); bool reduceFallSpeed = npc.velocity.Y > 0f && Collision.SolidCollision(npc.position + Vector2.UnitY * 1.1f * npc.velocity.Y, npc.width, npc.height); @@ -91,14 +92,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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); - // Distance required for despawning int despawnDistance = turboEnrage ? 7500 : enrage ? 6000 : 4500; // Deactivate torches - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.velocity.Y > 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.velocity.Y > 0f) { for (int j = (int)(npc.position.X / 16f); (float)j < (npc.position.X + (float)npc.width) / 16f; j++) { @@ -115,7 +113,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Spawn arm dust - if (!Main.getGoodWorld) + if (!CalamityWorld.LegendaryMode) { if (!leftFistAlive) { @@ -177,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 && Main.getGoodWorld) - 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 && Main.getGoodWorld) - Main.projectile[bodyLaser].extraUpdates += 1; - } - } - - if (npc.localAI[1] >= 15f) - npc.localAI[1] = 0f; - } - // Delay before jumping if (npc.ai[2] == 0f) { @@ -230,8 +184,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] > 0f) { - npc.ai[1] += (death ? 2f : 1f); - if (Main.getGoodWorld) + npc.ai[1] += death ? 1.5f : 1f; + if (CalamityWorld.LegendaryMode) npc.ai[1] += 100f; if (enrage || death) @@ -244,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; @@ -262,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; @@ -432,7 +251,7 @@ 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; + float multiplier = turboEnrage ? 0.00275f : enrage ? 0.0025f : 0.00175f; if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode)) speedMult += distanceBelowTarget * multiplier; @@ -441,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 || CalamityWorld.LegendaryMode) ? -15.5f : -11.75f) + (enrage ? -4f : 0f)) * speedMult; else npc.velocity.Y = 1f; @@ -453,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 || 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; + } } } @@ -518,29 +391,29 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.dust[fiery2].velocity.X *= 2f; } - float projectileVelocity = death ? 11.25f : 7.5f; + float projectileVelocity = death ? 7.5f : 4.75f; if (enrage) projectileVelocity *= 1.5f; if (turboEnrage) 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 && Main.getGoodWorld) ? 11 : death ? 25 : 35; + int totalIterations = (turboEnrage && CalamityWorld.LegendaryMode) ? 11 : death ? 40 : 60; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < totalIterations; i++) { - // Spawn projectiles 0, 1, 2, 22, 23, and 24 (in non-master) + // Spawn projectiles 0, 1, 2, 22, 23, and 24 if (i < totalFireballsPerSide || i >= totalIterations - totalFireballsPerSide) { 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 && Main.getGoodWorld) + Main.projectile[proj].timeLeft = enrage ? 480 : 150; // The difference is meant to be this stark. + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[proj].extraUpdates += 1; } } @@ -554,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 && Main.getGoodWorld) - 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 ? (Main.getGoodWorld ? 1.15f : 0.85f) : enrage ? 0.75f : (!leftFistAlive && !rightFistAlive) ? 0.45f : 0.3f; - float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? (Main.getGoodWorld ? 40f : 30f) : enrage ? 25f : (!leftFistAlive && !rightFistAlive) ? 15f : 10f; + 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; if (isSlamming && !reduceFallSpeed) { gravity *= 4f; @@ -699,14 +530,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC golem = Main.npc[NPC.golemBoss]; Player player = Main.player[npc.target]; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Enrage if the target isn't inside the temple - // Turbo enrage if target isn't inside the temple and it's Boss Rush or For the Worthy - bool enrage = true; + // Turbo enrage if target isn't inside the temple and it's For the Worthy + bool enrage = !BossRushEvent.BossRushActive; bool turboEnrage = false; - if (player.Center.Y > Main.worldSurface * 16.0) + if (player.Center.Y > Main.worldSurface * 16.0 && !BossRushEvent.BossRushActive) { int targetTilePosX = (int)player.Center.X / 16; int targetTilePosY = (int)player.Center.Y / 16; @@ -715,15 +545,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrage = true; - float aggression = turboEnrage ? (Main.getGoodWorld ? 4f : 3f) : enrage ? 2f : death ? 1.7f : 1f; + float aggression = turboEnrage ? (CalamityWorld.LegendaryMode ? 4f : 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; @@ -805,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) dust.noLight = true; dust.noGravity = true; @@ -846,7 +676,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) { for (int j = (int)(npc.position.X / 16f) - 1; (float)j < (npc.position.X + (float)npc.width) / 16f + 1f; j++) { @@ -891,54 +721,20 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } float maxPunchDistance = 700f; - int explosionLimit = 2; if (death) { if (npc.life < npc.lifeMax / 2) - { maxPunchDistance += MathHelper.Lerp(-175f, 75f, Main.rand.NextFloat()); - explosionLimit++; - } if (npc.life < npc.lifeMax / 4) - { maxPunchDistance += MathHelper.Lerp(-175f, 75f, Main.rand.NextFloat()); - explosionLimit++; - } } if (distanceFromRestPosition > maxPunchDistance || npc.collideX || npc.collideY) { // Avoid cheap bullshit npc.damage = 0; - npc.noTileCollide = true; npc.ai[0] = 0f; - - if (death) - { - int type = ProjectileID.InfernoHostileBlast; - bool shootExplosion = true; - int numExplosions = 0; - for (int i = 0; i < Main.maxProjectiles; i++) - { - if (Main.projectile[i].active && Main.projectile[i].type == type) - { - numExplosions++; - if (numExplosions >= explosionLimit) - { - shootExplosion = false; - break; - } - } - } - - if (shootExplosion) - { - int damage = npc.GetProjectileDamage(type); - if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f, 1f); - } - } } } else @@ -1019,8 +815,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Count body parts bool leftFistAlive = NPC.AnyNPCs(NPCID.GolemFistLeft); @@ -1029,11 +824,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // 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 = true; + bool enrage = !BossRushEvent.BossRushActive; bool turboEnrage = false; - if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) + if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0 && !BossRushEvent.BossRushActive) { int targetTilePosX = (int)Main.player[npc.target].Center.X / 16; int targetTilePosY = (int)Main.player[npc.target].Center.Y / 16; @@ -1042,12 +838,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrage = true; // Alpha @@ -1086,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); @@ -1115,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 @@ -1138,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; @@ -1162,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) { @@ -1188,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 && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[bodyLaser].extraUpdates += 1; npc.netUpdate = true; @@ -1217,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 && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[extraLasers].extraUpdates += 1; npc.netUpdate = true; @@ -1226,13 +1034,63 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Special laser spread attack + else if (npc.ai[0] == 2f || npc.ai[0] == 3f) + { + 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 && CalamityWorld.LegendaryMode) + 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; + } + } + // Laser fire if arms are dead if ((!leftFistAlive && !rightFistAlive) || death || CalamityWorld.LegendaryMode) { - npc.ai[0] = 1f; - return false; + if (npc.ai[0] <= 1f) + npc.ai[0] = 1f; } - npc.ai[0] = 0f; + else + npc.ai[0] = 0f; return false; } @@ -1253,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(); @@ -1264,20 +1118,18 @@ 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 bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - 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 death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool phase2 = golemLifeRatio < 0.66f; + bool phase3 = golemLifeRatio < 0.33f; // Enrage if the target isn't inside the temple - bool enrage = true; + bool enrage = !BossRushEvent.BossRushActive; bool turboEnrage = false; - if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) + if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0 && !BossRushEvent.BossRushActive) { int targetTilePosX = (int)Main.player[npc.target].Center.X / 16; int targetTilePosY = (int)Main.player[npc.target].Center.Y / 16; @@ -1286,106 +1138,100 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) 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]; @@ -1393,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 && CalamityWorld.LegendaryMode) + 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 && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[freeHeadLaser].extraUpdates += 1; } } - if (!Main.getGoodWorld) + if (!CalamityWorld.LegendaryMode) { 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 b3fa63a8d6..83b4b1c189 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,14 +30,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool teleported = false; npc.aiAction = 0; float teleportScaleSpeed = 2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { teleportScaleSpeed -= 1f - lifeRatio; teleportScale *= teleportScaleSpeed; } - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Phases based on life percentage @@ -75,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; } @@ -241,7 +243,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Faster fall if (npc.velocity.Y > 0f) { - float fallSpeedBonus = (bossRush ? 0.2f : death ? 0.15f : 0f) + (!redCrystalAlive ? 0.1f : 0f); + float fallSpeedBonus = (death ? 0.15f : 0f) + (!redCrystalAlive ? 0.1f : 0f); npc.velocity.Y += fallSpeedBonus; } @@ -317,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 60f) @@ -399,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 30f && Main.netMode != NetmodeID.MultiplayerClient) @@ -441,7 +443,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!teleporting) { - npc.ai[0] += (bossRush ? 15f : MathHelper.Lerp(1f, 8f, 1f - lifeRatio)); + npc.ai[0] += MathHelper.Lerp(1f, 8f, 1f - lifeRatio); if (npc.ai[0] >= 0f) { // Set damage @@ -463,8 +465,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (deathModeRapidHops) npc.ai[1] = 2f; - float bossRushJumpSpeedMult = 1.5f; - // Jump type if (npc.ai[1] == 3f) { @@ -500,9 +500,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) npc.velocity.X *= 1.4f; - if (bossRush) - npc.velocity.X *= bossRushJumpSpeedMult; - npc.noTileCollide = true; } else if (npc.ai[0] >= -30f) @@ -516,20 +513,20 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float jumpVelocityLimit = redCrystalAlive ? 3f : 4.5f; if (death) jumpVelocityLimit += 3f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) jumpVelocityLimit = 8f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocityLimit) || (npc.direction == -1 && npc.velocity.X > -jumpVelocityLimit)) { if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) { - npc.velocity.X += (bossRush ? 0.4f : death ? 0.25f : 0.2f) * npc.direction; + npc.velocity.X += (death ? 0.25f : 0.2f) * npc.direction; if (death) npc.velocity.X += 0.3f * npc.direction; } else { - npc.velocity.X *= bossRush ? 0.9f : death ? 0.92f : 0.93f; + npc.velocity.X *= death ? 0.92f : 0.93f; if (death) npc.velocity.X *= 0.9f; } @@ -554,12 +551,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; // Adjust size based on HP - float maxScale = death ? (Main.getGoodWorld ? 6f : 2.5f) : (Main.getGoodWorld ? 3f : 1.5f); + float maxScale = CalamityWorld.LegendaryMode ? 3f : death ? 2.5f : 1.5f; float minScale = death ? 0.5f : 0.75f; float maxScaledValue = maxScale - minScale; // Inversed scale in FTW - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) lifeRatio = (maxScaledValue - lifeRatio * maxScaledValue) + minScale; else lifeRatio = lifeRatio * maxScaledValue + minScale; @@ -620,7 +617,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - if (((Main.raining && Main.hardMode) || bossRush) && Main.rand.NextBool(50)) + if ((Main.raining && Main.hardMode) && Main.rand.NextBool(50)) npcType = NPCID.RainbowSlime; if (death) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs index 15a895165c..3d1f562c38 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs @@ -17,12 +17,25 @@ 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(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; int aggressionLevel = 4; if (npc.type == NPCID.MoonLordCore || npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) @@ -45,10 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (bossRush) - aggressionLevel = 5; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) aggressionLevel = 6; if (npc.type == NPCID.MoonLordCore) @@ -773,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; @@ -784,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; } @@ -811,7 +820,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] < 0f) { npc.localAI[1] = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && Main.remixWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && Main.remixWorld) { for (int k = 0; k < 30; k++) { @@ -933,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); } } @@ -1166,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 = bossRush ? 1 : aggressionLevel; } } else @@ -1291,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; } @@ -1533,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); } } @@ -1779,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) { @@ -1866,7 +1868,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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); } } } @@ -1922,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; } @@ -2001,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; } } @@ -2074,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 d6af968e23..838fd80a88 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -27,12 +27,27 @@ 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(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -51,16 +66,14 @@ 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 = bossRush; + bool enrage = false; bool despawn = false; // Check for Jungle - bool surface = !bossRush && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; + bool surface = !BossRushEvent.BossRushActive && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; // Tentacle limits int maxTentaclesAfterFirstTentaclePhase = death ? 4 : 2; @@ -121,22 +134,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses hookPositionY /= numHooksSpawned; // Velocity and acceleration - float velocity = bossRush ? 12f : phase4 ? 7f : phase3 ? 6.5f : phase2 ? 6f : 4f; - float acceleration = bossRush ? 0.12f : phase3 ? 0.06f : 0.04f; - float chargeLineUpVelocity = bossRush ? 20f : phase4 ? 12f : phase3 ? 10f : 8f; - float chargeLineUpAcceleration = bossRush ? 0.8f : phase4 ? 0.6f : phase3 ? 0.5f : 0.4f; - float chargeVelocity = bossRush ? 30f : phase4 ? 22f : phase3 ? 20f : 18f; - float chargeDeceleration = bossRush ? 0.85f : phase4 ? 0.92f : phase3 ? 0.95f : 0.96f; + float velocity = phase4 ? 7f : phase3 ? 6.5f : phase2 ? 6f : 4f; + float acceleration = phase3 ? 0.06f : 0.04f; + float chargeLineUpVelocity = phase4 ? 12f : phase3 ? 10f : 8f; + float chargeLineUpAcceleration = phase4 ? 0.6f : phase3 ? 0.5f : 0.4f; + float chargeVelocity = phase4 ? 22f : phase3 ? 20f : 18f; + float chargeDeceleration = phase4 ? 0.92f : phase3 ? 0.95f : 0.96f; // Enrage if target is on the surface - if (!bossRush && (surface || Main.player[npc.target].position.Y > Main.UnderworldLayer * 16)) + if (!BossRushEvent.BossRushActive && (surface || Main.player[npc.target].position.Y > Main.UnderworldLayer * 16)) { enrage = true; velocity += 8f; acceleration = 0.15f; } - npc.Calamity().CurrentlyEnraged = !bossRush && enrage; + npc.Calamity().CurrentlyEnraged = enrage; // Movement relative to the target and hook positions Vector2 npcCenterAccountingForHooks = new Vector2(hookPositionX, hookPositionY); @@ -173,7 +186,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -214,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; @@ -302,7 +315,6 @@ 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; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) @@ -321,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); } } @@ -368,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; @@ -382,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); } } @@ -391,11 +402,8 @@ 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 = bossRush ? 2f : phase4 ? 1.5f : 1f; + float timeToDecelerateDecrement = phase4 ? 1.5f : 1f; npc.ai[3] -= timeToDecelerateDecrement; if (npc.ai[3] <= StopChargeGateValue) { @@ -428,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; @@ -450,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; @@ -461,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) { @@ -503,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; @@ -523,7 +522,6 @@ 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; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) @@ -542,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); } } @@ -554,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 @@ -649,7 +644,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (enrage) npc.localAI[1] += 2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.localAI[1] += 1f; float shootProjectileGateValue = death ? 30f : 60f; @@ -679,7 +674,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shootPoisonSeed = (CalamityWorld.LegendaryMode || 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; @@ -729,7 +724,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[0] = 2f; int totalTentacles = death ? 12 : 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) totalTentacles += 6; if (CalamityWorld.LegendaryMode) totalTentacles *= 2; @@ -737,7 +732,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { foreach (NPC n in Main.ActiveNPCs) { @@ -793,8 +788,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[3] >= shootProjectileGateValue) { float projectileSpeed = 14f; - if (bossRush) - projectileSpeed += 4f; Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); @@ -806,7 +799,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) @@ -818,7 +811,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (shootPinkSeed) { type = ProjectileID.SeedPlantera; - damage = npc.GetProjectileDamage(type); + damage = PinkSeedDamage; } else type = ProjectileID.PoisonSeedPlantera; @@ -870,7 +863,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) @@ -968,7 +961,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPlanterasHookAI(NPC npc, Mod mod) { // Variables - bool enrage = BossRushEvent.BossRushActive; + bool enrage = false; bool despawn = false; bool death = CalamityWorld.death || enrage; @@ -989,7 +982,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses despawn = true; // Enrage if Plantera's target is on the surface - if (!enrage && ((Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > Main.UnderworldLayer * 16) | despawn)) + if (!enrage && !BossRushEvent.BossRushActive && ((Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > Main.UnderworldLayer * 16) | despawn)) { npc.localAI[0] -= 4f; enrage = true; @@ -1095,7 +1088,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float hookMoveDistance = (float)Math.Sqrt(hookMoveX * hookMoveX + hookMoveY * hookMoveY); if (hookMoveDistance < 12f + velocity) { - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.localAI[3] == 1f) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.localAI[3] == 1f) { npc.localAI[3] = 0f; WorldGen.SpawnPlanteraThorns(npc.Center); @@ -1106,7 +1099,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) npc.localAI[3] = 1f; hookMoveDistance = velocity / hookMoveDistance; @@ -1140,7 +1133,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { if (Main.rand.NextBool(5)) npc.reflectsProjectiles = true; @@ -1176,8 +1169,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float extendTime = 180f; if (planteraIsCharging) { - npc.damage = 0; - if (npc.localAI[0] > 0f) { npc.localAI[0] = 0f; @@ -1186,7 +1177,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(); @@ -1218,7 +1208,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deceleration *= 0.75f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) tentacleAcceleration += 4f; // Fast retraction diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 6815bf8ea1..d2cd39bd11 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(); @@ -23,10 +30,9 @@ 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, CalamityTargetingParameters.BossDefaults); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool enrage = true; + bool enrage = !BossRushEvent.BossRushActive; int targetTileX = (int)Main.player[npc.target].Center.X / 16; int targetTileY = (int)Main.player[npc.target].Center.Y / 16; @@ -36,22 +42,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxEnrageScale = 2f; float enrageScale = death ? 0.5f : 0f; - if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush) + if ((npc.position.Y / 16f) < Main.worldSurface && enrage) { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; + calamityGlobalNPC.CurrentlyEnraged = true; enrageScale += 0.5f; } - if (!Main.player[npc.target].ZoneJungle || bossRush) + if (!Main.player[npc.target].ZoneJungle && enrage) { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; + calamityGlobalNPC.CurrentlyEnraged = true; enrageScale += 0.5f; } - if (Main.getGoodWorld) - enrageScale += ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 1f : 0.5f); - - if (bossRush) - enrageScale = 2f; + if (CalamityWorld.LegendaryMode) + enrageScale += 1f; if (enrageScale > maxEnrageScale) enrageScale = maxEnrageScale; @@ -145,7 +148,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Always start in enemy spawning phase @@ -746,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; @@ -755,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; } @@ -878,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; @@ -949,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 347925e93e..c16a8274e0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -12,11 +12,16 @@ 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 - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -208,9 +213,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; npc.ai[1] += 1f; - int idleTime = bossRush ? 20 : death ? 30 : 40; + int idleTime = death ? 30 : 40; if (phase2) - idleTime = bossRush ? 40 : death ? 60 : 80; + idleTime = death ? 60 : 80; if (phase4) idleTime /= 2; @@ -272,7 +277,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = 0f; npc.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; slimeScale = MathHelper.Clamp(npc.ai[1] / teleportEndTime, 0f, 1f); slimeScale = 0.5f + slimeScale * 0.5f; if (npc.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -312,7 +317,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = 0f; npc.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; slimeScale = MathHelper.Clamp((teleportTime - npc.ai[1]) / teleportTime, 0f, 1f); slimeScale = 0.5f + slimeScale * 0.5f; @@ -328,12 +333,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) { int numGelProjectiles = 12; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numGelProjectiles = 15; float gelVelocity = death ? 20f : 16f; int type = ProjectileID.QueenSlimeGelAttack; - int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -345,7 +349,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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; } } @@ -388,7 +392,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Faster fall if (npc.velocity.Y > 0f) - npc.velocity.Y += bossRush ? 0.1f : death ? 0.05f : 0f; + npc.velocity.Y += death ? 0.05f : 0f; npc.rotation = 0f; if (npc.velocity.Y == 0f) @@ -400,7 +404,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; - float timerIncrement = bossRush ? 7f : death ? 6f : 5f; + float timerIncrement = death ? 6f : 5f; npc.ai[1] += timerIncrement; if (lifeRatio < 0.85f) npc.ai[1] += timerIncrement; @@ -428,7 +432,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 3f) { npc.velocity.Y = -13f * speedMult; - npc.velocity.X += (bossRush ? 7f : death ? 6f : 5.5f) * npc.direction; + npc.velocity.X += (death ? 6f : 5.5f) * npc.direction; npc.ai[1] = 0f; npc.ai[2] = 0f; if (npc.timeLeft > 10) @@ -442,15 +446,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 2f) { - npc.velocity.Y = -(bossRush ? 10f : death ? 8f : 6f) * speedMult; - npc.velocity.X += (bossRush ? 8.5f : death ? 7.5f : 7f) * npc.direction; + npc.velocity.Y = -(death ? 8f : 6f) * speedMult; + npc.velocity.X += (death ? 7.5f : 7f) * npc.direction; npc.ai[1] = -40f; npc.ai[2] += 1f; } else { - npc.velocity.Y = -(bossRush ? 12f : death ? 10f : 8f) * speedMult; - npc.velocity.X += (bossRush ? 7.5f : death ? 6.5f : 6f) * npc.direction; + npc.velocity.Y = -(death ? 10f : 8f) * speedMult; + npc.velocity.X += (death ? 6.5f : 6f) * npc.direction; npc.ai[1] = -40f; npc.ai[2] += 1f; } @@ -465,16 +469,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target >= Main.maxPlayers) break; - float jumpVelocity = bossRush ? 9f : death ? 7f : 4.5f; - if (Main.getGoodWorld) + float jumpVelocity = death ? 7f : 4.5f; + if (CalamityWorld.LegendaryMode) jumpVelocity = 12f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocity) || (npc.direction == -1 && npc.velocity.X > 0f - jumpVelocity)) { if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) - npc.velocity.X += (bossRush ? 1f : death ? 0.45f : 0.3f) * npc.direction; + npc.velocity.X += (death ? 0.45f : 0.3f) * npc.direction; else - npc.velocity.X *= bossRush ? 0.8f : death ? 0.85f : 0.91f; + npc.velocity.X *= death ? 0.85f : 0.91f; } if (!Main.player[npc.target].dead) @@ -512,7 +516,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase2) slamDelay = 10; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) slamDelay = 0; if (npc.velocity.Y == 0f) @@ -521,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) @@ -538,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; } @@ -549,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; @@ -557,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) @@ -567,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); } } } @@ -624,9 +626,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.velocity.Y += bossRush ? 2f : death ? 1.75f : 1.5f; - float slamVelocity = bossRush ? 15.99f : death ? 15.5f : 15f; - if (Main.getGoodWorld) + npc.velocity.Y += death ? 1.75f : 1.5f; + float slamVelocity = death ? 15.5f : 15f; + if (CalamityWorld.LegendaryMode) { npc.velocity.Y += 1f; slamVelocity = 15.99f; @@ -647,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++) { @@ -656,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); } } } @@ -701,7 +702,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.velocity = center - npc.Center; npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); - npc.velocity *= bossRush ? 30f : death ? 27.3f : 24f; + npc.velocity *= death ? 27.3f : 24f; } else npc.velocity.Y *= 0.95f; @@ -732,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numGelProjectiles = 20; 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); @@ -749,7 +749,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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; } } @@ -763,7 +763,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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; } } @@ -781,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; } } @@ -921,14 +921,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static void QueenSlime_FlyMovement(NPC npc) { // Difficulty bools - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; npc.noTileCollide = true; npc.noGravity = true; - float flyVelocity = bossRush ? 24f : death ? 21f : 16f; - float flyAcceleration = bossRush ? 0.3f : death ? 0.18f : 0.12f; + float flyVelocity = death ? 21f : 16f; + float flyAcceleration = death ? 0.18f : 0.12f; float flyDistanceY = death ? 350f : 450f; Vector2 desiredVelocity = npc.Center; @@ -1027,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; @@ -1057,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); } } } @@ -1212,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 fb166011a6..830249b332 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -18,12 +18,18 @@ 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(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -56,6 +62,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set defense npc.defense = npc.defDefense; + npc.damage = npc.defDamage; npc.reflectsProjectiles = false; @@ -139,7 +146,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Daytime enrage - if (Main.IsItDay() && !bossRush && npc.ai[1] != 3f && npc.ai[1] != 2f) + if (Main.IsItDay() && !BossRushEvent.BossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) { npc.ai[1] = 2f; SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); @@ -155,40 +162,40 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Hand variables bool handsDead = numHandsAlive == 0; - int numProj = Main.getGoodWorld ? 22 : death ? 5 : 3; - float spread = Main.getGoodWorld ? 180 : 60; - float headSpinVelocityMult = bossRush ? (phase3 ? 18f : 9f) : (phase3 ? 12f : 4.5f); + int numProj = CalamityWorld.LegendaryMode ? 22 : death ? 5 : 3; + float spread = CalamityWorld.LegendaryMode ? 180 : 60; + float headSpinVelocityMult = phase3 ? 12f : 4.5f; switch (numHandsAlive) { case 0: - numProj = Main.getGoodWorld ? 36 : death ? 9 : 7; - spread = Main.getGoodWorld ? 180 : death ? 90 : 82; - headSpinVelocityMult = bossRush ? (phase3 ? 18f : 12f) : (phase3 ? 12f : 6f); + numProj = CalamityWorld.LegendaryMode ? 36 : death ? 9 : 7; + spread = CalamityWorld.LegendaryMode ? 180 : death ? 90 : 82; + headSpinVelocityMult = phase3 ? 12f : 6f; break; case 1: - numProj = Main.getGoodWorld ? 27 : death ? 7 : 5; - spread = Main.getGoodWorld ? 150 : death ? 76 : 68; - headSpinVelocityMult = bossRush ? (phase3 ? 15f : 10f) : (phase3 ? 11.5f : 5f); + numProj = CalamityWorld.LegendaryMode ? 27 : death ? 7 : 5; + spread = CalamityWorld.LegendaryMode ? 150 : death ? 76 : 68; + headSpinVelocityMult = phase3 ? 11.5f : 5f; break; case 2: - numProj = Main.getGoodWorld ? 18 : death ? 6 : 4; - spread = Main.getGoodWorld ? 140 : death ? 70 : 62; - headSpinVelocityMult = bossRush ? (phase3 ? 13.5f : 9f) : (phase3 ? 11f : 4.5f); + numProj = CalamityWorld.LegendaryMode ? 18 : death ? 6 : 4; + spread = CalamityWorld.LegendaryMode ? 140 : death ? 70 : 62; + headSpinVelocityMult = phase3 ? 11f : 4.5f; break; case 3: - numProj = Main.getGoodWorld ? 15 : death ? 5 : 3; - spread = Main.getGoodWorld ? 130 : death ? 64 : 56; - headSpinVelocityMult = bossRush ? (phase3 ? 12f : 8f) : (phase3 ? 10.5f : 4f); + numProj = CalamityWorld.LegendaryMode ? 15 : death ? 5 : 3; + spread = CalamityWorld.LegendaryMode ? 130 : death ? 64 : 56; + headSpinVelocityMult = phase3 ? 10.5f : 4f; break; case 4: - numProj = Main.getGoodWorld ? 12 : death ? 4 : 3; - spread = Main.getGoodWorld ? 120 : 56; - headSpinVelocityMult = bossRush ? (phase3 ? 10f : 7f) : (phase3 ? 10f : 3.5f); + numProj = CalamityWorld.LegendaryMode ? 12 : death ? 4 : 3; + spread = CalamityWorld.LegendaryMode ? 120 : 56; + headSpinVelocityMult = phase3 ? 10f : 3.5f; break; } @@ -207,11 +214,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Velocity used to move Skeletron away from the target before charging float moveAwayVelocity = headSpinVelocityMult; if (!phase3) - moveAwayVelocity *= (bossRush ? 1.5f : 2f); + moveAwayVelocity *= 2f; // 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; @@ -241,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); @@ -251,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; } @@ -272,13 +278,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // If hands are dead: 7 seconds // If hands are not dead: 14 seconds // If hands are dead in phase 2: 4.7 seconds - npc.ai[3] += 1f + (((phase2 && handsDead) || bossRush || phase4) ? 0.5f : 0f) - ((handsDead || bossRush) ? 0f : 0.5f); + npc.ai[3] += 1f + (((phase2 && handsDead) || phase4) ? 0.5f : 0f) - (handsDead ? 0f : 0.5f); // Dust to show teleport int ai3 = (int)npc.ai[3]; // 0 to 30, and -60 - bool emitDust = false; - if (ai3 >= teleportGateValue && calamityGlobalNPC.newAI[2] == 0f && calamityGlobalNPC.newAI[3] == 0f) + if (npc.localAI[0] == 1f && calamityGlobalNPC.newAI[2] == 0f && calamityGlobalNPC.newAI[3] == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -312,6 +317,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Teleport location telegraph if (calamityGlobalNPC.newAI[2] != 0f && calamityGlobalNPC.newAI[3] != 0f) { for (int m = 0; m < 5; m++) @@ -322,24 +328,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (ai3 >= teleportGateValue + 90) - { - emitDust = true; - } - else if (ai3 >= teleportGateValue + 30) - { - if (Main.rand.Next(teleportGateValue + 10, ai3 + 1) >= teleportGateValue + 25) - emitDust = true; - } - - if (emitDust) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].noGravity = true; - } - // Teleport - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] >= teleportGateValue + 120 && (!(npc.ai[1] == 1f && phase3) || death)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 0f && npc.ai[1] != 1f && calamityGlobalNPC.newAI[2] != 0f && calamityGlobalNPC.newAI[3] != 0f) { // Teleport dust for (int m = 0; m < 30; m++) @@ -351,10 +341,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // New location npc.Center = new Vector2(calamityGlobalNPC.newAI[2], calamityGlobalNPC.newAI[3]); - - // Do not set velocity to zero during charge attacks - if (npc.ai[1] != 1f) - npc.velocity = Vector2.Zero; + npc.velocity = Vector2.Zero; npc.ai[3] = -60f; calamityGlobalNPC.newAI[2] = calamityGlobalNPC.newAI[3] = 0f; @@ -366,8 +353,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Skull shooting if ((handsDead || death) && npc.ai[1] == 0f && !phase4) { - float skullProjFrequency = bossRush ? 15f : phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; - if (Main.getGoodWorld) + float skullProjFrequency = phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; + if (CalamityWorld.LegendaryMode) skullProjFrequency *= 0.8f; skullProjFrequency = (float)Math.Ceiling(skullProjFrequency); @@ -379,22 +366,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Collision.CanHit(skullFiringPos, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { float skullProjSpeed = phase2 ? (5f + (death ? 3f * (1f - lifeRatio) : 0f)) : 4f; - int spread2 = bossRush ? 100 : 50; + int spread2 = 50; Vector2 skullProjDirection = new Vector2(skullProjTargetX + Main.rand.Next(-spread2, spread2 + 1) * 0.01f, skullProjTargetY + Main.rand.Next(-spread2, spread2 + 1) * 0.01f).SafeNormalize(Vector2.UnitY); skullProjDirection *= skullProjSpeed; skullProjDirection += npc.velocity; 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; } @@ -406,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) @@ -422,11 +405,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] = chargePhaseGateValue; float forcedMoveAwayTime = death ? 15f : 45f; - float canChargeDistance = phase3 ? 480f : 320f; // 20 tile distance, 30 tile distance in phase 3 + float canChargeDistance = 320f; // 20 tile distance bool hasMovedForcedDistance = npc.localAI[2] >= forcedMoveAwayTime; bool canCharge = Vector2.Distance(Main.player[npc.target].Center, npc.Center) >= canChargeDistance; bool charge = npc.ai[2] >= chargePhaseGateValue && canCharge; - bool forceCharge = npc.ai[2] > chargePhaseGateValue + 120f * chargePhaseChangeRate; + bool forceCharge = npc.ai[2] > chargePhaseGateValue + 120f; if (charge || forceCharge) { npc.localAI[2] += 1f; @@ -434,6 +417,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[1] = 1f; + npc.localAI[0] = 1f; npc.localAI[1] = chargePhaseGateValue; npc.localAI[2] = 0f; calamityGlobalNPC.newAI[1] = 0f; @@ -444,17 +428,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - float headYAcceleration = (Main.getGoodWorld ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); + float headYAcceleration = (CalamityWorld.LegendaryMode ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); float headYTopSpeed = headYAcceleration * 100f; - float headXAcceleration = (Main.getGoodWorld ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); + float headXAcceleration = (CalamityWorld.LegendaryMode ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); float headXTopSpeed = headXAcceleration * 100f; - float deceleration = Main.getGoodWorld ? 0.83f : death ? 0.86f : 0.89f; - - if (bossRush) - { - headYAcceleration *= 1.25f; - headXAcceleration *= 1.25f; - } + float deceleration = CalamityWorld.LegendaryMode ? 0.83f : death ? 0.86f : 0.89f; float moveAwayGateValue = chargePhaseGateValue - (5f + chargePhaseChangeRate); bool moveAwayBeforeCharge = npc.ai[2] >= moveAwayGateValue; @@ -462,8 +440,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (!canCharge || !hasMovedForcedDistance) { - float phase5Multiplier = 1.33f; - float maxVelocity = (npc.ai[2] - moveAwayGateValue) * (moveAwayVelocity * 0.008f); + float phase5Multiplier = 1.2f; + float maxVelocity = (npc.ai[2] - moveAwayGateValue) * (moveAwayVelocity * 0.002f); if (phase5) maxVelocity *= phase5Multiplier; @@ -474,7 +452,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses maxVelocity = maxVelocityCap; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * -maxVelocity; - npc.SyncMotionToServer(); } @@ -497,7 +474,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Force net updates every frame during this movement to avoid despawning in multiplayer // I'm doing this because npc.ai[2] changes every frame and that's used to calculate Skeletron's velocity here npc.ForceNetUpdate(); - return false; } @@ -542,10 +518,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spin charge else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { npc.reflectsProjectiles = true; if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 0f) @@ -599,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; @@ -623,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; } } @@ -646,7 +619,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float dashPhaseTime = death ? 210f : 300f; if (npc.ai[2] >= dashPhaseTime) { - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.DarkCaster) < 6) { @@ -682,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; } } @@ -719,12 +691,10 @@ 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)); - if (handsDead || bossRush) + if (handsDead) headSpinVelocityMult += velocityBoost; } @@ -737,7 +707,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headSpinVelocityMult *= baseDistanceVelocityMult; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) headSpinVelocityMult *= 1.3f; headSpinTargetDist = headSpinVelocityMult / headSpinTargetDist; @@ -752,7 +722,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] < altDashPhaseTime) { if (npc.Center.Distance(Main.player[npc.target].Center) > altDashStopDistance || npc.ai[2] == 1f + phaseChangeRateBoost) - npc.velocity = headSpinVelocity.SafeNormalize(Vector2.UnitY) * headSpinVelocityMult + npc.Center.DirectionTo(Main.player[npc.target].Center + (bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero)) * 2f; + npc.velocity = headSpinVelocity.SafeNormalize(Vector2.UnitY) * headSpinVelocityMult + npc.Center.DirectionTo(Main.player[npc.target].Center) * 2f; else npc.ai[2] = altDashPhaseTime; } @@ -795,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; @@ -830,8 +797,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -902,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 = Main.getGoodWorld ? 0.78f : death ? 0.82f : 0.86f; + float deceleration = CalamityWorld.LegendaryMode ? 0.78f : death ? 0.82f : 0.86f; if (death) { @@ -924,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; @@ -1050,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; @@ -1068,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; @@ -1079,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) { @@ -1099,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; } } @@ -1109,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; @@ -1127,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; @@ -1138,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) { @@ -1158,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 5c1d32375d..77cd83cc81 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -17,12 +17,19 @@ 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(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -42,115 +49,37 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - // Spawn second head in Master Mode - // The main head owns the Saw and the Laser in Master Mode - if (death) - { - int head = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI); - Main.npc[head].ai[0] = npc.whoAmI; - Main.npc[head].target = npc.target; - Main.npc[head].netUpdate = true; - npc.ai[0] = head; + int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeCannon, npc.whoAmI); + Main.npc[arm].ai[0] = -1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; - int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); + Main.npc[arm].ai[0] = 1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - Main.npc[arm].ai[3] = 150f; + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeVice, npc.whoAmI); + Main.npc[arm].ai[0] = -1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].ai[3] = 150f; + Main.npc[arm].netUpdate = true; - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", Main.npc[head].TypeName), 175, 75); - else if (Main.dedServ) - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", Main.npc[head].GetTypeNetName()), new Color(175, 75, 255)); - } - else - { - int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeCannon, npc.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeVice, npc.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].ai[3] = 150f; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - Main.npc[arm].ai[3] = 150f; - } + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); + Main.npc[arm].ai[0] = 1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; + Main.npc[arm].ai[3] = 150f; } npc.netUpdate = true; npc.SyncExtraAI(); } - if (death) - { - if (!Main.npc[(int)npc.ai[0]].active || Main.npc[(int)npc.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) - { - npc.life = 0; - npc.HitEffect(); - npc.active = false; - npc.netUpdate = true; - } - else - { - // Link the HP of both heads - if (npc.life > Main.npc[(int)npc.ai[0]].life) - npc.life = Main.npc[(int)npc.ai[0]].life; - - // Push away from the lead head if too close, pull closer if too far, if Mechdusa isn't real - if (!NPC.IsMechQueenUp) - { - float pushVelocity = 0.25f; - if (Vector2.Distance(npc.Center, Main.npc[(int)npc.ai[0]].Center) < 80f * npc.scale) - { - if (npc.position.X < Main.npc[(int)npc.ai[0]].position.X) - npc.velocity.X -= pushVelocity; - else - npc.velocity.X += pushVelocity; - - if (npc.position.Y < Main.npc[(int)npc.ai[0]].position.Y) - npc.velocity.Y -= pushVelocity; - else - npc.velocity.Y += pushVelocity; - } - else if (Vector2.Distance(npc.Center, Main.npc[(int)npc.ai[0]].Center) > 240f * npc.scale) - { - if (npc.position.X < Main.npc[(int)npc.ai[0]].position.X) - npc.velocity.X += pushVelocity; - else - npc.velocity.X -= pushVelocity; - - if (npc.position.Y < Main.npc[(int)npc.ai[0]].position.Y) - npc.velocity.Y += pushVelocity; - else - npc.velocity.Y -= pushVelocity; - } - } - } - } - // Check if arms are alive bool cannonAlive = false; bool laserAlive = false; @@ -180,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; @@ -200,7 +130,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Activate daytime enrage - if (Main.IsItDay() && !bossRush && npc.ai[1] != 3f && npc.ai[1] != 2f) + if (Main.IsItDay() && !BossRushEvent.BossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) { // Heal if (Main.netMode != NetmodeID.MultiplayerClient) @@ -227,40 +157,24 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; bool normalLaserRotation = npc.localAI[1] % 2f == 0f; - // Prevents cheap hits - bool canUseAttackInMaster = npc.position.Y < Main.player[npc.target].position.Y - 350f; - // 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 - bool otherHeadChargingOrSpinning = Main.npc[(int)npc.ai[0]].ai[1] == 5f || Main.npc[(int)npc.ai[0]].ai[1] == 1f; - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || death) + if (phase2 || CalamityWorld.LegendaryMode || allArmsDead) { // Start spin phase after 1.5 seconds npc.ai[2] += phase3 ? 1.5f : 1f; - if (npc.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !death || phase3) && (canUseAttackInMaster || !death)) + if (npc.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f))) { bool shouldSpinAround = npc.ai[1] == 4f && npc.position.Y < Main.player[npc.target].position.Y - 320f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 600f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 400f; - bool shouldCharge = death && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; - if (shouldCharge) - { - npc.ai[2] = 0f; - npc.ai[1] = 1f; - CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); - npc.netUpdate = true; - } - else if (shouldSpinAround || npc.ai[1] != 4f) + if (shouldSpinAround || npc.ai[1] != 4f) { if (shouldSpinAround) { @@ -281,7 +195,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.rotation = npc.velocity.X / 15f; - float acceleration = bossRush ? 0.2f : (death ? (0.12f + 0.05f * (1f - lifeRatio)) : 0.1f); + float acceleration = death ? (0.12f + 0.05f * (1f - lifeRatio)) : 0.1f; float accelerationMult = 1f; if (!cannonAlive) { @@ -362,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; @@ -374,21 +288,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[0] = 0f; - int totalProjectiles = bossRush ? 24 : death ? 15 : 12; + 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; @@ -398,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; @@ -432,7 +334,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float headTargetY = Main.player[npc.target].Center.Y - headPosition.Y; float headTargetDistance = (float)Math.Sqrt(headTargetX * headTargetX + headTargetY * headTargetY); - float speed = bossRush ? 12f : death ? 8f : 6f; + float speed = death ? 8f : 6f; if (phase2) speed += 0.5f; if (phase3) @@ -531,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); @@ -577,16 +476,13 @@ 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; - float skullSpawnDivisor = bossRush ? 9f : death ? 15f - (float)Math.Round(3f * (1f - lifeRatio)) : 15f; + float skullSpawnDivisor = death ? 15f - (float)Math.Round(3f * (1f - lifeRatio)) : 15f; float totalSkulls = 12f; - int skullSpread = bossRush ? 250 : death ? 125 : 100; + int skullSpread = death ? 125 : 100; // Spin for about 3 seconds // Decreasing this number will INCREASE how fast he moves while spinning @@ -641,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; } @@ -683,13 +567,10 @@ 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 = bossRush ? 29f : death ? 25f : 18f; - float flightAcceleration = bossRush ? 1.12f : death ? 0.96f : 0.6f; + float flightVelocity = death ? 25f : 18f; + float flightAcceleration = death ? 0.96f : 0.6f; Vector2 destination = new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y - 420f); npc.SimpleFlyMovement((destination - npc.Center).SafeNormalize(Vector2.UnitY) * flightVelocity, flightAcceleration); @@ -698,8 +579,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[3] += 1f; if (Vector2.Distance(npc.Center, destination) < 80f || npc.ai[2] > 0f || npc.localAI[3] > 120f) { - float missileSpawnDivisor = death ? 10f : 12f; - float totalMissiles = death ? 12f : 10f; + float missileSpawnDivisor = 12f; + float totalMissiles = 10f; npc.ai[2] += 1f; if (npc.ai[2] % missileSpawnDivisor == 0f) { @@ -709,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; } @@ -750,8 +619,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeLaserAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -804,13 +672,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } - // Avoid cheap bullshit - npc.damage = 0; - bool normalLaserRotation = npc.localAI[1] % 2f == 0f; // Movement - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -914,26 +779,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] >= 48f) { npc.localAI[0] = 0f; - float laserSpeed = bossRush ? 5f : 4f; + 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); } } } @@ -981,21 +834,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; - int totalProjectiles = bossRush ? 32 : death ? 24 : 16; + 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; @@ -1005,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; @@ -1018,8 +859,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeCannonAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1070,9 +910,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } - // Avoid cheap bullshit - npc.damage = 0; - bool fireSlower = false; if (laserAlive) { @@ -1132,7 +969,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Movement - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!laserAlive) { @@ -1218,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; @@ -1237,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; } } @@ -1265,27 +1090,15 @@ 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; - int numProj = bossRush ? 5 : 3; - float rotation = MathHelper.ToRadians(bossRush ? 15 : 9); + int numProj = 3; + float rotation = MathHelper.ToRadians(9); 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; } } @@ -1297,8 +1110,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeViceAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1356,13 +1168,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sawAlive = true; } - // Avoid cheap bullshit - npc.damage = 0; - // Return to the head if (npc.ai[2] == 99f) { - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1452,7 +1261,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1542,10 +1351,7 @@ 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 = bossRush ? 20f : 16f; + float chargeVelocity = 16f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1568,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; @@ -1610,10 +1413,7 @@ 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 = bossRush ? 17.5f : 14f; + float chargeVelocity = 14f; if (!cannonAlive) chargeVelocity += 1f; if (!laserAlive) @@ -1636,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; @@ -1665,8 +1462,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeSawAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1720,15 +1516,9 @@ 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 = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1814,7 +1604,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1898,10 +1688,7 @@ 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 = bossRush ? 27.5f : 22f; + float chargeVelocity = 22f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1923,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; } @@ -1934,10 +1718,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (npc.ai[2] == 4f) { - // Set damage - npc.damage = npc.defDamage; - - float chargeVelocity = bossRush ? 13.5f : 11f; + float chargeVelocity = 11f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1955,7 +1736,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sawArmOtherChargeTargetX *= sawArmOtherChargeTargetDist; sawArmOtherChargeTargetY *= sawArmOtherChargeTargetDist; - float acceleration = bossRush ? 0.3f : death ? 0.125f : 0.08f; + float acceleration = death ? 0.125f : 0.08f; float deceleration = death ? 0.6f : 0.8f; if (npc.velocity.X > sawArmOtherChargeTargetX) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index d7d83bb2d8..b9c320c399 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -13,12 +13,37 @@ 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 bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -28,13 +53,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -71,21 +89,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { for (int i = 0; i < Main.maxNPCs; i++) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism || Main.npc[i].type == ModContent.NPCType()) && Main.npc[i].timeLeft - 1 > npc.timeLeft) + if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism) && Main.npc[i].timeLeft - 1 > npc.timeLeft) npc.timeLeft = Main.npc[i].timeLeft - 1; } } - // Foveanator spawn - if (death && calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient && !bossRush) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType()); - calamityGlobalNPC.newAI[0] = 1f; - npc.SyncExtraAI(); - } - - bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); - // Phase HP ratios float phase2LifeRatio = death ? 0.85f : 0.7f; float finalPhaseLifeRatio = death ? 0.4f : 0.25f; @@ -117,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) @@ -131,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) { @@ -145,7 +148,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -174,7 +177,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); float phaseGateValue = death ? (300f - phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 450f; - float laserGateValue = foveanatorAlive ? 45f : 30f; + float laserGateValue = 30f; if (NPC.IsMechQueenUp) { phaseGateValue = 900f; @@ -199,7 +202,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.ai[3] += 0.5f; } @@ -209,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); } @@ -235,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -253,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; @@ -283,8 +263,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; float totalCharges = death ? 6f : 5f; - if (foveanatorAlive) - totalCharges -= 1f; if (npc.ai[3] >= totalCharges) { @@ -318,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; @@ -348,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); } } } @@ -417,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; @@ -427,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -483,30 +441,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] >= (spazAlive ? (foveanatorAlive ? 64f : 52f) : foveanatorAlive ? 39f : 26f)) + if (npc.localAI[1] >= (spazAlive ? 52f : 26f)) { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { 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); } } } @@ -515,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -540,27 +480,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] > (spazAlive ? (foveanatorAlive ? 25f : 20f) : foveanatorAlive ? 15f : 10f)) + if (npc.localAI[1] > (spazAlive ? 20f : 10f)) { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { 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); @@ -586,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; @@ -606,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; @@ -616,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) @@ -637,7 +555,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] % 3f == 0f) { - float fireRate = spazAlive ? 13f : foveanatorAlive ? 11f : 9f; + float fireRate = spazAlive ? 13f : 9f; if (npc.ai[2] % fireRate == 0f) { SoundEngine.PlaySound(SoundID.Item33, npc.Center); @@ -645,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) @@ -667,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; @@ -702,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) { @@ -717,7 +630,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -746,8 +659,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -757,13 +669,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -805,13 +710,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { for (int i = 0; i < Main.maxNPCs; i++) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism || Main.npc[i].type == ModContent.NPCType()) && Main.npc[i].timeLeft - 1 > npc.timeLeft) + if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism) && Main.npc[i].timeLeft - 1 > npc.timeLeft) npc.timeLeft = Main.npc[i].timeLeft - 1; } } - bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); - // Phase HP ratios float phase2LifeRatio = death ? 0.85f : 0.7f; float finalPhaseLifeRatio = death ? 0.3f : 0.15f; @@ -844,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) @@ -860,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) { @@ -875,7 +773,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -920,34 +818,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.ai[3] += 0.4f; } - if (npc.ai[3] >= (foveanatorAlive ? 45f : 30f)) + if (npc.ai[3] >= 30f) { npc.ai[3] = 0f; 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); } } } @@ -956,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 (Main.getGoodWorld) + float chargeSpeed = death ? 20.4f + phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 18f; + if (CalamityWorld.LegendaryMode) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -975,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; @@ -1007,7 +880,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; - float totalCharges = foveanatorAlive ? 6f : 8f; + float totalCharges = 8f; if (death) totalCharges -= (float)Math.Round(phase1MaxChargesDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))); @@ -1041,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; @@ -1072,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; } } @@ -1145,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; @@ -1158,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; @@ -1177,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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -1216,36 +1068,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; npc.localAI[1] = 0f; - float flamethrowerSpeed = foveanatorAlive ? 5f : 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); } } } @@ -1273,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 (Main.getGoodWorld) + float chargeSpeed = (death ? 22.8f : 18f) + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + if (CalamityWorld.LegendaryMode) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1296,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); @@ -1306,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; @@ -1328,7 +1156,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; - float totalCharges = foveanatorAlive ? 4f : 5f; + float totalCharges = 5f; if (npc.ai[3] >= totalCharges) { npc.ai[1] = 0f; @@ -1343,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)) @@ -1364,14 +1189,13 @@ 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) spazmatismPhase3ChargeSpeed *= 1.2f; - Vector2 distanceVector = Main.player[npc.target].Center + (!retAlive && bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center; + Vector2 distanceVector = Main.player[npc.target].Center - npc.Center; npc.velocity = distanceVector.SafeNormalize(Vector2.UnitY) * spazmatismPhase3ChargeSpeed; if (retAlive) @@ -1397,20 +1221,8 @@ 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 + ((!retAlive && bossRush) ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; + Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; int numProj = 3; int spread = 15; float rotation = MathHelper.ToRadians(spread); @@ -1418,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); } } @@ -1430,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); @@ -1446,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; @@ -1477,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) { @@ -1492,7 +1293,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -1505,7 +1306,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; // Fire shadowflames and cursed fireballs - float fireRate = retAlive ? 30f : foveanatorAlive ? 25f : 20f; + float fireRate = retAlive ? 30f : 20f; if (npc.ai[2] % fireRate == 0f) { npc.ai[3] += 1f; @@ -1513,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 + (!retAlive && bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - 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); + 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, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 38aea8f081..70a5fb1b21 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -16,12 +16,18 @@ 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(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Despawn if (npc.position.X < 160f || npc.position.X > ((Main.maxTilesX - 10) * 16)) @@ -45,7 +51,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool phase2 = lifeRatio < 0.66f; bool phase3 = lifeRatio < 0.33f; - if (Main.getGoodWorld && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) + if (CalamityWorld.LegendaryMode && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) { if (NPC.CountNPCS(NPCID.FireImp) < 4) { @@ -88,8 +94,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; if (phase3) npc.ai[1] += 1f; - if (bossRush) - npc.ai[1] += 3f; if (CalamityWorld.LegendaryMode) npc.ai[1] += 9f; @@ -122,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; @@ -134,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); @@ -143,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); } } } @@ -252,9 +254,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float timeBeforeEnrage = death ? (150f - 130f * (1f - lifeRatio)) : 600f; float speedMult = 1f; - if (bossRush) - timeBeforeEnrage *= 0.25f; - if (calamityGlobalNPC.newAI[0] < timeBeforeEnrage) { if (distanceFromTarget > halfAverageScreenWidth) @@ -304,9 +303,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses calamityGlobalNPC.CurrentlyEnraged = distanceFromTarget > halfAverageScreenWidth || npc.ai[3] == 1f; - if (bossRush) - speedMult += 0.2f; - float deathModeVelocityBoost = 0f; if (death) { @@ -321,13 +317,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // NOTE: Max velocity is 9 in For The Worthy float velocityBoost = 4f * (1f - lifeRatio); - float velocityX = (bossRush ? 7f : death ? 3.5f : 2f) + deathModeVelocityBoost + velocityBoost; + float velocityX = (death ? 3.5f : 2f) + deathModeVelocityBoost + velocityBoost; velocityX *= speedMult; if (death) velocityX *= 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocityX *= 1.1f; velocityX += 0.1f; @@ -439,9 +435,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Range of 64 to 268 chance *= 2; - if (bossRush) - chance /= 4; - else if (death) + if (death) chance /= 2; if (chance < 2) @@ -548,8 +542,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; CalamityUtils.CalamityTargeting(npc, default); float acceleration = death ? 0.15f : 0.12f; @@ -558,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; } @@ -702,8 +695,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Avoid cheap bullshit npc.damage = 0; @@ -814,8 +806,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } Vector2 eyeLocation = npc.Center; - float predictionAmount = MathHelper.Lerp(0f, 20f, (float)Math.Sqrt(1f - lifeRatio)); - Vector2 lookAt = Main.player[npc.target].Center + (bossRush ? (Main.player[npc.target].velocity * predictionAmount) : Vector2.Zero); + Vector2 lookAt = Main.player[npc.target].Center; float eyeTargetX = lookAt.X - eyeLocation.X; float eyeTargetY = lookAt.Y - eyeLocation.Y; float wallVelocity = (float)Math.Sqrt(eyeTargetX * eyeTargetX + eyeTargetY * eyeTargetY); @@ -891,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 9b9ac80d81..16c8b29ac6 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 (Main.getGoodWorld && npc.type == NPCID.EaterofSouls) + if (CalamityWorld.LegendaryMode && npc.type == NPCID.EaterofSouls) { if (NPC.AnyNPCs(NPCID.EaterofWorldsHead)) { @@ -5433,7 +5433,7 @@ PrepareToShoot: } else { - if (Main.getGoodWorld && npc.type == NPCID.FireImp) + if (CalamityWorld.LegendaryMode && npc.type == NPCID.FireImp) { if (NPC.AnyNPCs(NPCID.WallofFlesh)) { @@ -6790,9 +6790,9 @@ PrepareToShoot: int projType = ProjectileID.SandBallFalling; - // If FTW is enabled, can fire 8 to 13 sand balls (random chance for 10x the amount) + // If Legendary is enabled, can fire 8 to 13 sand balls (random chance for 10x the amount) int projAmt = 1; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { projAmt = Main.rand.Next(8, 14); if (Main.rand.NextBool(1000) || Main.zenithWorld) 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 2fa1d38708..65231a42f7 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -99,11 +99,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,7 +119,7 @@ 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); @@ -123,9 +131,6 @@ namespace CalamityMod.NPCs.Yharon NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -201,12 +206,9 @@ namespace CalamityMod.NPCs.Yharon CalamityWorld.StopRain(); // Variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - float pie = (float)Math.PI; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; CalamityGlobalNPC.yharon = NPC.whoAmI; CalamityGlobalNPC.yharonP2 = -1; @@ -216,14 +218,14 @@ namespace CalamityMod.NPCs.Yharon // Start phase 2 or not if (startSecondAI) { - Yharon_AI2(expertMode, revenge, death, bossRush, pie, lifeRatio, calamityGlobalNPC, setDamage); + Yharon_AI2(expertMode, revenge, death, lifeRatio, calamityGlobalNPC, setDamage); return; } // Phase booleans - float phase2GateValue = revenge ? 0.9f : expertMode ? 0.85f : 0.75f; + 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.625f); + bool phase3Check = lifeRatio <= (death ? 0.8f : revenge ? 0.75f : expertMode ? 0.7f : 0.65f); bool phase4Check = lifeRatio <= ai2GateValue; bool phase1Change = NPC.ai[0] > -1f; bool phase2Change = NPC.ai[0] > 5f; @@ -255,7 +257,7 @@ namespace CalamityMod.NPCs.Yharon float reduceSpeedChargeDistance = 540f; int chargeTime = expertMode ? 40 : 45; float chargeSpeed = expertMode ? 28f : 26f; - float fastChargeVelocityMultiplier = bossRush ? 2f : 1.5f; + float fastChargeVelocityMultiplier = 1.5f; bool playFastChargeRoarSound = NPC.localAI[1] == fastChargeTelegraphTime * 0.5f; bool doFastCharge = NPC.localAI[1] > fastChargeTelegraphTime; @@ -274,8 +276,8 @@ namespace CalamityMod.NPCs.Yharon if (revenge) { - int chargeTimeDecrease = bossRush ? 6 : death ? 4 : 2; - float velocityMult = bossRush ? 1.15f : death ? 1.1f : 1.05f; + int chargeTimeDecrease = death ? 4 : 2; + float velocityMult = death ? 1.1f : 1.05f; phaseSwitchTimer -= chargeTimeDecrease; acceleration *= velocityMult; velocity *= velocityMult; @@ -284,17 +286,17 @@ namespace CalamityMod.NPCs.Yharon } float reduceSpeedFlareBombDistance = 570f; - int flareBombPhaseTimer = bossRush ? 30 : death ? 40 : 60; + int flareBombPhaseTimer = death ? 40 : 60; int flareBombSpawnDivisor = flareBombPhaseTimer / 20; - float flareBombPhaseAcceleration = bossRush ? 1f : death ? 0.92f : 0.8f; - float flareBombPhaseVelocity = bossRush ? 16f : death ? 14f : 12f; + float flareBombPhaseAcceleration = death ? 0.92f : 0.8f; + float flareBombPhaseVelocity = death ? 14f : 12f; int fireTornadoPhaseTimer = 90; int newPhaseTimer = 180; - int flareDustPhaseTimer = bossRush ? 160 : death ? 200 : 240; - int flareDustPhaseTimer2 = bossRush ? 80 : death ? 100 : 120; + int flareDustPhaseTimer = death ? 200 : 240; + int flareDustPhaseTimer2 = death ? 100 : 120; float spinTime = flareDustPhaseTimer / 2; @@ -369,12 +371,12 @@ namespace CalamityMod.NPCs.Yharon enraged = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f)); + safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f)); safeBox.Y = (int)Main.topWorld; - safeBox.Width = Main.zenithWorld ? 3000 : Main.getGoodWorld ? 2000 : bossRush ? 4000 : revenge ? 6000 : 7000; + safeBox.Width = Main.zenithWorld ? 3000 : CalamityWorld.LegendaryMode ? 2000 : revenge ? 6000 : 7000; safeBox.Height = Main.maxTilesY * 16; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : 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 : bossRush ? 2000f : 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 : CalamityWorld.LegendaryMode ? 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 @@ -396,7 +398,7 @@ namespace CalamityMod.NPCs.Yharon protectionBoost = false; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) phaseSwitchTimer /= 2; // Set DR based on protection boost (aka enrage) @@ -410,17 +412,17 @@ namespace CalamityMod.NPCs.Yharon { if (phase3Change) { - calamityGlobalNPC.DR = phase4Check ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase4Check ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4Check; } else if (phase2Change) { - calamityGlobalNPC.DR = phase3Check ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase3Check ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3Check; } else if (phase1Change) { - calamityGlobalNPC.DR = phase2Check ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase2Check ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2Check; } } @@ -443,7 +445,7 @@ namespace CalamityMod.NPCs.Yharon // Rotation float npcRotation = (float)Math.Atan2(player.Center.Y - NPC.Center.Y, player.Center.X - NPC.Center.X); if (NPC.spriteDirection == 1) - npcRotation += pie; + npcRotation += MathHelper.Pi; if (npcRotation < 0f) npcRotation += MathHelper.TwoPi; if (npcRotation > MathHelper.TwoPi) @@ -551,7 +553,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; @@ -560,12 +562,12 @@ namespace CalamityMod.NPCs.Yharon if (phaseSwitchFaceDirection != 0) { if (NPC.ai[2] == 0f && phaseSwitchFaceDirection != NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -612,7 +614,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -659,7 +661,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -676,7 +678,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -716,8 +718,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); } } @@ -727,7 +728,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -803,7 +804,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -832,7 +833,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; @@ -841,12 +842,12 @@ namespace CalamityMod.NPCs.Yharon if (playerFaceDirectionFurtherPhases != 0) { if (NPC.ai[2] == 0f && playerFaceDirectionFurtherPhases != NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -896,7 +897,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -923,7 +924,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); @@ -989,7 +990,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1007,7 +1008,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1026,7 +1027,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1060,7 +1061,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); } } @@ -1131,7 +1132,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1163,10 +1164,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); } } @@ -1199,7 +1199,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; @@ -1208,12 +1208,12 @@ namespace CalamityMod.NPCs.Yharon if (playerFaceDirectionFurtherPhases != 0) { if (NPC.ai[2] == 0f && playerFaceDirectionFurtherPhases != NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1266,7 +1266,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1293,7 +1293,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); @@ -1359,7 +1359,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1377,7 +1377,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1403,7 +1403,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1436,7 +1436,7 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { - DoFlareDustBulletHell(1, flareDustPhaseTimer, NPC.GetProjectileDamage(ModContent.ProjectileType()), 8, 12f, 3.6f, false); + DoFlareDustBulletHell(1, flareDustPhaseTimer, FlareDamage, 8, 13f, 3.6f, false); } } @@ -1510,7 +1510,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1542,10 +1542,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); } } @@ -1589,8 +1588,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); } } @@ -1600,7 +1598,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1619,16 +1617,14 @@ namespace CalamityMod.NPCs.Yharon } #region AI2 - public void Yharon_AI2(bool expertMode, bool revenge, bool death, bool bossRush, float pie, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC, int contactDamage) + public void Yharon_AI2(bool expertMode, bool revenge, bool death, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC, int contactDamage) { CalamityGlobalNPC.yharonP2 = NPC.whoAmI; - float phase2GateValue = revenge ? 0.44f : expertMode ? 0.385f : 0.275f; + float phase2GateValue = revenge ? 0.45f : expertMode ? 0.35f : 0.3f; bool phase2 = death || lifeRatio <= phase2GateValue; - float phase3GateValue = death ? 0.358f : revenge ? 0.275f : expertMode ? 0.22f : 0.138f; - bool phase3 = lifeRatio <= phase3GateValue; - float phase4GateValue = death ? 0.165f : 0.11f; - bool phase4 = lifeRatio <= phase4GateValue && revenge; + bool phase3 = lifeRatio <= (death ? 0.35f : revenge ? 0.3f : expertMode ? 0.2f : 0.15f); + bool phase4 = lifeRatio <= (death ? 0.2f : 0.15f) && revenge; if (NPC.ai[0] != 5f && NPC.ai[0] != 8f) { @@ -1732,21 +1728,21 @@ namespace CalamityMod.NPCs.Yharon { case 1: - calamityGlobalNPC.DR = phase2 ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase2 ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2; break; case 2: - calamityGlobalNPC.DR = phase3 ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase3 ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3; break; case 3: - calamityGlobalNPC.DR = phase4 ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase4 ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4; break; @@ -1754,20 +1750,20 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[0] == 9f) { - calamityGlobalNPC.DR = bossRush ? 0.99f : 0.7f; + calamityGlobalNPC.DR = 0.7f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; } } float reduceSpeedChargeDistance = 500f; float reduceSpeedFireballSpitChargeDistance = 800f; - float phaseSwitchTimer = bossRush ? 28f : expertMode ? 30f : 32f; + float phaseSwitchTimer = expertMode ? 30f : 32f; float acceleration = expertMode ? 0.92f : 0.9f; float velocity = expertMode ? 14.5f : 14f; float chargeTime = expertMode ? 32f : 35f; float chargeSpeed = expertMode ? 32f : 30f; - float fastChargeVelocityMultiplier = bossRush ? 2f : 1.5f; + float fastChargeVelocityMultiplier = 1.5f; fastChargeTelegraphTime = protectionBoost ? 60 : (100 - secondPhasePhase * 10); bool playFastChargeRoarSound = NPC.localAI[1] == fastChargeTelegraphTime * 0.5f; bool doFastChargeTelegraph = NPC.localAI[1] <= fastChargeTelegraphTime; @@ -1784,9 +1780,9 @@ namespace CalamityMod.NPCs.Yharon float splittingFireballBreathYVelocityTimer = 40f; float splittingFireballBreathPhaseTimer = splittingFireballBreathTimer + splittingFireballBreathTimer2 + splittingFireballBreathYVelocityTimer; - int spinPhaseTimer = secondPhasePhase == 4 ? (bossRush ? 80 : death ? 100 : 120) : (bossRush ? 120 : death ? 150 : 180); + int spinPhaseTimer = secondPhasePhase == 4 ? (death ? 100 : 120) : (death ? 150 : 180); int flareDustSpawnDivisor = spinPhaseTimer / 10; - int flareDustSpawnDivisor2 = spinPhaseTimer / 20 + (secondPhasePhase == 4 ? spinPhaseTimer / 60 : 0); + int flareDustSpawnDivisor2 = spinPhaseTimer / 15 + (secondPhasePhase == 4 ? spinPhaseTimer / 60 : 0); float increasedIdleTimeAfterBulletHell = (death ? 120f : 180f) + phaseSwitchTimer; bool moveSlowerAfterBulletHell = NPC.ai[1] < 0f; @@ -1799,23 +1795,23 @@ namespace CalamityMod.NPCs.Yharon chargeSpeed *= reducedMovementMultiplier; } - float flareSpawnDecelerationTimer = bossRush ? 60f : death ? 75f : 90f; + float flareSpawnDecelerationTimer = death ? 75f : 90f; int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (ai2GateValue - lifeRatio)) : 0; - float flareSpawnPhaseTimer = (bossRush ? 120f : death ? 150f : 180f) - flareSpawnPhaseTimerReduction; + float flareSpawnPhaseTimer = (death ? 150f : 180f) - flareSpawnPhaseTimerReduction; float teleportPhaseTimer = 45f; if (revenge) { - float chargeTimeDecrease = bossRush ? 6f : death ? 4f : 2f; - float velocityMult = bossRush ? 1.15f : death ? 1.1f : 1.05f; + float chargeTimeDecrease = death ? 4f : 2f; + float velocityMult = death ? 1.1f : 1.05f; acceleration *= velocityMult; velocity *= velocityMult; chargeTime -= chargeTimeDecrease; chargeSpeed *= velocityMult; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) phaseSwitchTimer *= 0.5f; if (NPC.ai[0] == 0f) @@ -1845,7 +1841,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; @@ -2004,7 +2000,7 @@ namespace CalamityMod.NPCs.Yharon float amount = 0.04f; if (NPC.spriteDirection == -1) - newRotation += pie; + newRotation += MathHelper.Pi; if (amount != 0f) NPC.rotation = NPC.rotation.AngleTowards(newRotation, amount); @@ -2024,19 +2020,13 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { - if (CalamityWorld.LegendaryMode && revenge) - { - if (!NPC.AnyNPCs(ModContent.NPCType())) - NPC.SpawnOnPlayer(NPC.FindClosestPlayer(), ModContent.NPCType()); - } - float bulletHellTeleportLocationDistance = 540f; Vector2 teleportLocation = -Vector2.UnitY * bulletHellTeleportLocationDistance * (targetData.velocity.Y >= 0f).ToDirectionInt(); Vector2 center = targetData.Center + teleportLocation; 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); @@ -2067,7 +2057,7 @@ namespace CalamityMod.NPCs.Yharon float amount = 0.04f; if (NPC.spriteDirection == -1) - newRotation += pie; + newRotation += MathHelper.Pi; if (amount != 0f) NPC.rotation = NPC.rotation.AngleTowards(newRotation, amount); @@ -2144,7 +2134,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * chargeSpeed; @@ -2176,7 +2166,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * chargeSpeed * fastChargeVelocityMultiplier; @@ -2195,7 +2185,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == 1f) SoundEngine.PlaySound(ShortRoarSound, NPC.Center); - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[1] += 1f; if (NPC.ai[1] >= chargeTime) @@ -2243,7 +2233,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * fireballBreathPhaseVelocity; @@ -2252,6 +2242,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; @@ -2259,8 +2252,7 @@ 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) @@ -2307,7 +2299,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = yharonFireballMoveDirection.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = yharonFireballMoveDirection * splittingFireballBreathPhaseVelocity; SoundEngine.PlaySound(FireSound, NPC.Center); @@ -2322,9 +2314,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) @@ -2364,17 +2355,17 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] % flareDustSpawnDivisor2 == 0f) { int totalProjectiles = secondPhasePhase == 4 ? 12 : 10; - float projectileVelocity = secondPhasePhase == 4 ? 16f : 12f; + float projectileVelocity = secondPhasePhase == 4 ? 17f : 13f; 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); } } } @@ -2384,7 +2375,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); } } @@ -2449,7 +2440,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); } } @@ -2479,7 +2470,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == 1f) SoundEngine.PlaySound(ShortRoarSound, NPC.Center); - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[1] += 1f; if (NPC.ai[1] >= chargeTime) @@ -2544,7 +2535,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; if (NPC.ai[2] == 120f) { @@ -2603,10 +2594,10 @@ namespace CalamityMod.NPCs.Yharon case 4: rotationSpeed = 0.01f; - facingAngle = pie; + facingAngle = MathHelper.Pi; if (NPC.spriteDirection == 1) - facingAngle += pie; + facingAngle += MathHelper.Pi; break; case 6: @@ -2614,13 +2605,13 @@ namespace CalamityMod.NPCs.Yharon facingAngle = 0f; if (NPC.spriteDirection == -1) - facingAngle -= pie; + facingAngle -= MathHelper.Pi; break; } if (NPC.spriteDirection == -1) - facingAngle += pie; + facingAngle += MathHelper.Pi; if (rotationSpeed != 0f) NPC.rotation = NPC.rotation.AngleTowards(facingAngle, rotationSpeed); @@ -2628,13 +2619,13 @@ namespace CalamityMod.NPCs.Yharon #endregion #region Charge Dust - private void ChargeDust(int dustAmt, float pie) + private void ChargeDust(int dustAmt) { for (int i = 0; i < dustAmt; i++) { Vector2 dustRotate = Vector2.Normalize(NPC.velocity) * new Vector2((NPC.width + 50) / 2f, NPC.height) * 0.75f; - dustRotate = dustRotate.RotatedBy((i - (dustAmt / 2 - 1)) * (double)pie / (float)dustAmt) + NPC.Center; - Vector2 dustVel = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); + dustRotate = dustRotate.RotatedBy((i - (dustAmt / 2 - 1)) * MathHelper.Pi / (float)dustAmt) + NPC.Center; + Vector2 dustVel = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); int chargeDust = Dust.NewDust(dustRotate + dustVel, 0, 0, DustID.CopperCoin, dustVel.X * 2f, dustVel.Y * 2f, 100, default, 1.4f); Main.dust[chargeDust].noGravity = true; Main.dust[chargeDust].noLight = true; @@ -3023,7 +3014,7 @@ namespace CalamityMod.NPCs.Yharon npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedYharon, ModContent.ItemType(), desc: DropHelper.FirstKillText); } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -3058,21 +3049,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) { @@ -3089,7 +3071,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 @@ -3118,7 +3099,7 @@ namespace CalamityMod.NPCs.Yharon bool doTelegraphFlightAnimation = NPC.localAI[1] < fastChargeTelegraphTime * 0.5f || NPC.localAI[1] > fastChargeTelegraphTime - (fastChargeTelegraphTime / 6f); bool doTelegraphRoarAnimation = NPC.localAI[1] > fastChargeTelegraphTime - fastChargeTelegraphTime * 0.4f && NPC.localAI[1] < fastChargeTelegraphTime - fastChargeTelegraphTime * 0.2f; - bool phase4 = startSecondAI && lifeRatio <= ((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.165f : 0.11f) && (CalamityWorld.revenge || BossRushEvent.BossRushActive); + bool phase4 = startSecondAI && lifeRatio <= ((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.2f : 0.15f) && (CalamityWorld.revenge || BossRushEvent.BossRushActive); if (doTelegraphFlightAnimation) { NPC.frameCounter += phase4 ? 2D : 1D; 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/BaseCustomMeleeSwingProjectile.cs index 4c9237af5b..9b04edc69b 100644 --- a/Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs @@ -161,10 +161,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 +189,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 +275,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 +298,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles ProjectileID.Sets.TrailingMode[Projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; Defaults(); - - } /// /// DO NOT OVERRIDE IN MOST SITUATIONS @@ -354,7 +367,10 @@ namespace CalamityMod.Projectiles.BaseProjectiles float adust = MathHelper.ToRadians(225); if (timer < StartupTime || timer > StartupTime + swingTime) { - angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInStartup); + if (inStartup) + angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInStartup); + if (inCooldown) + angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInCooldown); if (angle.X < 0) { player.direction = 1; @@ -389,7 +405,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.Center = armCenter - (angle * OffsetDistance * (1 + (Projectile.scale - 1) * 0.75f)).RotatedBy(Projectile.spriteDirection * angle2); Projectile.rotation = angle.RotatedBy(Projectile.spriteDirection * angle2).ToRotation() + adust; AdditionalAI(); - + oldPlayerOffset = Projectile.Center - player.Center; player.itemTime = ExistsTime + 2 - timer; player.itemAnimation = ExistsTime + 2 - timer; if (timer > ExistsTime) @@ -470,6 +486,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); diff --git a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs index 5d6e660d58..cf7e6014d3 100644 --- a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs @@ -140,6 +140,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void SetStaticDefaults() { Main.projFrames[Type] = AnimationFrames; + // IMPORTANT: Setting Main.projPet disables projectile damage! If you are making a charging minion, be sure to override the MinionContactDamage hook Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index b038018e4c..f2e9d814cd 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -37,13 +37,12 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - Projectile.timeLeft = bossRush ? 45 : death ? 60 : revenge ? 68 : expertMode ? 75 : 90; - if (Main.getGoodWorld) + Projectile.timeLeft = death ? 60 : revenge ? 68 : expertMode ? 75 : 90; + if (CalamityWorld.LegendaryMode) Projectile.timeLeft /= 2; } @@ -78,14 +77,13 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Determine opacity - float telegraphTotalTime = bossRush ? 45f : death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (Main.getGoodWorld) + float telegraphTotalTime = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; + if (CalamityWorld.LegendaryMode) 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 569a7b3921..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; @@ -35,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; CooldownSlot = ImmunityCooldownID.Bosses; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 48 : timeLeft; + Projectile.timeLeft = timeLeft; } public override void SendExtraAI(BinaryWriter writer) @@ -55,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = true; int fadeInTime = 3; - Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - ((BossRushEvent.BossRushActive ? 48 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); + Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - (timeLeft - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(Projectile.Center, 0f, 0.6f * Projectile.Opacity, 0f); @@ -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); @@ -164,7 +157,7 @@ namespace CalamityMod.Projectiles.Boss } // Plasma bolts - int totalProjectiles = BossRushEvent.BossRushActive ? 6 : 4; + int totalProjectiles = 4; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 0.5f; @@ -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 6b95f59bbb..65c5918527 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -118,10 +118,9 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Light Lighting.AddLight(Projectile.Center, 0.2f, 1f, 0f); @@ -131,7 +130,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = bossRush ? 120f : death ? 160f : revenge ? 180f : expertMode ? 200f : 240f; + float stopHomingDistance = death ? 160f : revenge ? 180f : expertMode ? 200f : 240f; if (distanceFromTarget.Length() < stopHomingDistance || Projectile.ai[0] == 1f || Projectile.timeLeft < 480) { Projectile.ai[0] = 1f; @@ -144,7 +143,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = bossRush ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; + float inertia = death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -152,8 +151,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= scaleFactor; // Fly away from other rockets - float pushForce = bossRush ? 0.07f : death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; - float pushDistance = bossRush ? 120f : death ? 100f : revenge ? 90f : expertMode ? 80f : 60f; + float pushForce = death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; + float pushDistance = death ? 100f : revenge ? 90f : expertMode ? 80f : 60f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; @@ -179,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/AresDeathBeamStart.cs b/Projectiles/Boss/AresDeathBeamStart.cs index 76c213e5bf..a42cd03c9b 100644 --- a/Projectiles/Boss/AresDeathBeamStart.cs +++ b/Projectiles/Boss/AresDeathBeamStart.cs @@ -91,14 +91,13 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; Time = Main.npc[OwnerIndex].Calamity().newAI[2] - deathrayTelegraphDuration; } @@ -106,12 +105,11 @@ namespace CalamityMod.Projectiles.Boss public override void UpdateLaserMotion() { // Declare difficulty modes. - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - float angularSlowdownDivisor = bossRush ? 300f : death ? 320f : revenge ? 330f : expertMode ? 340f : 360f; + float angularSlowdownDivisor = death ? 320f : revenge ? 330f : expertMode ? 340f : 360f; float angularVelocity = MathHelper.TwoPi * Time / Lifetime / angularSlowdownDivisor; if (Main.npc[OwnerIndex].ai[3] % 2f == 0f) angularVelocity *= -1f; diff --git a/Projectiles/Boss/AresDeathBeamTelegraph.cs b/Projectiles/Boss/AresDeathBeamTelegraph.cs index 52458b6833..77e04e94a5 100644 --- a/Projectiles/Boss/AresDeathBeamTelegraph.cs +++ b/Projectiles/Boss/AresDeathBeamTelegraph.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Boss public const float deathrayTelegraphDuration_Expert = 120f; public const float deathrayTelegraphDuration_Rev = 105f; public const float deathrayTelegraphDuration_Death = 90f; - public const float deathrayTelegraphDuration_BossRush = 60f; public const float TelegraphFadeTime = 15f; public const float TelegraphWidth = 2400f; @@ -48,13 +47,12 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - Projectile.timeLeft = (int)(bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : - revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal); + Projectile.timeLeft = (int)(death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : + expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal); } public override void SendExtraAI(BinaryWriter writer) @@ -106,13 +104,12 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - float TelegraphTotalTime = bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : - revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; + float TelegraphTotalTime = death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : + expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; if (TelegraphDelay >= TelegraphTotalTime) return true; diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index e657cca25b..5bf8a352df 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 (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } @@ -72,10 +72,9 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) - MathHelper.PiOver2; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Spawn effects if (Projectile.localAI[0] == 0f) @@ -101,7 +100,7 @@ namespace CalamityMod.Projectiles.Boss // Gauss sparks if (Main.myPlayer == Projectile.owner) { - int totalProjectiles = bossRush ? 18 : 12; + int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = Projectile.velocity.Length(); @@ -112,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); } } } @@ -124,8 +123,15 @@ 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 = bossRush ? 260f : death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; + float stopHomingDistance = death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; if ((distanceFromTarget.Length() < stopHomingDistance && Projectile.ai[0] != -1f) || Projectile.ai[0] == 1f) { Projectile.ai[0] = 1f; @@ -138,7 +144,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = bossRush ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; + float inertia = death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -176,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) { @@ -201,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 dc9c8a14e0..923848fd8f 100644 --- a/Projectiles/Boss/AresPlasmaBolt.cs +++ b/Projectiles/Boss/AresPlasmaBolt.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; @@ -70,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 e1611af3ba..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; @@ -26,7 +27,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 36; Projectile.height = 36; Projectile.hostile = true; @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; CooldownSlot = ImmunityCooldownID.Bosses; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 96 : timeLeft; + Projectile.timeLeft = timeLeft; } public override void SendExtraAI(BinaryWriter writer) @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Boss } int fadeInTime = 3; - Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - ((BossRushEvent.BossRushActive ? 96 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); + Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - (timeLeft - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(Projectile.Center, 0f, 0.6f * Projectile.Opacity, 0f); @@ -126,14 +126,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.CursedInferno, 180); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); @@ -163,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss } // Plasma bolts - int totalProjectiles = BossRushEvent.BossRushActive ? 12 : 8; + int totalProjectiles = 8; // Reduce the total amount of projectiles by half if Ares Plasma Arm is shooting them and in deathray phase and not the last mech if (Projectile.ai[0] == -1f) @@ -179,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/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 4878f29a10..3c9e9676bc 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -149,12 +149,11 @@ namespace CalamityMod.Projectiles.Boss return null; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - float detachDistance = bossRush ? 1600f : death ? 1360f : revenge ? 1280f : expertMode ? 1200f : 960f; + float detachDistance = death ? 1360f : revenge ? 1280f : expertMode ? 1200f : 960f; foreach (Projectile p in Main.ActiveProjectiles) { if (p.type != Projectile.type || p.ai[0] != Identity + 1f || Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Calamity().newAI[0] == (float)AresBody.Phase.Deathrays) diff --git a/Projectiles/Boss/ArtemisLaser.cs b/Projectiles/Boss/ArtemisLaser.cs index 454670d01a..cd81ae8c20 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -106,8 +106,8 @@ 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 = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 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 99629bc81a..fc740c018b 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,17 +32,16 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 600; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } public override void AI() { // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Projectile.frameCounter++; if (Projectile.frameCounter > 4) @@ -104,8 +102,8 @@ namespace CalamityMod.Projectiles.Boss // Move away from other flames if (Projectile.ai[0] >= 60f) { - float pushForce = bossRush ? 0.07f : death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; - float pushDistance = bossRush ? 180f : death ? 150f : revenge ? 135f : expertMode ? 120f : 90f; + float pushForce = death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; + float pushDistance = death ? 150f : revenge ? 135f : expertMode ? 120f : 90f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; @@ -150,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 82f15bd2a2..2281798333 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -37,11 +37,10 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 1f) { Projectile.extraUpdates = 2; - bool bossRush = BossRushEvent.BossRushActive; - float maxVelocity = bossRush ? 3.75f : 3f; + float maxVelocity = 3f; if (Projectile.velocity.Length() < maxVelocity) { - Projectile.velocity *= bossRush ? 1.02f : 1.015f; + Projectile.velocity *= 1.015f; if (Projectile.velocity.Length() > maxVelocity) { Projectile.velocity.Normalize(); @@ -78,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/BirbAura.cs b/Projectiles/Boss/BirbAura.cs index bf325251d8..d3e0fc4f53 100644 --- a/Projectiles/Boss/BirbAura.cs +++ b/Projectiles/Boss/BirbAura.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.timeLeft = 1200; + Projectile.Calamity().DealsDefenseDamage = true; } public override void SendExtraAI(BinaryWriter writer) 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 0913198f87..59e57349d3 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -36,20 +36,8 @@ 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() { - bool bossRush = BossRushEvent.BossRushActive; - int target = Player.FindClosest(Projectile.Center, 1, 1); float targetDist; @@ -60,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity.Length() < Projectile.ai[2]) { - Projectile.velocity *= bossRush ? 1.0125f : 1.01f; + Projectile.velocity *= 1.01f; if (Projectile.velocity.Length() > Projectile.ai[2]) { Projectile.velocity.Normalize(); @@ -120,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++; } @@ -142,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 c734f9520a..36f5a082d3 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Boss // Cal Clone bullet hell projectiles accelerate after a certain time has passed if (Projectile.ai[0] == 2f && (Main.expertMode || BossRushEvent.BossRushActive) && Projectile.timeLeft < 1260) { - if (Projectile.velocity.Length() < (BossRushEvent.BossRushActive ? 12.5f : 10f)) + if (Projectile.velocity.Length() < 10f) Projectile.velocity *= 1.005f; } @@ -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 860895fc39..de5275700d 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -114,17 +114,15 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustSpawnPos = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f); // Fire brimstone darts along the laser - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (Main.npc[(int)Projectile.ai[1]].ai[1] == 210f && Projectile.owner == Main.myPlayer && Main.npc[(int)Projectile.ai[1]].ai[0] == 5) { Vector2 velocity = Projectile.velocity; velocity.Normalize(); - float distanceBetweenProjectiles = Main.zenithWorld ? 360 : bossRush ? 72f : 144f; + float distanceBetweenProjectiles = Main.zenithWorld ? 360 : 144f; 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++) @@ -134,9 +132,9 @@ 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Main.projectile[proj].extraUpdates += 1; } fireFrom += velocity * distanceBetweenProjectiles; @@ -235,7 +233,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/CrimulanSpike.cs b/Projectiles/Boss/CrimulanSpike.cs index 233db11b4a..619f104cac 100644 --- a/Projectiles/Boss/CrimulanSpike.cs +++ b/Projectiles/Boss/CrimulanSpike.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 20; Projectile.height = 20; Projectile.hostile = true; diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index ad7fa65911..498edb8a4e 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index 17076168fc..53e95b4bfe 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DesertScourgeSpit.cs b/Projectiles/Boss/DesertScourgeSpit.cs index 15b83a8c5d..8f1271c812 100644 --- a/Projectiles/Boss/DesertScourgeSpit.cs +++ b/Projectiles/Boss/DesertScourgeSpit.cs @@ -25,12 +25,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.width = 16; Projectile.height = 16; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 900 : 600; + Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 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 6be31c977f..7336ec46f6 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index dca2e08b29..830b80d8a0 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -84,10 +84,9 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; Lighting.AddLight(Projectile.Center, 0f, 0.95f, 1.15f); @@ -102,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss double deg = Projectile.ai[1]; double rad = deg * (Math.PI / 180); - double dist = bossRush ? 360D : death ? 400D : revenge ? 420D : expertMode ? 440D : 480D; + double dist = death ? 400D : revenge ? 420D : expertMode ? 440D : 480D; Projectile.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - Projectile.width / 2; Projectile.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - Projectile.height / 2; Projectile.ai[1] += 1f; diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index b1ff1dcefa..4245e1eeb9 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss // If an old velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (OldVelocity != Vector2.Zero) { - Projectile.velocity = OldVelocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.velocity = OldVelocity; OldVelocity = Vector2.Zero; Projectile.netUpdate = true; } 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/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 0d9d4a4d21..515af26689 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.hostile = true; diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 24a4917bfb..665620b277 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.scale = 1.5f; @@ -82,14 +81,14 @@ namespace CalamityMod.Projectiles.Boss float earlyTimeProjSpeed = Projectile.localAI[0] / 120f; if (earlyTimeProjSpeed > 1f) earlyTimeProjSpeed = 1f; - distance += MathHelper.Lerp(1f, 9f, earlyTimeProjSpeed); + distance += MathHelper.Lerp(1f, 11f, earlyTimeProjSpeed); if (Projectile.timeLeft < 380) { float longTimeProjSpeed = (Projectile.localAI[0] - 300f) / 240f; if (longTimeProjSpeed > 1f) longTimeProjSpeed = 1f; - distance += MathHelper.Lerp(1f, 9f, longTimeProjSpeed); + distance += MathHelper.Lerp(1f, 11f, longTimeProjSpeed); } double rad = MathHelper.ToRadians(Projectile.ai[1]); @@ -216,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/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index a2252c2bca..c6e34661ec 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.scale = 1.5f; diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index e8e1ce6b58..dcaba5ba77 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -129,12 +129,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + 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 +159,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/FoveanatorEnergyBomb.cs b/Projectiles/Boss/FoveanatorEnergyBomb.cs deleted file mode 100644 index 9928e7ce90..0000000000 --- a/Projectiles/Boss/FoveanatorEnergyBomb.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Events; -using CalamityMod.NPCs; -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.Boss -{ - public class FoveanatorEnergyBomb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Boss"; - - private const int TotalXFrames = 2; - private const int TotalYFrames = 8; - private const int ExplodeFrames = 6; - private const int ExplodeDamageStartFrame = 3; - private const int FrameTimer = 6; - - public int frameX = 0; - public int frameY = 0; - - public int CurrentFrame - { - get => frameX * TotalYFrames + frameY; - set - { - frameX = value / TotalYFrames; - frameY = value % TotalYFrames; - } - } - - private const int TimeLeft = 300; - private const int SlowDownTime = TimeLeft / 2; - private const int ExplosionDuration = FrameTimer * ExplodeFrames; - - private const float ExplodeDistance = 50f; - - public override void SetDefaults() - { - Projectile.width = 133; - Projectile.height = 142; - Projectile.hostile = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = TimeLeft; - } - - public override void AI() - { - // If moving, decelerate. - if (Projectile.velocity.Length() > 0f && Projectile.timeLeft <= SlowDownTime) - Projectile.velocity *= 0.95f; - - // Get a target and calculate distance from it. - int target = Player.FindClosest(Projectile.Center, 1, 1); - float distanceFromTarget = Projectile.Distance(Main.player[target].Center); - - // Explode when within a certain distance of the target. - if (distanceFromTarget <= ExplodeDistance && Projectile.timeLeft > ExplosionDuration) - Projectile.timeLeft = ExplosionDuration; - - bool explode = Projectile.timeLeft <= ExplosionDuration; - - // Stop immediately if explosion is triggered. - if (explode && Projectile.velocity.Length() > 0f) - Projectile.velocity = Vector2.Zero; - - // Reset the frame counter and frameY when explosion is triggered. - if (Projectile.timeLeft == ExplosionDuration) - { - Projectile.frameCounter = 0; - frameY = 0; - } - - // Explosion noise when actually exploding. - if (frameY == ExplodeDamageStartFrame && explode && Projectile.localAI[0] == 0f) - { - Projectile.localAI[0] = 1f; - SoundEngine.PlaySound(DeusMine.ExplodeSound, Projectile.Center); - } - - Projectile.frameCounter++; - if (Projectile.frameCounter % FrameTimer == 0) - { - CurrentFrame++; - - // Non-explosion uses the left side of the sheet, explosion uses the right side of the sheet. - frameX = explode ? 1 : 0; - - // Kill the projectile when the explosion animation is done. - if (explode && frameY >= ExplodeFrames) - { - if (Projectile.ai[0] > 0f) - { - if (Projectile.owner == Main.myPlayer) - { - float laserSpeed = 2f; - int type = ModContent.ProjectileType(); - int damage = (int)Math.Round(Projectile.damage * 0.85); - Vector2 laserVelocity = (Main.player[target].Center - Projectile.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; - Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 16f, laserVelocity, type, damage, 0f, Main.myPlayer); - } - } - - Projectile.Kill(); - - return; - } - } - - // Explosion has brighter light. - Color lightColor = Color.Lerp(new Color(25, 25, 128), new Color(100, 25, 128), Main.DiscoR / 255f); - float divisor = explode ? 128f : 255f; - Lighting.AddLight(Projectile.Center, lightColor.R / divisor, lightColor.G / divisor, lightColor.B / divisor); - } - - public override bool PreDraw(ref Color lightColor) => false; - - public override void PostDraw(Color lightColor) - { - if (Projectile.frameCounter < 5) - return; - - lightColor.R = (byte)(255 * Projectile.Opacity); - lightColor.G = (byte)(255 * Projectile.Opacity); - lightColor.B = (byte)(255 * Projectile.Opacity); - - Texture2D texture = TextureAssets.Projectile[Type].Value; - Vector2 position = Projectile.Center - Main.screenPosition; - Vector2 origin = texture.Size() / new Vector2(TotalXFrames, TotalYFrames) * 0.5f; - Rectangle frame = texture.Frame(TotalXFrames, TotalYFrames, frameX, frameY); - Main.EntitySpriteDraw(texture, position, frame, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None); - } - - public override bool CanHitPlayer(Player target) => Projectile.timeLeft <= ExplosionDuration && frameY >= ExplodeDamageStartFrame; - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplodeDistance, targetHitbox); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (Projectile.timeLeft <= ExplosionDuration) - target.AddBuff(BuffID.Frostburn, 180); - } - } -} diff --git a/Projectiles/Boss/FoveanatorEnergyBomb.png b/Projectiles/Boss/FoveanatorEnergyBomb.png deleted file mode 100644 index 4e2a8120cb..0000000000 Binary files a/Projectiles/Boss/FoveanatorEnergyBomb.png and /dev/null differ diff --git a/Projectiles/Boss/FoveanatorFlamethrower.cs b/Projectiles/Boss/FoveanatorFlamethrower.cs deleted file mode 100644 index 6583bef428..0000000000 --- a/Projectiles/Boss/FoveanatorFlamethrower.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class FoveanatorFlamethrower : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Boss"; - public override string Texture => "CalamityMod/Projectiles/FireProj"; - - public static int Lifetime => 180; - public static int Fadetime => 160; - public ref float Time => ref Projectile.ai[0]; - public int MistType = -1; - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 10; - Projectile.hostile = true; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.MaxUpdates = 3; - Projectile.timeLeft = Lifetime; - CooldownSlot = ImmunityCooldownID.Bosses; - } - - public override void AI() - { - Time++; - if (Time < Fadetime && Main.rand.NextBool(6)) - { - Vector2 cinderPos = Projectile.Center + Main.rand.NextVector2Circular(60f, 60f) * Utils.Remap(Time, 0f, Lifetime, 0.5f, 1f); - float cinderSize = Utils.GetLerpValue(6f, 12f, Time, true); - Dust cinder = Dust.NewDustDirect(cinderPos, 4, 4, Main.rand.NextBool() ? (int)CalamityDusts.BlueCosmilite : (int)CalamityDusts.PurpleCosmilite, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f); - if (Main.rand.NextBool(3)) - { - cinder.scale *= 2f; - cinder.velocity *= 2f; - } - cinder.noGravity = true; - cinder.scale *= cinderSize * 1.2f; - cinder.velocity += Projectile.velocity * Utils.Remap(Time, 0f, Fadetime * 0.75f, 1f, 0.1f) * Utils.Remap(Time, 0f, Fadetime * 0.1f, 0.1f, 1f); - } - - if (MistType == -1) - MistType = Main.rand.Next(3); - - Color lightColor = Color.Lerp(new Color(50, 50, 255), new Color(200, 50, 255), Main.DiscoR / 255f); - Lighting.AddLight(Projectile.Center, lightColor.R / 255f, lightColor.G / 255f, lightColor.B / 255f); - } - - // Keeping the flames in place when hitting a block - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.velocity = oldVelocity * 0.95f; - Projectile.position -= Projectile.velocity; - Time++; - Projectile.timeLeft--; - return false; - } - - // Cannot hit the player if fading out - public override bool CanHitPlayer(Player target) => Time <= Fadetime; - - // Expanding hitbox - public override void ModifyDamageHitbox(ref Rectangle hitbox) - { - int size = (int)Utils.Remap(Time, 0f, Fadetime, 8f, 32f); - - // Shrinks again after fading - if (Time > Fadetime) - size = (int)Utils.Remap(Time, Fadetime, Lifetime, 32f, 0f); - - hitbox.Inflate(size, size); - } - - // Anti-wall hacking checks - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => projHitbox.Intersects(targetHitbox) && Collision.CanHit(Projectile.Center, 0, 0, targetHitbox.Center.ToVector2(), 0, 0) ? null : false; - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(BuffID.Frostburn, 300); - - // 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); - for (int i = 0; i < smokeCount; i++) - { - Vector2 smokePos = target.Center + Main.rand.NextVector2Circular(target.width * 0.5f, target.height * 0.5f); - Vector2 smokeVel = Vector2.UnitY * Main.rand.NextFloat(-2.4f, -0.8f) * MathHelper.Clamp(target.height * 0.1f, 1f, 10f); - Particle smoke = new MediumMistParticle(smokePos, smokeVel, Color.Lerp(new Color(50, 50, 255), new Color(200, 50, 255), Main.DiscoR / 255f), Color.DarkMagenta, Main.rand.NextFloat(1f, 2f), 245 - Main.rand.Next(50), 0.1f); - GeneralParticleHandler.SpawnParticle(smoke); - } - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; - - // The conga line of colors to sift through - Color color1 = new Color(50, 50, 255, 200); - Color color2 = new Color(50, 0, 225, 70); - Color color3 = new Color(200, 50, 255, 100); - Color color4 = new Color(150, 15, 85, 100); - float length = ((Time > Fadetime - 10f) ? 0.1f : 0.15f); - float vOffset = Math.Min(Time, 20f); - float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); - float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); - - if (timeRatio >= 1f) - return false; - - for (float j = 1f; j >= 0f; j -= length) - { - // Color - Color fireColor = ((timeRatio < 0.1f) ? Color.Lerp(Color.Transparent, color1, Utils.GetLerpValue(0f, 0.1f, timeRatio)) : - ((timeRatio < 0.2f) ? Color.Lerp(color1, color2, Utils.GetLerpValue(0.1f, 0.2f, timeRatio)) : - ((timeRatio < 0.35f) ? color2 : - ((timeRatio < 0.7f) ? Color.Lerp(color2, color3, Utils.GetLerpValue(0.35f, 0.7f, timeRatio)) : - ((timeRatio < 0.85f) ? Color.Lerp(color3, color4, Utils.GetLerpValue(0.7f, 0.85f, timeRatio)) : - Color.Lerp(color4, Color.Transparent, Utils.GetLerpValue(0.85f, 1f, timeRatio))))))); - fireColor *= (1f - j) * Utils.GetLerpValue(0f, 0.2f, timeRatio, true); - Color innerColor = Color.Lerp(fireColor, Color.Black, 0.3f); - - // Positions and rotations - Vector2 firePos = Projectile.Center - Main.screenPosition - Projectile.velocity * vOffset * j; - float mainRot = -j * MathHelper.PiOver2 - Main.GlobalTimeWrappedHourly * (j + 1f) * 2f / length; - float trailRot = MathHelper.PiOver4 - mainRot; - - // Draw one backtrail - Vector2 trailOffset = Projectile.velocity * vOffset * length * 0.5f; - Main.EntitySpriteDraw(fire, firePos - trailOffset, null, innerColor * 0.25f, trailRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the main fire - Main.EntitySpriteDraw(fire, firePos, null, innerColor, mainRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the masking smoke - Main.spriteBatch.SetBlendState(BlendState.Additive); - Rectangle frame = mist.Frame(1, 3, 0, MistType); - Main.EntitySpriteDraw(mist, firePos, frame, Color.Lerp(fireColor, Color.White, 0.3f), mainRot, frame.Size() * 0.5f, fireSize, SpriteEffects.None); - Main.EntitySpriteDraw(mist, firePos, frame, fireColor, mainRot, frame.Size() * 0.5f, fireSize * 3f, SpriteEffects.None); - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - } - - return false; - } - } -} diff --git a/Projectiles/Boss/FoveanatorLaser.cs b/Projectiles/Boss/FoveanatorLaser.cs deleted file mode 100644 index fc73073e84..0000000000 --- a/Projectiles/Boss/FoveanatorLaser.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.NPCs.TownNPCs; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class FoveanatorLaser : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Boss"; - - private const int FadeOutTime = 30; - - private const float Acceleration = 1.05f; - private const float MaxVelocity = 24f; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - ProjectileID.Sets.TrailCacheLength[Type] = 2; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 16; - Projectile.height = 16; - Projectile.hostile = true; - Projectile.ignoreWater = true; - Projectile.Opacity = 0f; - Projectile.penetrate = -1; - Projectile.timeLeft = 300; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter > 4) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 3) - Projectile.frame = 0; - - if (Projectile.velocity.Length() < MaxVelocity) - { - Projectile.velocity *= Acceleration; - if (Projectile.velocity.Length() > MaxVelocity) - { - Projectile.velocity.Normalize(); - Projectile.velocity *= MaxVelocity; - } - } - - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - - Color lightColor = Color.Lerp(new Color(25, 25, 128), new Color(100, 25, 128), Main.DiscoR / 255f); - Lighting.AddLight(Projectile.Center, lightColor.R / 255f, lightColor.G / 255f, lightColor.B / 255f); - - if (Projectile.timeLeft < FadeOutTime) - { - Projectile.Opacity -= 1f / FadeOutTime; - } - else if (Projectile.Opacity < 1f) - { - Projectile.Opacity += 0.25f; - if (Projectile.Opacity > 1f) - Projectile.Opacity = 1f; - } - } - - public override bool PreDraw(ref Color lightColor) - { - lightColor.R = (byte)(255 * Projectile.Opacity); - lightColor.G = (byte)(255 * Projectile.Opacity); - lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - - public override bool CanHitPlayer(Player target) => Projectile.timeLeft >= FadeOutTime; - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (Projectile.timeLeft >= FadeOutTime) - target.AddBuff(BuffID.Frostburn, 90); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Collision.HitTiles(Projectile.Center, Projectile.velocity, Projectile.width, Projectile.height); - SoundEngine.PlaySound(SoundID.Item10, Projectile.position); - return true; - } - } -} diff --git a/Projectiles/Boss/FoveanatorLaser.png b/Projectiles/Boss/FoveanatorLaser.png deleted file mode 100644 index 543c692773..0000000000 Binary files a/Projectiles/Boss/FoveanatorLaser.png and /dev/null differ 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 b7fa0c573f..cbceb613d7 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 900 : 600; + Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 600; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 4b2b1d3666..90d11517e0 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -1,11 +1,7 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using CalamityMod.Graphics.Primitives; -using CalamityMod.NPCs; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; -using CalamityMod.NPCs.TownNPCs; using CalamityMod.Particles; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -13,7 +9,6 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -22,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; @@ -36,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; @@ -52,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]); @@ -64,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); @@ -111,8 +114,7 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(ShootSound, Projectile.Center); } - if (Math.Abs(Projectile.velocity.X) > 0.2) - Projectile.spriteDirection = -Projectile.direction; + Projectile.direction = Projectile.spriteDirection = (Math.Abs(Projectile.velocity.X) > 0.2).ToDirectionInt(); GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(50), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, false, 20, Main.rand.NextFloat(1f, 2f), ProvUtils.GetProjectileColor(255))); GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center + new Vector2(40, 0).RotatedBy(Vector2.Zero.AngleTo(-Projectile.velocity)) + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(1f, 3f), 150f)); @@ -128,12 +130,11 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; - int framing = texture.Height / Main.projFrames[Type]; - int y6 = framing * Projectile.frame; - Vector2 sc = Vector2.One; - Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, sc, texture); + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture, effects: sp); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), sc, SpriteEffects.None, 0); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } @@ -158,7 +159,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; @@ -169,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); } } @@ -200,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 64c20b7f63..0ac7a0ce8b 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -42,9 +42,6 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); - if (Projectile.ai[0] == 0f && BossRushEvent.BossRushActive) - Projectile.velocity *= 1.25f; - if (!started) { Color cl = ProvUtils.GetProjectileColor(255); @@ -60,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 160; } - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) { diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 3385962d35..0a3936aef6 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) 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 2c3b539632..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); @@ -50,16 +50,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame > 3) Projectile.frame = 0; - float maxVelocity = Projectile.ai[0] == 0f ? 7f : BossRushEvent.BossRushActive ? 13f : CalamityWorld.death ? 11f : CalamityWorld.revenge ? 10f : Main.expertMode ? 9f : 7f; + float maxVelocity = Projectile.ai[0] == 0f ? 7f : CalamityWorld.death ? 11f : CalamityWorld.revenge ? 10f : Main.expertMode ? 9f : 7f; if (Math.Abs(Projectile.velocity.X) < maxVelocity) Projectile.velocity.X *= 1.05f; 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..f7f002d02e 100644 --- a/Projectiles/Boss/HomingGasBulbSporeGas.cs +++ b/Projectiles/Boss/HomingGasBulbSporeGas.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 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)) 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; } 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 ce60e05cb7..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,14 +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); - - if (!target.Calamity().gState) - target.AddBuff(ModContent.BuffType(), 60); - } + 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 691c909e79..a312ab8007 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -131,12 +131,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + 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 +161,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 457affed38..f23933c8f6 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) 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 9c3698fe8f..07160d9da1 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 12; Projectile.height = 12; Projectile.hostile = true; @@ -37,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); @@ -143,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/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index 61adeb46bc..19339c838f 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -76,8 +76,8 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(Projectile.Center, 0f, 0.15f, 0.3f); - float velocityYLimit = Projectile.ai[0] == 1f ? 1f : BossRushEvent.BossRushActive ? 12f : CalamityWorld.death ? 6f : 5f; - float velocityYIncrement = Projectile.ai[0] == 1f ? 0.1f : BossRushEvent.BossRushActive ? 0.24f : CalamityWorld.death ? 0.12f : 0.1f; + float velocityYLimit = Projectile.ai[0] == 1f ? 1f : CalamityWorld.death ? 6f : 5f; + float velocityYIncrement = Projectile.ai[0] == 1f ? 0.1f : CalamityWorld.death ? 0.12f : 0.1f; if (Projectile.velocity.Y < velocityYLimit) Projectile.velocity.Y += velocityYIncrement; diff --git a/Projectiles/Boss/MushBombGround.cs b/Projectiles/Boss/MushBombGround.cs index c2eacefa36..ca844bdb13 100644 --- a/Projectiles/Boss/MushBombGround.cs +++ b/Projectiles/Boss/MushBombGround.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(Projectile.Center, 0f, 0.15f, 0.3f); float xVelocityMultiplier = 1.025f; - float xVelocityLimit = BossRushEvent.BossRushActive ? 24f : 12f; + float xVelocityLimit = 12f; if (Math.Abs(Projectile.velocity.X) < xVelocityLimit) Projectile.velocity.X *= xVelocityMultiplier; } 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/PermafrostColdheartIcicle.cs b/Projectiles/Boss/PermafrostColdheartIcicle.cs index f58b5d3119..808004ddb1 100644 --- a/Projectiles/Boss/PermafrostColdheartIcicle.cs +++ b/Projectiles/Boss/PermafrostColdheartIcicle.cs @@ -163,6 +163,6 @@ namespace CalamityMod.Projectiles.Boss // Prevent the crystals from utilizing velocity. Their movement is entirely dependant on Center setting. public override bool ShouldUpdatePosition() => false; - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Frozen, 300); } } diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 8069efd309..b0083c28d1 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.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 = 18; Projectile.height = 18; Projectile.hostile = true; @@ -111,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 f581c4a065..e801a4083e 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.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 = 18; Projectile.height = 18; Projectile.hostile = true; @@ -111,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 fcadc0e03b..ace2a64f74 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 && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { 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/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index b77439580e..de4bf7114b 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.width = 160; Projectile.height = 160; Projectile.ignoreWater = true; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 1500 : CalamityWorld.death ? 2100 : 3600; + Projectile.timeLeft = CalamityWorld.death ? 2100 : 3600; Projectile.alpha = 255; Projectile.tileCollide = false; Projectile.penetrate = -1; diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index a745f81594..4f99f0d4d1 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; diff --git a/Projectiles/Boss/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/QueenBeenadeBee.cs b/Projectiles/Boss/QueenBeenadeBee.cs index 489609310c..905267966e 100644 --- a/Projectiles/Boss/QueenBeenadeBee.cs +++ b/Projectiles/Boss/QueenBeenadeBee.cs @@ -47,15 +47,14 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = Projectile.velocity.X * 0.1f; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target and calculate distance from it int target = Player.FindClosest(Projectile.Center, 1, 1); Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = bossRush ? 80f : 120f; + float stopHomingDistance = 120f; if (distanceFromTarget.Length() < stopHomingDistance || Projectile.ai[0] == 1f || Projectile.timeLeft < 120) { Projectile.ai[0] = 1f; @@ -79,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = bossRush ? 12f : 16f; + float inertia = 16f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -87,8 +86,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= scaleFactor; // Fly away from other bees - float pushForce = bossRush ? 0.06f : 0.05f; - float pushDistance = bossRush ? 90f : 60f; + float pushForce = 0.05f; + float pushDistance = 60f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index 69f81fa5da..1cb0daf453 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.extraUpdates = BossRushEvent.BossRushActive ? 2 : 1; + Projectile.extraUpdates = 1; } public override void AI() diff --git a/Projectiles/Boss/RavagerNuke.cs b/Projectiles/Boss/RavagerNuke.cs index 5b00ec67d8..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; @@ -36,8 +35,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || bossRush; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; if (Projectile.timeLeft < 180) Projectile.tileCollide = true; @@ -53,8 +51,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; - float inertia = bossRush ? 70f : revenge ? 90f : 110f; - float scaleFactor12 = bossRush ? 20f : revenge ? 16f : 12f; + float inertia = revenge ? 90f : 110f; + float scaleFactor12 = revenge ? 16f : 12f; if (Projectile.alpha > 0) Projectile.alpha -= 10; 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 81036fdca1..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++; @@ -197,16 +214,15 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(ImpactSound, Projectile.Center); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (Projectile.ai[2] == 0f) { if (Projectile.owner == Main.myPlayer) { - int totalProjectiles = bossRush ? 20 : death ? 16 : revenge ? 14 : expertMode ? 12 : 8; + int totalProjectiles = death ? 16 : revenge ? 14 : expertMode ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 8f; @@ -214,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 92d27f5bc5..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++; @@ -181,16 +195,15 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(ImpactSound, Projectile.Center); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (Projectile.ai[2] == 0f) { if (Projectile.owner == Main.myPlayer) { - int totalProjectiles = bossRush ? 44 : death ? 36 : revenge ? 32 : expertMode ? 28 : 20; + int totalProjectiles = death ? 36 : revenge ? 32 : expertMode ? 28 : 20; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 6.5f; @@ -198,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 a4e68db418..cc42d08de0 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] >= (Main.getGoodWorld ? 10f : 36f)) + if (Projectile.ai[0] >= (CalamityWorld.LegendaryMode ? 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..37da7212b3 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; diff --git a/Projectiles/Boss/SupremeCataclysmFist.cs b/Projectiles/Boss/SupremeCataclysmFist.cs index edb9e872bf..0ed0cb59ab 100644 --- a/Projectiles/Boss/SupremeCataclysmFist.cs +++ b/Projectiles/Boss/SupremeCataclysmFist.cs @@ -43,10 +43,9 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // The Orb if (Projectile.ai[2] >= 3) @@ -281,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 afa91f3d53..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; @@ -46,10 +44,9 @@ namespace CalamityMod.Projectiles.Boss Time++; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Decide frames. Projectile.frameCounter++; diff --git a/Projectiles/Boss/THanosSideLaser.cs b/Projectiles/Boss/THanosSideLaser.cs index 89b47ae15d..e17154f9d9 100644 --- a/Projectiles/Boss/THanosSideLaser.cs +++ b/Projectiles/Boss/THanosSideLaser.cs @@ -94,8 +94,8 @@ 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 = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index 1169549444..570c563721 100644 --- a/Projectiles/Boss/ThanatosBeamStart.cs +++ b/Projectiles/Boss/ThanatosBeamStart.cs @@ -107,10 +107,9 @@ namespace CalamityMod.Projectiles.Boss return; // Difficulty modes. Used during the firing of the perpendicular lasers. - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Spawn dust at the end of the beam. int dustType = (int)CalamityDusts.Brimstone; @@ -137,7 +136,7 @@ namespace CalamityMod.Projectiles.Boss } // Periodically fire beams along the laser perpendicular to its direction. - float laserFireRate = (CalamityWorld.LegendaryMode && revenge) ? 60f : expertMode ? 80f : 160f; + float laserFireRate = (CalamityWorld.LegendaryMode) ? 60f : expertMode ? 80f : 160f; if (Main.npc[OwnerIndex].Calamity().newAI[2] % laserFireRate == 0f) { // Play a laser sound to go with the beams. @@ -146,19 +145,18 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 beamDirection = Projectile.velocity.SafeNormalize(Vector2.UnitY); - float distanceBetweenProjectiles = bossRush ? 160f : death ? 256f : revenge ? 288f : 320f; + float distanceBetweenProjectiles = death ? 256f : revenge ? 288f : 320f; 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 && revenge) ? 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 = (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, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, -1f); } laserFirePosition += beamDirection * distanceBetweenProjectiles; } @@ -242,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 75739ff077..48e3353558 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 22; Projectile.height = 22; Projectile.hostile = true; @@ -98,8 +97,8 @@ 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 = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } @@ -161,8 +160,8 @@ 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 = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } @@ -240,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 c1c879d50c..f0286ca08f 100644 --- a/Projectiles/Boss/ToxicCloud.cs +++ b/Projectiles/Boss/ToxicCloud.cs @@ -36,8 +36,7 @@ namespace CalamityMod.Projectiles.Boss { Lighting.AddLight(Projectile.Center, 0.1f, 0.7f, 0f); - bool bossRush = BossRushEvent.BossRushActive; - if (Projectile.velocity.Length() < (bossRush ? 6.25f : 5f)) + if (Projectile.velocity.Length() < 5f) Projectile.velocity *= 1.01f; Projectile.ai[0] += 1f; @@ -88,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 71ac79c0a2..3db3a7a054 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -14,16 +14,15 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; Projectile.penetrate = 1; Projectile.Opacity = 0.8f; Projectile.tileCollide = false; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 640 : CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; + Projectile.timeLeft = CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } @@ -51,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss { if (Projectile.velocity.Length() < 15f && (Main.expertMode || BossRushEvent.BossRushActive)) { - float velocityMult = BossRushEvent.BossRushActive ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; + float velocityMult = CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; Projectile.velocity *= velocityMult; } } diff --git a/Projectiles/Boss/UnstableEbonianGlob.cs b/Projectiles/Boss/UnstableEbonianGlob.cs index 89b77b7a77..95ef39e3df 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -14,16 +14,15 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; Projectile.penetrate = 1; Projectile.Opacity = 0.8f; Projectile.tileCollide = false; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 780 : CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; + Projectile.timeLeft = CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } @@ -34,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity.Length() < 12f && (Main.expertMode || BossRushEvent.BossRushActive || Projectile.ai[0] == 1f)) { - float velocityMult = BossRushEvent.BossRushActive ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; + float velocityMult = CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; if (Projectile.ai[0] == 1f) velocityMult += 0.02f; diff --git a/Projectiles/Boss/YharonBulletHellVortex.cs b/Projectiles/Boss/YharonBulletHellVortex.cs index 4fde90ccdf..430144499a 100644 --- a/Projectiles/Boss/YharonBulletHellVortex.cs +++ b/Projectiles/Boss/YharonBulletHellVortex.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.alpha = 255; Projectile.timeLeft = 60000; + Projectile.Calamity().DealsDefenseDamage = true; } public override void SendExtraAI(BinaryWriter writer) @@ -62,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 && CalamityWorld.revenge) ? 10.7f : 5.35f; + float speed = CalamityWorld.LegendaryMode ? 10.7f : 5.35f; float minDist = 160f; if (victim >= 0 && Main.player[victim].active && !Main.player[victim].dead) { @@ -79,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss } // Fly away from other vortices - float pushForce = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.1f : 0.05f; + float pushForce = CalamityWorld.LegendaryMode ? 0.1f : 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 46dc6e95be..acf5cc28eb 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -14,9 +14,11 @@ using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; 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; @@ -115,7 +117,7 @@ namespace CalamityMod.Projectiles /// If true, this projectile is able to spawn lightning while using Arc Flash Ring.
/// This is set to false when lightning is procced, and is reset to true when the cooldown ends. ///
- public bool spawnArcFlash = true; + public bool showArcFlash = true; /// Cooldown variable for Arc Flash Ring's lightning. Primarily used for lingering projectiles and minions. public int arcFlashCooldown = 0; @@ -249,10 +251,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. @@ -279,7 +277,6 @@ namespace CalamityMod.Projectiles public int BloodstoneOrbValue = 0; #region On Spawn - public override void OnSpawn(Projectile projectile, IEntitySource source) { // TODO -- it would be nice to move frame one hacks here, but this runs in the middle of NewProjectile @@ -291,18 +288,50 @@ namespace CalamityMod.Projectiles if (sourceItem != null) extorterBoost = true; - if (source is EntitySource_Parent { Entity: NPC npc }) - { - if (!npc.friendly) - ParentNPCIndex = npc.whoAmI; - } - // Whenever the player has Daawnlight Spirit Origin, any ranged projectile will have the capacity to infintely supercrit. if (Main.player[projectile.owner].Calamity().spiritOrigin && projectile.CountsAsClass()) { projectile.CritChance += Main.player[projectile.owner].Calamity().spiritOriginCritBoost; projectile.Calamity().supercritHits = -1; } + + if (source is EntitySource_Parent { Entity: NPC npc }) + { + if (!npc.friendly) + ParentNPCIndex = npc.whoAmI; + } + // + // SPECIFIC PROJECTILE BALANCE CHANGES + // + else if (source is EntitySource_Parent { Entity: Projectile parent }) + { + // Nerf Crystal bullet shard damage by 45% + // Vanilla crystal shards deal 50% of the bullet's damage which is absurd, this nerfs them to 27.5% + if (parent.type == ProjectileID.CrystalBullet && projectile.type == ProjectileID.CrystalShard) + projectile.damage = (int)(projectile.damage * 0.55f); + + // Nerf Mushroom Spear mushroom damage by 50% + if (parent.type == ProjectileID.MushroomSpear && projectile.type == ProjectileID.Mushroom) + projectile.damage /= 2; + + // Nerf Luminite Arrow trail damage by 50% + if (parent.type == ProjectileID.MoonlordArrow && projectile.type == ProjectileID.MoonlordArrowTrail) + projectile.damage /= 2; + + // Nerf Cursed Dart flame damage by 50% + if (parent.type == ProjectileID.CursedDart && projectile.type == ProjectileID.CursedDartFlame) + projectile.damage /= 2; + } + + if (source is EntitySource_OnHit e) + { + // Nerf Orichalcum armor's set bonus petal damage by 25% + if (e.Context == "SetBonus_Orichalcum") + projectile.damage = (int)(projectile.damage * 0.75f); + // Nerf Spectre armor's set bonus soul damage by 50% + if (e.Context == "SetBonus_GhostHurt") + projectile.damage /= 2; + } } public override void SendExtraAI(Projectile projectile, BitWriter bitWriter, BinaryWriter binaryWriter) => binaryWriter.Write(ParentNPCIndex); public override void ReceiveExtraAI(Projectile projectile, BitReader bitReader, BinaryReader binaryReader) => ParentNPCIndex = binaryReader.ReadInt32(); @@ -465,10 +494,10 @@ namespace CalamityMod.Projectiles // Accelerate if fired in a spread from Skeletron in Rev+ if (revSkeletronAcceleratingSkull) { - float maxVelocity = BossRushEvent.BossRushActive ? 20f : CalamityWorld.death ? 18f : 15f; + float maxVelocity = CalamityWorld.death ? 18f : 15f; if (projectile.velocity.Length() < maxVelocity) { - float acceleration = BossRushEvent.BossRushActive ? 1.02f : 1.015f; + float acceleration = 1.015f; projectile.velocity *= acceleration; if (projectile.velocity.Length() > maxVelocity) { @@ -507,7 +536,7 @@ namespace CalamityMod.Projectiles num133 = Player.FindClosest(projectile.Center, 1, 1); projectile.ai[1] += 1f; float homingStartTime = revSkeletronPrimeHomingSkull ? 10f : 30f; - float homingEndTime = BossRushEvent.BossRushActive ? 120f : CalamityWorld.death ? 105f : 90f; + float homingEndTime = CalamityWorld.death ? 105f : 90f; if (revSkeletronPrimeHomingSkull) homingEndTime += 60f; @@ -681,11 +710,6 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - if (Main.masterMode && !CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * CalamityGlobalNPC.MasterModeEnemyDamageMultiplier); - if (!CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * 0.65); - SoundEngine.PlaySound(SoundID.Item17, projectile.Center); projectile.localAI[0] = 1f; for (int i = 0; i < 8; i++) @@ -714,11 +738,6 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - if (Main.masterMode && !CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * CalamityGlobalNPC.MasterModeEnemyDamageMultiplier); - if (!CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * 0.65); - SoundEngine.PlaySound(SoundID.Item171, projectile.Center); projectile.localAI[0] = 1f; for (int i = 0; i < 8; i++) @@ -998,112 +1017,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; @@ -2075,7 +1991,7 @@ namespace CalamityMod.Projectiles float dustVelocityMultiplier = 0.75f; int numDust = 5; int numDust2 = 5; - int fadeInTime = 50; + int fadeInTime = 25; int fadeOutGateValue = death ? 90 : 65; float killGateValue = death ? 100f : 75f; int maxFrames = 5; @@ -2110,7 +2026,7 @@ namespace CalamityMod.Projectiles if (fadeIn) { - projectile.Opacity += 0.02f; + projectile.Opacity += 0.04f; if (projectile.Opacity > 1f) projectile.Opacity = 1f; @@ -2296,115 +2212,6 @@ namespace CalamityMod.Projectiles } } - else if (projectile.type == ProjectileID.BombSkeletronPrime && projectile.ai[0] < 0f && death) - { - int num = (int)(projectile.Center.X / 16f); - int num2 = (int)(projectile.Center.Y / 16f); - if (WorldGen.InWorld(num, num2) && projectile.tileCollide) - { - Tile tile = Main.tile[num, num2]; - if (tile != null && tile.HasTile && (TileID.Sets.Platforms[tile.TileType] || tile.TileType == TileID.PlanterBox)) - { - projectile.Kill(); - return false; - } - } - - bool deathModeSkeletronPrimeHomingBomb = projectile.ai[0] == -1f; - bool deathModeSkeletronPrimeFallingBomb = projectile.ai[0] == -2f; - - int target = 0; - target = Player.FindClosest(projectile.Center, 1, 1); - - if (projectile.Hitbox.Intersects(Main.player[target].Hitbox)) - { - projectile.Kill(); - return false; - } - - if (projectile.timeLeft < SkeletronPrime2.BombTimeLeft / 2 && projectile.timeLeft > 3) - projectile.tileCollide = true; - - if (deathModeSkeletronPrimeHomingBomb) - { - projectile.ai[1] += 1f; - float homingStartTime = 20f; - float homingEndTime = death ? 140f : 110f; - - if (Vector2.Distance(projectile.Center, Main.player[target].Center) < 192f && projectile.ai[1] < homingEndTime) - projectile.ai[1] = homingEndTime; - - if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime) - { - float num134 = projectile.velocity.Length(); - Vector2 vector24 = Main.player[target].Center - projectile.Center; - vector24.Normalize(); - vector24 *= num134; - float inertia = death ? 25f : 30f; - projectile.velocity = (projectile.velocity * (inertia - 1f) + vector24) / inertia; - projectile.velocity.Normalize(); - projectile.velocity *= num134; - } - - float maxVelocity = death ? 18f : 15f; - float acceleration = 1.02f; - if (projectile.velocity.Length() < maxVelocity) - projectile.velocity *= acceleration; - } - else - { - if (projectile.velocity.Y > 10f) - projectile.velocity.Y = 10f; - } - - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item10, projectile.Center); - } - - projectile.frameCounter++; - if (projectile.frameCounter > 3) - { - projectile.frame++; - projectile.frameCounter = 0; - } - - if (projectile.frame > 1) - projectile.frame = 0; - - if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) - { - projectile.tileCollide = false; - projectile.ai[2] = 0f; - projectile.alpha = 255; - } - else if (Main.rand.NextBool()) - { - int num28 = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100); - Main.dust[num28].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num28].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num28].noGravity = true; - Main.dust[num28].position = projectile.Center + new Vector2(0f, -projectile.height / 2).RotatedBy(projectile.rotation) * 1.1f; - int num29 = 6; - Dust dust8 = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, num29, 0f, 0f, 100); - dust8.scale = 1f + (float)Main.rand.Next(5) * 0.1f; - dust8.noGravity = true; - dust8.position = projectile.Center + new Vector2(0f, -projectile.height / 2 - 6).RotatedBy(projectile.rotation) * 1.1f; - } - - if (deathModeSkeletronPrimeFallingBomb) - { - projectile.ai[2] += 1f; - if (projectile.ai[2] > 60f) - projectile.velocity.Y += 0.2f; - } - - projectile.rotation += projectile.velocity.X * 0.1f; - - return false; - } - else if (projectile.type == ProjectileID.RocketSkeleton && projectile.ai[1] >= 1f) { bool primeCannonProjectile = projectile.ai[1] == 2f; @@ -2568,7 +2375,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); } } @@ -2625,110 +2432,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 (Main.getGoodWorld) - 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 (Main.getGoodWorld) - 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) @@ -2956,7 +2659,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; } @@ -3162,97 +2865,6 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileID.Nail && Main.expertMode) projectile.damage /= 2; - // Nerf all these Master Mode enemy projectiles - if (Main.masterMode && !CalamityPlayer.areThereAnyDamnBosses) - { - switch (projectile.type) - { - case ProjectileID.DemonSickle: - case ProjectileID.HarpyFeather: - case ProjectileID.JavelinHostile: - case ProjectileID.SalamanderSpit: - case ProjectileID.SkeletonBone: - case ProjectileID.IceSpike: - case ProjectileID.JungleSpike: - case ProjectileID.PinkLaser: - case ProjectileID.FrostBlastHostile: - case ProjectileID.GoldenShowerHostile: - case ProjectileID.RainNimbus: - case ProjectileID.FlamingArrow: - case ProjectileID.BulletDeadeye: - case ProjectileID.CannonballHostile: - case ProjectileID.UnholyTridentHostile: - case ProjectileID.FrostBeam: - case ProjectileID.CursedFlameHostile: - case ProjectileID.Stinger: - case ProjectileID.BloodNautilusTears: - case ProjectileID.RockGolemRock: - case ProjectileID.IcewaterSpit: - case ProjectileID.RocketSkeleton: - case ProjectileID.SniperBullet: - case ProjectileID.DrManFlyFlask: - case ProjectileID.DesertDjinnCurse: - case ProjectileID.InfernoHostileBlast: - case ProjectileID.InfernoHostileBolt: - case ProjectileID.Shadowflames: - case ProjectileID.ShadowBeamHostile: - case ProjectileID.PaladinsHammerHostile: - case ProjectileID.LostSoulHostile: - case ProjectileID.RuneBlast: - case ProjectileID.DandelionSeed: - case ProjectileID.SandnadoHostile: - case ProjectileID.SandnadoHostileMark: - case ProjectileID.SnowBallHostile: - case ProjectileID.EyeLaser: - case ProjectileID.Nail: - case ProjectileID.BrainScramblerBolt: - case ProjectileID.GigaZapperSpear: - case ProjectileID.MartianWalkerLaser: - case ProjectileID.RayGunnerLaser: - case ProjectileID.MartianTurretBolt: - case ProjectileID.NebulaSphere: - case ProjectileID.NebulaLaser: - case ProjectileID.NebulaBolt: - case ProjectileID.StardustJellyfishSmall: - case ProjectileID.StardustSoldierLaser: - case ProjectileID.Twinkle: - case ProjectileID.VortexAcid: - case ProjectileID.VortexLaser: - case ProjectileID.VortexLightning: - case ProjectileID.VortexVortexLightning: - case ProjectileID.FlamingWood: - case ProjectileID.GreekFire1: - case ProjectileID.GreekFire2: - case ProjectileID.GreekFire3: - case ProjectileID.FlamingScythe: - case ProjectileID.OrnamentHostile: - case ProjectileID.OrnamentHostileShrapnel: - case ProjectileID.PineNeedleHostile: - case ProjectileID.FrostShard: - case ProjectileID.FrostWave: - case ProjectileID.Missile: - case ProjectileID.Present: - case ProjectileID.Spike: - case ProjectileID.SaucerDeathray: - case ProjectileID.SaucerLaser: - case ProjectileID.SaucerMissile: - case ProjectileID.SaucerScrap: - case ProjectileID.DD2GoblinBomb: - case ProjectileID.DD2JavelinHostile: - case ProjectileID.DD2JavelinHostileT3: - case ProjectileID.DD2DarkMageBolt: - case ProjectileID.DD2DrakinShot: - case ProjectileID.DD2OgreSmash: - case ProjectileID.DD2OgreSpit: - case ProjectileID.DD2OgreStomp: - case ProjectileID.DD2LightningBugZap: - case ProjectileID.DD2BetsyFireball: - case ProjectileID.DD2BetsyFlameBreath: - projectile.damage = (int)Math.Round(projectile.damage * CalamityGlobalNPC.MasterModeEnemyDamageMultiplier); - break; - } - } - // Nerf several Hardmode enemy projectiles because they deal way too much damage if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -3270,6 +2882,8 @@ namespace CalamityMod.Projectiles case ProjectileID.FrostBeam: case ProjectileID.CursedFlameHostile: case ProjectileID.Stinger: + case ProjectileID.BloodShot: + case ProjectileID.BloodNautilusShot: case ProjectileID.BloodNautilusTears: case ProjectileID.RockGolemRock: case ProjectileID.IcewaterSpit: @@ -3302,22 +2916,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; } @@ -3381,6 +2992,18 @@ namespace CalamityMod.Projectiles break; } + // Makes flares from Firestorm Cannon ignore gravity + // Spectralstorm Cannon uses a custom flare projectile + if (projectile.aiStyle == ProjAIStyleID.Flare && projectile.ai[2] == 1f && projectile.localAI[0] == 0f) + projectile.localAI[1]--; + + // Hack to allow Desert Tiger minion to fall through platforms while attacking + if (projectile.type >= ProjectileID.StormTigerTier1 && projectile.type <= ProjectileID.StormTigerTier3) + { + if (projectile.ai[0] == 5f) + projectile.tileCollide = false; + } + // Jack O Lantern Launcher projectile tweak if (projectile.type == ProjectileID.JackOLantern) { @@ -3393,6 +3016,7 @@ namespace CalamityMod.Projectiles } } + #region Flail Extendo Hacks // Very hacky solution for making Dao of Pow's flail throw travel farther and faster if (projectile.type == ProjectileID.TheDaoofPow) { @@ -3423,6 +3047,22 @@ namespace CalamityMod.Projectiles } } } + // And Flower Pow! + if (projectile.type == ProjectileID.FlowerPow) + { + if (projectile.ai[0] == 1f) + { + if (projectile.ai[1] > 0f) + { + projectile.ai[2]++; + if (projectile.ai[2] <= 5f) // When ai[1] reaches 12, it starts returning, so this makes it take an extra 5 frames to return + projectile.ai[1]--; + } + else + projectile.velocity *= 1.33f; + } + } + #endregion // Starfury stars never collide with tiles if (projectile.type == ProjectileID.Starfury) @@ -3448,18 +3088,30 @@ namespace CalamityMod.Projectiles projectile.ai[0]--; // Acceleration for certain lasers - if ((projectile.type == ProjectileID.EyeLaser || projectile.type == ProjectileID.DeathLaser || projectile.type == ProjectileID.FrostBeam) && projectile.ai[0] == 1f) + if ((projectile.type == ProjectileID.EyeLaser || projectile.type == ProjectileID.DeathLaser) && projectile.ai[0] == 1f) { if (projectile.velocity.Length() < AcceleratingBossLaserVelocityCap) 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)) { int spreadOutTime = 90; if (projectile.timeLeft > EmpressLastingRainbowTotalDuration - spreadOutTime) - projectile.velocity *= BossRushEvent.BossRushActive ? 1.017078f : 1.015525f; + projectile.velocity *= 1.015525f; } // Zapinator lasers cannot trigger their damage multiplier more than once @@ -3544,36 +3196,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())) @@ -3661,16 +3283,13 @@ namespace CalamityMod.Projectiles { if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileID.CrystalShard] < 15) { - // Daedalus Rogue Crystals: 2 x 25%, soft cap starts at 120 base damage + // Daedalus Rogue Crystals: 25%, soft cap starts at 120 base damage int crystalDamage = CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30); - for (int i = 0; i < 2; i++) - { - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int shard = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileID.CrystalShard, crystalDamage, 0f, projectile.owner); - if (shard.WithinBounds(Main.maxProjectiles)) - Main.projectile[shard].DamageType = DamageClass.Generic; - } + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileID.CrystalShard, crystalDamage, 0f, projectile.owner); + if (shard.WithinBounds(Main.maxProjectiles)) + Main.projectile[shard].DamageType = DamageClass.Generic; } } } @@ -3820,14 +3439,14 @@ namespace CalamityMod.Projectiles confetti.velocity.Y += Main.rand.Next(-50, 51) * 0.05f; } } - // Support to help things like holdout swords work with Arc Flash Ring - if (!spawnArcFlash && projectile.numHits == 0) - spawnArcFlash = true; + // Support to help things like holdout swords look better with Arc Flash Ring + if (!showArcFlash && projectile.numHits == 0) + showArcFlash = true; // Cooldown for the arc flash so that long lasting projectiles (like dashing summons) can spawn multiple bolts if (arcFlashCooldown >= 0) arcFlashCooldown--; if (arcFlashCooldown == 0) - spawnArcFlash = true; + showArcFlash = true; if (conditionalHomingRange > 0f) { CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, 12f, 20f); @@ -4004,10 +3623,9 @@ 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) @@ -4094,7 +3712,21 @@ 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) @@ -4102,16 +3734,15 @@ namespace CalamityMod.Projectiles float mult = 1f; if (player.Calamity().reaverSpeed) mult += 0.5f; + 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) @@ -4119,6 +3750,8 @@ namespace CalamityMod.Projectiles float mult = 1f; if (player.Calamity().reaverSpeed) mult += 0.5f; + if (player.Calamity().tungstenArmorHookBoost) + mult += TungstenArmorSetChange.HookBoost; if (player.Calamity().bloomStone) mult += 0.5f; speed *= mult; @@ -4153,10 +3786,11 @@ namespace CalamityMod.Projectiles projectile.damage = 1; } - // Heat Ray damage falloff - if (projectile.type == ProjectileID.HeatRay && projectile.numHits > 0) + // Super Star Shooter has damage falloff + if (projectile.type == ProjectileID.SuperStar) { - projectile.damage = (int)(projectile.damage * 0.9f); + if (projectile.numHits > 0) + projectile.damage = (int)(projectile.damage * 0.95f); if (projectile.damage < 1) projectile.damage = 1; } @@ -4178,7 +3812,9 @@ namespace CalamityMod.Projectiles else if (modPlayer.vampiricTalisman && projectile.Calamity().stealthStrike) { target.AddBuff(BuffType(), VampiricTalisman.ArmorCrunchDebuffTime); - target.AddBuff(BuffType(), VampiricTalisman.HeavyBleedingDebuffTime); + + if (!modPlayer.nanotech) + target.AddBuff(BuffType(), VampiricTalisman.HeavyBleedingDebuffTime); } if (modPlayer.flamingItemEnchant && !projectile.minion && !projectile.npcProj && !projectile.Calamity().CreatedByPlayerDash) @@ -4281,18 +3917,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 @@ -4310,7 +3943,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); } @@ -4391,7 +4024,7 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileID.Skull && (projectile.ai[0] == -1f || projectile.ai[0] == -3f)) { - float homingTime = BossRushEvent.BossRushActive ? 120f : CalamityWorld.death ? 105f : 90f; + float homingTime = CalamityWorld.death ? 105f : 90f; if (projectile.ai[0] == -3f) homingTime += 60f; @@ -4716,9 +4349,7 @@ namespace CalamityMod.Projectiles #region Pre Kill public override bool PreKill(Projectile projectile, int timeLeft) { - bool masterRevSkeletronPrimeBomb = projectile.type == ProjectileID.BombSkeletronPrime && projectile.ai[0] < 0f && (CalamityWorld.death || BossRushEvent.BossRushActive); 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) { @@ -4738,96 +4369,7 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer) { - if (masterRevSkeletronPrimeBomb) - { - SoundEngine.PlaySound(SoundID.Item14, projectile.Center); - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 22; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - - for (int num951 = 0; num951 < 20; num951++) - { - int num952 = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Dust dust2 = Main.dust[num952]; - dust2.velocity *= 1.4f; - } - - int num950 = 6; - for (int num953 = 0; num953 < 10; num953++) - { - int num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[num954].noGravity = true; - Dust dust2 = Main.dust[num954]; - dust2.velocity *= 5f; - num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 1.5f); - dust2 = Main.dust[num954]; - dust2.velocity *= 3f; - } - - int num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - Gore gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y -= 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y -= 1f; - - Vector2 vector76 = projectile.position; - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 128; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - projectile.Damage(); - projectile.position = vector76; - projectile.width = projectile.height = 22; - - if (Main.getGoodWorld && !Main.remixWorld) - { - int num1011 = 4; - Vector2 center3 = projectile.position; - int num1012 = num1011; - int num1013 = num1011; - int num1014 = (int)(center3.X / 16f - (float)num1012); - int num1015 = (int)(center3.X / 16f + (float)num1012); - int num1016 = (int)(center3.Y / 16f - (float)num1013); - int num1017 = (int)(center3.Y / 16f + (float)num1013); - if (num1014 < 0) - num1014 = 0; - - if (num1015 > Main.maxTilesX) - num1015 = Main.maxTilesX; - - if (num1016 < 0) - num1016 = 0; - - if (num1017 > Main.maxTilesY) - num1017 = Main.maxTilesY; - - bool wallSplode2 = projectile.ShouldWallExplode(center3, num1011, num1014, num1015, num1016, num1017); - projectile.ExplodeTiles(center3, num1011, num1014, num1015, num1016, num1017, wallSplode2); - } - - if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner); - } - - else if (revQueenBeeBeeHive) + if (revQueenBeeBeeHive) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -4883,17 +4425,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 (masterRevSkeletronPrimeBomb || revQueenBeeBeeHive || revGolemInferno) + if (revQueenBeeBeeHive) { projectile.active = false; return false; @@ -4954,34 +4488,5 @@ namespace CalamityMod.Projectiles } } #endregion - - #region Life Steal - public static bool CanSpawnLifeStealProjectile(double healMultiplier, float healAmount) => healMultiplier > 0D && (int)healAmount > 0; - - public static void SpawnLifeStealProjectile(Projectile projectile, Player player, float healAmount, int healProjectileType, float distanceRequired, float cooldownMultiplier = 1f) - { - if (Main.LocalPlayer.moonLeech) - return; - - Main.LocalPlayer.lifeSteal -= healAmount * cooldownMultiplier; - - float lowestHealthCheck = 0f; - int healTarget = projectile.owner; - foreach (Player otherPlayer in Main.ActivePlayers) - { - if (!otherPlayer.dead && ((!player.hostile && !otherPlayer.hostile) || player.team == otherPlayer.team)) - { - float playerDist = Vector2.Distance(projectile.Center, otherPlayer.Center); - if (playerDist < distanceRequired && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) - { - lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; - healTarget = otherPlayer.whoAmI; - } - } - } - - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, healProjectileType, 0, 0f, projectile.owner, healTarget, healAmount); - } - #endregion } } diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 9455364fd9..6cf46e396d 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles { ProjectileID.TerrarianBeam, Do(LocalIFrames(-1)) }, // Terrarian yoyo orbs // original: INF lifetime | 360px range | 16.5px/f top speed | 0 extra updates - { ProjectileID.TheEyeOfCthulhu, RebalanceYoyo(-1f, 480f, 36f, 1) }, // the yoyo, of course + { ProjectileID.TheEyeOfCthulhu, RebalanceYoyo(-1f, 480f, 36f, 1, 12) }, // the yoyo, of course // original: INF lifetime | 370px range | 16px/f top speed | 0 extra updates { ProjectileID.ValkyrieYoyo, RebalanceYoyo(-1f, 480f, 42f, 2, 12) }, @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles { ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) }, { ProjectileID.Bullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.BulletHighVelocity, Do(LocalIFrames(-1)) }, - { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5), ScaleExact(1.5f)) }, + { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(7), ScaleExact(1.5f)) }, { ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks }, { ProjectileID.ChlorophyteDrill, standardDrillTweaks }, { ProjectileID.ChlorophyteOrb, Do(NoPiercing) }, @@ -142,6 +142,7 @@ namespace CalamityMod.Projectiles { ProjectileID.ClusterSnowmanRocketII, Do(LocalIFrames(15)) }, { ProjectileID.DangerousSpider, Do( ExtraUpdatesExact(2), LocalIFrames(45)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders. { ProjectileID.DD2SquireSonicBoom, Do(PiercingExact(3), DefaultIDStaticIFrames) }, // Flying Dragon + { ProjectileID.DeadlySphere, Do(LocalIFrames(30)) }, { ProjectileID.EmeraldBolt, Do(NoPiercing) }, { ProjectileID.EmpressBlade, Do(LocalIFrames(30)) }, // Terraprisma { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, @@ -152,7 +153,6 @@ namespace CalamityMod.Projectiles { ProjectileID.Flames, Do(IDStaticIFrames(5)) }, // Flamethrower AND Elf Melter flames { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, // Orichalcum armor - { ProjectileID.FlowerPow, Do(ExtraUpdatesExact(1)) }, { ProjectileID.FlyingKnife, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.FrostBoltStaff, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.FruitcakeChakram, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, @@ -162,8 +162,6 @@ namespace CalamityMod.Projectiles { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GreenCounterweight, counterweightTweaks }, { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) - { ProjectileID.HeatRay, Do(InfinitePiercing, IDStaticIFrames(6)) }, // Due to the weapon's fast use speed, the lasers need to give less than 10 iframes - { ProjectileID.HellfireArrow, Do(ExtraUpdatesDelta(+2)) }, { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.IceSickle, Do(ExtraUpdatesExact(1)) }, { ProjectileID.IchorBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, @@ -201,7 +199,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 }, @@ -257,40 +254,18 @@ namespace CalamityMod.Projectiles #endregion #region CATEGORY 4: Defense Damage support - { ProjectileID.BombSkeletronPrime, defenseDamage }, - { ProjectileID.CannonballHostile, defenseDamage }, { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados - { ProjectileID.CultistBossFireBall, defenseDamage }, - { ProjectileID.CultistBossFireBallClone, defenseDamage }, - { ProjectileID.CultistBossIceMist, defenseDamage }, - { ProjectileID.CultistBossLightningOrbArc, defenseDamage }, - { ProjectileID.DD2BetsyFireball, defenseDamage }, { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, { ProjectileID.DeerclopsIceSpike, defenseDamage }, - { ProjectileID.DeerclopsRangedProjectile, defenseDamage }, // Deerclops shadow hands - { 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 - { 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.RocketSkeleton, defenseDamage }, // Skeleton Commando rockets - { ProjectileID.RockGolemRock, defenseDamage }, - { ProjectileID.RuneBlast, defenseDamage }, // Rune Wizard shots { ProjectileID.SaucerDeathray, defenseDamage }, - { ProjectileID.SaucerMissile, defenseDamage }, { ProjectileID.Sharknado, defenseDamage }, - { ProjectileID.Skull, defenseDamage }, // Skeletron Expert+ skulls - { 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 5: ID-Static Immunity Frame changes @@ -413,6 +388,7 @@ namespace CalamityMod.Projectiles {ProjectileID.HallowStar, defaultIFrames}, { ProjectileID.Hellwing, defaultIFrames }, { ProjectileID.HolyArrow, defaultIFrames }, + {ProjectileID.HeatRay, Do(DefaultIDStaticIFrames)}, {ProjectileID.HolyWater, defaultIFrames}, {ProjectileID.HoneyBomb, defaultIFrames}, {ProjectileID.HoneyGrenade, defaultIFrames}, 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/CountermeasureMittFinger.png b/Projectiles/DraedonsArsenal/CountermeasureMittFinger.png new file mode 100644 index 0000000000..4872bab1bc Binary files /dev/null and b/Projectiles/DraedonsArsenal/CountermeasureMittFinger.png differ diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittFinger2.png b/Projectiles/DraedonsArsenal/CountermeasureMittFinger2.png new file mode 100644 index 0000000000..c5619e167a Binary files /dev/null and b/Projectiles/DraedonsArsenal/CountermeasureMittFinger2.png differ diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs new file mode 100644 index 0000000000..2ee3ebc154 --- /dev/null +++ b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs @@ -0,0 +1,557 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.NPCs; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.Player; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + [PierceResistException] + public class CountermeasureMittHoldout : BaseGunHoldoutProjectile + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override int AssociatedItemID => ModContent.ItemType(); + + public float offsetBase = 0; + public override float MaxOffsetLengthFromArm => offsetBase; + public override float RecoilResolveSpeed => 0.4f; + public override float OffsetXUpwards => 0f; + public override float BaseOffsetY => 0f; + public override float OffsetYDownwards => 0f; + public override float WeaponTurnSpeed => 0.5f; + public bool forcePalm => Projectile.ai[2] != 0; // If you're performing a palm blast or not + public ref float shootingTimer => ref Projectile.ai[0]; + public ref float fireRate => ref Projectile.ai[1]; + public int time = 0; + + // Finger lerps and rotations + #region Fingers + public float rotSpeed = 0; + public float f1l => 0.02f * rotSpeed; // Finger Lerp Speed + public float f1r = 0; // Finger Rotation + public float f1x = 0; // Finger Effects Multiplier + public float f1d = -0.95f; // Finger Aim Direction + public SlotId AudSlot1; // Finger Laser Audio Slot + public float f2l => 0.016f * rotSpeed; + public float f2r = 0; + public float f2x = 0; + public float f2d = -0.95f; + public SlotId AudSlot2; + public float f3l => 0.012f * rotSpeed; + public float f3r = 0; + public float f3x = 0; + public float f3d = -0.95f; + public SlotId AudSlot3; + public float f4l => 0.008f * rotSpeed; + public float f4r = 0; + public float f4x = 0; + public float f4d = -0.95f; + public SlotId AudSlot4; + public float f5l => 0.004f * rotSpeed; + public float f5r = 0; + public float f5x = 0; + public float f5d = -0.95f; + public SlotId AudSlot5; + #endregion + + public int palmAnimTime = 20; // Animation length for the palm attack + public int cooldownGiven = 400; // Arsenal Cooldown from the palm attack + public int attackTime = 100; // Attack cycle length + public int attackCycles = 0; + public bool failedManaCheck = false; + public bool canHit = false; + public float alteredRotationRot = 0.7f; // Alteration to the holdout rotation so it's not directly to the mouse, changes with the attack cycle + public float alteredRotation => Projectile.rotation + (f2r * alteredRotationRot * -Projectile.direction); + public Vector2 palmBlastPos => Owner.Center + alteredRotation.ToRotationVector2() * 55 * Projectile.scale; + public int palmManaCost => HeldItem.mana * 30; + public int hitTimer = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.penetrate = -1; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.tileCollide = false; + Projectile.ArmorPenetration = 55; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 5; + } + public override void KillHoldoutLogic() + { + + } + public override bool? CanDamage() => null; + public override bool? CanHitNPC(NPC target) + { + return (canHit ? null : false); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (!canHit) return false; + float realRot = alteredRotation; + Vector2 handPos = Owner.GetBackHandPosition(CompositeArmStretchAmount.None, Owner.compositeBackArm.rotation) + (Owner.compositeBackArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 9; + + // Every laser has collision for the single hitbox, so it works more like a large wide piercing single beam + float beamLength = 1500 * Projectile.scale; + float beamThickness = 20 * Projectile.scale; + float fingerLength = 6 * Projectile.scale; + float _ = float.NaN; + + bool colCheck = false; + + #region 5 Collision Line Checks + for (int t = 0; t < 5; t++) + { + float rot = t switch + { + 1 => f4r * Projectile.direction, + 2 => f3r * Projectile.direction, + 3 => f2r * Projectile.direction, + 4 => f1r * Projectile.direction, + _ => -f5r * 0.3f * Projectile.direction, + }; + float fx = t switch + { + 1 => f4x, 2 => f3x, 3 => f2x, 4 => f1x, _ => f5x, + }; + + Vector2 basePosition = handPos + alteredRotation.ToRotationVector2() * (t == 0 ? 2.5f : 3.3f) * Projectile.scale + (alteredRotation + rot).ToRotationVector2() * fingerLength + (alteredRotation + MathHelper.PiOver2 * -Projectile.direction).ToRotationVector2() * (t == 0 ? -3 : 3) * Projectile.scale; + if (fx > 0.2f) + colCheck = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), basePosition, basePosition + (realRot + rot).ToRotationVector2() * (fingerLength + beamLength), beamThickness, ref _); + if (colCheck) + t = 5; + } + #endregion + + return (colCheck); + } + public void EndSounds() + { + if (SoundEngine.TryGetActiveSound(AudSlot1, out var s1)) + s1?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot2, out var s2)) + s2?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot3, out var s3)) + s3?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot4, out var s4)) + s4?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot5, out var s5)) + s5?.Stop(); + } + public override void HoldoutAI() + { + if (hitTimer > 0) + hitTimer--; + + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, (alteredRotation + MathHelper.PiOver2 * -Projectile.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + + Vector2 handPos = Owner.GetBackHandPosition(CompositeArmStretchAmount.None, Owner.compositeBackArm.rotation) + (Owner.compositeBackArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 4; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmFront(true, FrontArmStretch, armRotation + ExtraFrontArmRotation * Projectile.direction); + + // Below you see the sacrifice of coding 5 individual fingers + if (time == 0 && forcePalm) + { + rotSpeed = 7f; + alteredRotationRot = 0; + } + if (time == 1) + rotSpeed = 0; + + if (forcePalm) alteredRotationRot = MathHelper.Lerp(alteredRotationRot, 0, 0.1f); + else if (shootingTimer > -10) alteredRotationRot = MathHelper.Lerp(alteredRotationRot, 0.7f, 0.1f); + + #region The Price of 5 Fingers + float fxPower = 5; + if (!forcePalm) + { + if (shootingTimer == 10) f1d *= -1; + if (shootingTimer == 20) f2d *= -1; + if (shootingTimer == 30) f3d *= -1; + if (shootingTimer == 40) f4d *= -1; + if (shootingTimer == 50) f5d *= -1; + if (attackCycles == 0) + { + if (shootingTimer == 10) f1x = fxPower; + if (shootingTimer == 20) f2x = fxPower; + if (shootingTimer == 30) f3x = fxPower; + if (shootingTimer == 40) f4x = fxPower; + if (shootingTimer == 50) f5x = fxPower; + } + } + + f1r = MathHelper.Lerp(f1r, f1d, f1l * rotSpeed); + f2r = MathHelper.Lerp(f2r, f2d * 0.775f, f2l * rotSpeed); + f3r = MathHelper.Lerp(f3r, f3d * 0.55f, f3l * rotSpeed); + f4r = MathHelper.Lerp(f4r, f4d * 0.325f, f4l * rotSpeed); + f5r = MathHelper.Lerp(f5r, f5d * 2.3f - 2, f5l * 4 * rotSpeed); + + float goalValue = (canHit ? 1 : 0); + float lerpPower = (forcePalm ? 0.35f : canHit ? 0.2f : 0.25f); + f1x = MathHelper.Lerp(f1x, (f1x > 0.05f ? goalValue : 0), lerpPower); + f2x = MathHelper.Lerp(f2x, (f2x > 0.05f ? goalValue : 0), lerpPower); + f3x = MathHelper.Lerp(f3x, (f3x > 0.05f ? goalValue : 0), lerpPower); + f4x = MathHelper.Lerp(f4x, (f4x > 0.05f ? goalValue : 0), lerpPower); + f5x = MathHelper.Lerp(f5x, (f5x > 0.05f ? goalValue : 0), lerpPower); + + float sine = (float)Math.Sin(time * 0.2f / MathHelper.Pi) * 0.1f; + float maxVol = 0.4f; + float minPitch = -0.8f; + if (SoundEngine.TryGetActiveSound(AudSlot1, out var f1s) && f1s.IsPlaying) + { + f1s.Position = Projectile.Center; + f1s.Pitch = Utils.Remap(f1x, 0.7f, 1, 0f + minPitch, 0f) + sine; + f1s.Volume = Utils.Remap(f1x, 0, 1, 0f, maxVol) * 100; + } + else if (f1x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld1"); + AudSlot1 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot2, out var f2s) && f2s.IsPlaying) + { + f2s.Position = Projectile.Center; + f2s.Pitch = Utils.Remap(f2x, 0.7f, 1, 0.2f + minPitch, 0.2f) + sine; + f2s.Volume = Utils.Remap(f2x, 0, 1, 0f, maxVol) * 100; + } + else if (f2x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld2"); + AudSlot2 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot3, out var f3s) && f3s.IsPlaying) + { + f3s.Position = Projectile.Center; + f3s.Pitch = Utils.Remap(f3x, 0.7f, 1, 0.4f + minPitch, 0.4f) + sine; + f3s.Volume = Utils.Remap(f3x, 0, 1, 0f, maxVol) * 100; + } + else if (f3x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld3"); + AudSlot3 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot4, out var f4s) && f4s.IsPlaying) + { + f4s.Position = Projectile.Center; + f4s.Pitch = Utils.Remap(f4x, 0.7f, 1, 0.6f + minPitch, 0.6f) + sine; + f4s.Volume = Utils.Remap(f4x, 0, 1, 0f, maxVol) * 100; + } + else if (f4x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld4"); + AudSlot4 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot5, out var f5s) && f5s.IsPlaying) + { + f5s.Position = Projectile.Center; + f5s.Pitch = Utils.Remap(f5x, 0.7f, 1, 0.8f + minPitch, 0.8f) + sine; + f5s.Volume = Utils.Remap(f5x, 0, 1, 0f, maxVol) * 100; + } + else if (f5x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld5"); + AudSlot5 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + #endregion + + Lighting.AddLight(Projectile.Center, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, 0.3f).ToVector3() * MathHelper.Clamp((f1x + f2x + f3x + f4x + f5x - 4f) * 2f, 0f, 0.7f)); + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1, 0.1f); + + if (time == 0) + { + if (!forcePalm) + shootingTimer = -40; + if (Projectile.ai[2] != 0) + Projectile.ai[2] = palmAnimTime; + fireRate = attackTime; + OffsetLengthFromArm = offsetBase; + } + if (shootingTimer < 0) + { + canHit = false; + // Light cooldown before firing + if (rotSpeed > 0) + rotSpeed -= 0.05f; + + if (shootingTimer == -1 || forcePalm) + { + if ((!Main.mouseLeft && !forcePalm) || failedManaCheck) + { + EndSounds(); + Projectile.Kill(); + return; + } + + attackCycles = 0; + fireRate = attackTime; + } + + } + if (Owner.Calamity().mouseRight && Owner.Calamity().arsenalCooldown <= 0 && !forcePalm && !failedManaCheck) + { + Projectile.ai[2] = 5; + shootingTimer = 0; + } + if (forcePalm) + { + if (!Owner.CheckMana(HeldItem, palmManaCost, false, false)) + { + failedManaCheck = true; + SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); + Projectile.ai[2] = 0; + return; + } + rotSpeed = 5; + + f1d = -Math.Abs(f1d); f2d = -Math.Abs(f2d); f3d = -Math.Abs(f3d); f4d = -Math.Abs(f4d); f5d = -Math.Abs(f5d); + + if (shootingTimer <= palmAnimTime) + { + if (shootingTimer == 1) + { + SoundStyle aud = new("CalamityMod/Sounds/Item/MittReadyPalm"); + SoundEngine.PlaySound(aud with { Volume = 1f, Pitch = 0 }, Projectile.Center); + } + if (shootingTimer == (int)(palmAnimTime * 0.8f)) + { + SoundStyle aud = new("CalamityMod/Sounds/Item/MittThrust"); + SoundEngine.PlaySound(aud with { Volume = 1f, Pitch = 0 }, Projectile.Center); + } + if (shootingTimer == palmAnimTime) + { + Shoot(); + Projectile.ai[2] = 0; + shootingTimer = -30; + rotSpeed = 0; + } + Lighting.AddLight(palmBlastPos, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, 0.3f).ToVector3() * (float)Math.Pow(Utils.GetLerpValue(0, palmAnimTime, shootingTimer), 2)); + } + if (shootingTimer > palmAnimTime * 0.8f) + Projectile.scale *= 1.25f; + canHit = false; + } + else if (shootingTimer >= 0) + { + if (!Main.mouseLeft) + shootingTimer = fireRate; + + if (shootingTimer < fireRate && !failedManaCheck) + { + canHit = true; + if (time % 3 == 0) + { + if (Owner.CheckMana(HeldItem, -1, true, false)) + { + if (rotSpeed < 1.1f) + rotSpeed += 0.1f; + } + else + { + SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); + failedManaCheck = true; + } + } + } + else + { + if (attackCycles < 1 && !failedManaCheck) + { + attackCycles++; + shootingTimer = 0; + } + else + shootingTimer = -30; + } + } + + time++; + shootingTimer++; + } + public void Shoot() + { + bool hitAnything = false; + bool oneFx = true; + float damageMult = 25; + foreach (NPC npc in Main.ActiveNPCs) + { + if (!npc.dontTakeDamage && (Main.zenithWorld || Utils.Distance(npc.Center, palmBlastPos) <= (80 + Math.Max(npc.width / 2, npc.height / 2)))) + { + hitAnything = true; + Vector2 pos = Vector2.Lerp(npc.Center, Projectile.Center, 0.35f); + Vector2 vel = Vector2.Lerp(Projectile.Center.DirectionTo(npc.Center), alteredRotation.ToRotationVector2(), 0.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel, ModContent.ProjectileType(), (int)(Projectile.damage * damageMult), 0, Projectile.owner, 0, npc.whoAmI); + if (oneFx) + { + for (int i = 0; i < 25; i++) + { + Dust dust = Dust.NewDustPerfect(pos, Effects.ArsenalEffects.ArsenalLaserDust, vel.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.4f) * Main.rand.NextFloat(10f, 35f), 0, default, Main.rand.NextFloat(1f, 1.8f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + dust.alpha = 100; + dust.fadeIn = 20; + } + for (int i = 0; i < 2; i++) + { + Particle pulse = new CustomSpark(pos, vel.SafeNormalize(Vector2.UnitX) * 1, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 20, 0.08f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(2f, 0.7f), shrinkSpeed: -0.1f); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse1 = new CustomSpark(pos, vel.SafeNormalize(Vector2.UnitX) * 15, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 18, 0.06f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(2f, 0.7f), shrinkSpeed: -0.1f); + GeneralParticleHandler.SpawnParticle(pulse1); + Particle pulse2 = new CustomSpark(pos, vel.SafeNormalize(Vector2.UnitX) * 25, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 16, 0.04f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(2f, 0.7f), shrinkSpeed: -0.1f); + GeneralParticleHandler.SpawnParticle(pulse2); + } + oneFx = false; + } + damageMult -= 6; + if (damageMult < 1) + damageMult = 1; + } + } + if (hitAnything && Owner.CheckMana(HeldItem, palmManaCost, true, false)) + { + Owner.Calamity().arsenalCooldown = cooldownGiven; + Owner.AddCooldown(ArsenalPower.ID, cooldownGiven); + + SoundStyle aud = new("CalamityMod/Sounds/Item/MittHit"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(aud with { Volume = 0.8f, Pitch = 0, MaxInstances = 2 }, Projectile.Center); + Owner.Calamity().GeneralScreenShakePower = 8f; + } + else + { + Owner.Calamity().arsenalCooldown = (int)(cooldownGiven / 10); + Owner.AddCooldown(ArsenalPower.ID, (int)(cooldownGiven / 10)); + + for (int i = 0; i < 15; i++) + { + Dust dust = Dust.NewDustPerfect(palmBlastPos, ModContent.DustType(), Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(4f, 7f), 0, default, Main.rand.NextFloat(0.7f, 0.85f)); + dust.noGravity = false; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + } + for (int i = 0; i < 2; i++) + { + Particle bloom = new CustomSpark(palmBlastPos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 15, 0.5f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(1f, 1f), true, true); + GeneralParticleHandler.SpawnParticle(bloom); + } + SoundStyle aud = new("CalamityMod/Sounds/Item/MittFail"); + SoundEngine.PlaySound(aud with { Volume = 1f, Pitch = 0 }, Projectile.Center); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (hitTimer == 0) + { + for (int i = 0; i < 3; i++) + { + Dust dust = Dust.NewDustPerfect(target.Center, Effects.ArsenalEffects.ArsenalLaserDust, Owner.Center.DirectionTo(target.Center).RotatedByRandom(0.3f) * Main.rand.NextFloat(9f, 13f), 0, default, Main.rand.NextFloat(0.6f, 1.1f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + dust.alpha = 100; + dust.fadeIn = 10; + } + hitTimer = Projectile.localNPCHitCooldown; + } + else + { + Dust dust = Dust.NewDustPerfect(target.Center, Effects.ArsenalEffects.ArsenalLaserDust, Owner.Center.DirectionTo(target.Center).RotatedByRandom(0.2f) * Main.rand.NextFloat(6f, 9f), 0, default, Main.rand.NextFloat(0.3f, 0.7f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + dust.alpha = 100; + dust.fadeIn = 10; + modifiers.SourceDamage *= 0.2f; + } + } + public override bool PreDraw(ref Color lightColor) + { + Vector2 handPos = Owner.GetBackHandPosition(CompositeArmStretchAmount.None, Owner.compositeBackArm.rotation) + (Owner.compositeBackArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 9 * Projectile.scale; + Projectile.Center = handPos; + + if (time < 2) + return false; + + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/CountermeasureMittHoldout").Value; + + Texture2D finger = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/CountermeasureMittFinger2").Value; + Texture2D laser = ModContent.Request("CalamityMod/Particles/BloomLineFade").Value; + Texture2D laser2 = ModContent.Request("CalamityMod/Particles/BloomLineThick").Value; + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D diamond = ModContent.Request("CalamityMod/Particles/SquareRotated").Value; + + Vector2 drawPosition = handPos - Main.screenPosition; + Vector2 vel = alteredRotation.ToRotationVector2(); + + float randSize = Main.rand.NextFloat(0.8f, 1.3f); + float fadeIn = (float)Math.Pow(Utils.GetLerpValue(0, palmAnimTime, shootingTimer), 2); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = alteredRotation + (Projectile.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + float exRot = (Projectile.direction == -1 ? MathHelper.PiOver2 : 0); + SpriteEffects flipSprite = Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + float thrustCuttoff = palmAnimTime * 0.8f; + float pullBack = MathHelper.Lerp(0.2f, 1f, (float)Math.Pow(Utils.GetLerpValue(thrustCuttoff, 0, shootingTimer, true), 4)); + float pushOut = MathHelper.Lerp(0.2f, 1.5f, (float)Math.Pow(Utils.GetLerpValue(thrustCuttoff, palmAnimTime, shootingTimer, true), 5)); + float thrustMult = (float)(forcePalm ? (shootingTimer <= thrustCuttoff ? pullBack : pushOut) : 1); + Vector2 thrustAddition = vel * 10 * thrustMult - vel * 10; + + Main.EntitySpriteDraw(texture, drawPosition + thrustAddition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + for (int i = 0; i < 5; i++) + { + float fingerLength = 3f * Projectile.scale; + Vector2 fingerScale = new Vector2(1f, 1f) * Projectile.scale; + Vector2 fingerOrgin = new Vector2(0, finger.Height / 2); + + float rot = i switch + { + 1 => f4r * Projectile.direction, + 2 => f3r * Projectile.direction, + 3 => f2r * Projectile.direction, + 4 => f1r * Projectile.direction, + _ => -f5r * 0.3f * Projectile.direction, + }; + float fx = i switch + { + 1 => f4x, 2 => f3x, 3 => f2x, 4 => f1x, _ => f5x, + }; + Color fingerColor = Color.Lerp(drawColor, Color.Black, (4 - i) * 0.2f); + if (i == 0) + { + fingerScale = new Vector2(0.9f, 1f) * Projectile.scale; + fingerLength = 1f * Projectile.scale; + fingerColor = drawColor; + } + + Vector2 basePosition = handPos + vel * (i == 0 ? 2.5f : 3.3f) * Projectile.scale + thrustAddition + (alteredRotation + rot).ToRotationVector2() * fingerLength + (alteredRotation + MathHelper.PiOver2 * -Projectile.direction).ToRotationVector2() * (i == 0 ? -3 : 3) * Projectile.scale; + Main.EntitySpriteDraw(finger, basePosition - Main.screenPosition, null, fingerColor, alteredRotation + rot, fingerOrgin, fingerScale, SpriteEffects.None); + + Vector2 velocity = (alteredRotation + rot).ToRotationVector2(); + Main.EntitySpriteDraw(laser, basePosition - Main.screenPosition + velocity * 545 * Projectile.scale, null, Effects.ArsenalEffects.ArsenalLaserColor with { A = 0 } * fx, velocity.ToRotation() + MathHelper.PiOver2, laser.Size() / 2, new Vector2(2.5f * randSize * fx, 55f) * Projectile.scale * 0.01f, SpriteEffects.FlipVertically); + Main.EntitySpriteDraw(laser2, basePosition - Main.screenPosition + velocity * 545 * Projectile.scale, null, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, 0.3f) with { A = 0 } * fx, velocity.ToRotation() + MathHelper.PiOver2, laser2.Size() / 2, new Vector2(0.4f * Math.Min(fx, 1), 55f) * Projectile.scale * 0.01f, SpriteEffects.FlipVertically); + + for (int y = 0; y < 2; y++) + Main.EntitySpriteDraw(bloom, basePosition - Main.screenPosition + velocity * 7 * Projectile.scale, null, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, y) with { A = 0 } * (fx - 1), velocity.ToRotation() + MathHelper.PiOver2, bloom.Size() / 2, new Vector2(2 + 0.05f * (fx + 25), 1) * Projectile.scale * MathHelper.Lerp(fx, 1, 0.7f) * (0.03f - 0.01f * y), SpriteEffects.FlipVertically); + } + if (forcePalm) + { + for (int y = 0; y < 8; y++) + Main.EntitySpriteDraw(bloom, palmBlastPos - Main.screenPosition + thrustAddition, null, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, y * 0.1f) with { A = 0 } * fadeIn * 0.25f, alteredRotation, bloom.Size() / 2, new Vector2(1f, 1f) * Projectile.scale * (0.3f - 0.02f * y) * randSize, SpriteEffects.FlipVertically); + } + return false; + } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + behindNPCsAndTiles.Add(index); + } + } +} diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.png b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.png new file mode 100644 index 0000000000..389b6646b7 Binary files /dev/null and b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.png differ diff --git a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs new file mode 100644 index 0000000000..fd31cc8a9b --- /dev/null +++ b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs @@ -0,0 +1,93 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +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.DraedonsArsenal +{ + public class CountermeasurePalmBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public float fade => (float)Math.Pow(Utils.GetLerpValue(0, 13, Projectile.timeLeft, true), 4); + public bool onSpawn = true; + private NPC targeted = null; + public override void SetDefaults() + { + Projectile.width = 150; + Projectile.height = 150; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.penetrate = -1; + Projectile.timeLeft = 15; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, Effects.ArsenalEffects.ArsenalLaserColor.ToVector3() * 0.5f); + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (Projectile.ai[1] != -5) + targeted = Main.npc[(int)Projectile.ai[1]]; + if (targeted == null || !targeted.active) + { + targeted = Projectile.Center.ClosestNPCAt(150); + Projectile.ai[1] = -5; + } + if (time == 0) + { + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 25; + targeted.MoveNPC(launchVel, launchPower, true); + + Particle bloom = new CustomSpark(Projectile.Center, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, "CalamityMod/Particles/BloomCircle", false, 12, 0.7f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(1f, 3f), true, true, shrinkSpeed: -0.5f, extraRotation: MathHelper.PiOver2); + GeneralParticleHandler.SpawnParticle(bloom); + } + time++; + } + + public override bool? CanHitNPC(NPC target) => (target == targeted) ? null : false; + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + float minMult = 0.25f; + int hitsToMinMult = 7; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult + critDamage; + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 40; + target.MoveNPC(launchVel, launchPower, true); + } + public override bool PreDraw(ref Color lightColor) + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Texture2D beam = ModContent.Request("CalamityMod/Particles/BloomLineFade").Value; + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + float completion = Utils.GetLerpValue(15, 0, time); + for (int i = 0; i < 6; i++) + { + Color orbColor = Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, i * 0.04f) with { A = 0 } * 0.8f; + float scale = Projectile.scale * (0.05f + i * 0.01f) * 3; + + Main.EntitySpriteDraw(beam, Projectile.Center - Main.screenPosition, null, orbColor, Projectile.rotation, new Vector2(beam.Width / 2, beam.Height), new Vector2(0.3f * fade, 2 * completion) * scale, SpriteEffects.None); + Main.EntitySpriteDraw(bloom, Projectile.Center - Main.screenPosition, null, orbColor, Projectile.rotation + MathHelper.PiOver2, bloom.Size() * 0.5f, new Vector2(0.5f, 1 + 2 * completion) * scale * 3 * fade, SpriteEffects.None); + } + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs deleted file mode 100644 index afe5e4399e..0000000000 --- a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using CalamityMod.Items; -using CalamityMod.Items.Weapons.DraedonsArsenal; -using Microsoft.Xna.Framework; -using ReLogic.Utilities; -using Terraria; -using Terraria.Audio; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.DraedonsArsenal -{ - public class GatlingLaserProj : ModProjectile - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - private SlotId gatlingLaserLoopID; - private bool fireLasers = false; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - } - - public override void SetDefaults() - { - Projectile.width = 24; - Projectile.height = 58; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.DamageType = DamageClass.Magic; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter >= 13) - { - Projectile.frameCounter = 10; - Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Type]) - Projectile.frame = 0; - } - - if (SoundEngine.TryGetActiveSound(gatlingLaserLoopID, out var ShootingSound) && ShootingSound.IsPlaying) - ShootingSound.Position = Projectile.Center; - Player player = Main.player[Projectile.owner]; - Vector2 playerRotation = player.RotatedRelativePoint(player.MountedCenter, true); - if (Projectile.type == ModContent.ProjectileType()) - { - if (Projectile.ai[0] < 5f) - Projectile.ai[0] += 1f; - - if (Projectile.ai[0] > 4f) - Projectile.ai[0] = 2f; - - // The Gatling Laser shoots every other frame (effective use time of 2). - int fireRate = 2; - Projectile.ai[1] += 1f; - bool shootThisFrame = false; - if (Projectile.ai[1] >= fireRate) - { - Projectile.ai[1] = 0f; - shootThisFrame = true; - } - - if (Projectile.soundDelay <= 0) - { - Projectile.soundDelay = fireRate * 6; - if (Projectile.ai[0] != 1f) - { - fireLasers = true; - Projectile.soundDelay *= 6; - gatlingLaserLoopID = SoundEngine.PlaySound(GatlingLaser.FireLoopSound, Projectile.Center); - } - } - if (shootThisFrame && Main.myPlayer == Projectile.owner && fireLasers) - { - Item gatling = player.ActiveItem(); - - // This grabs the weapon's current damage, taking current charge level into account. - int currentDamage = player.GetWeaponDamage(gatling); - - bool stillInUse = !player.CantUseHoldout(); - - // This both checks if the player has sufficient mana and consumes it if they do. - // If this is false, the Gatling Laser stops functioning. - bool hasMana = player.CheckMana(gatling, -1, true, false); - - // Checks if the Gatling Laser has sufficient charge to fire. If this is false, it stops functioning. - CalamityGlobalItem modItem = gatling.Calamity(); - bool hasCharge = modItem.Charge >= GatlingLaser.HoldoutChargeUse; - - if (stillInUse && hasMana && hasCharge) - { - float scaleFactor = player.ActiveItem().shootSpeed * Projectile.scale; - Vector2 laserDirection = playerRotation; - Vector2 aimDirection = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY) - laserDirection; - if (player.gravDir == -1f) - { - aimDirection.Y = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - laserDirection.Y; - } - Vector2 projVelocity = Vector2.Normalize(aimDirection); - if (float.IsNaN(projVelocity.X) || float.IsNaN(projVelocity.Y)) - { - projVelocity = -Vector2.UnitY; - } - projVelocity *= scaleFactor; - if (projVelocity.X != Projectile.velocity.X || projVelocity.Y != Projectile.velocity.Y) - { - Projectile.netUpdate = true; - } - Projectile.velocity = projVelocity; - int type = ModContent.ProjectileType(); - float velocity = 3f; - laserDirection = Projectile.Center; - Vector2 spinningpoint = Vector2.Normalize(Projectile.velocity) * velocity; - - double spread = Math.PI / 32D; - spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 2D * spread - spread); - - if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) - { - spinningpoint = -Vector2.UnitY; - } - Vector2 projVelocitySpread = new Vector2(spinningpoint.X, spinningpoint.Y); - if (projVelocitySpread.Length() > 5f) - { - projVelocitySpread.Normalize(); - projVelocitySpread *= 5f; - } - float SpeedX = projVelocitySpread.X + Main.rand.Next(-1, 2) * 0.005f; - float SpeedY = projVelocitySpread.Y + Main.rand.Next(-1, 2) * 0.005f; - float ai0 = Projectile.ai[0] - 2f; // 0, 1, or 2 - - // Use charge when firing a laser. - modItem.Charge -= GatlingLaser.HoldoutChargeUse; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserDirection.X, laserDirection.Y, SpeedX, SpeedY, type, currentDamage, Projectile.knockBack, Projectile.owner, ai0, 0f); - } - else - { - ActiveSound result; - if (SoundEngine.TryGetActiveSound(gatlingLaserLoopID, out result)) - result.Stop(); - - SoundEngine.PlaySound(GatlingLaser.FireEndSound, Projectile.Center); - Projectile.Kill(); - } - } - } - Projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - Projectile.Size / 2f; - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - 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/DraedonsArsenal/GatlingLaserProj.png b/Projectiles/DraedonsArsenal/GatlingLaserProj.png deleted file mode 100644 index c4b477bdc8..0000000000 Binary files a/Projectiles/DraedonsArsenal/GatlingLaserProj.png and /dev/null differ diff --git a/Projectiles/DraedonsArsenal/GatlingLaserShot.cs b/Projectiles/DraedonsArsenal/GatlingLaserShot.cs deleted file mode 100644 index f1292b9b35..0000000000 --- a/Projectiles/DraedonsArsenal/GatlingLaserShot.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using ReLogic.Utilities; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.DraedonsArsenal -{ - public class GatlingLaserShot : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Misc"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - private int dust = 182; - private Player Owner => Main.player[Projectile.owner]; - - private int Time = 0; - - public override void SetDefaults() - { - Projectile.width = 2; - Projectile.height = 2; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 1; - Projectile.extraUpdates = 100; - Projectile.timeLeft = 600; - } - - public override void AI() - { - Time++; - Lighting.AddLight(Projectile.Center, 0.2f, 0f, 0f); - if (Projectile.timeLeft % 11 == 0 && Time > 15 && Time < 460) - { - SparkParticle spark = new SparkParticle(Projectile.Center, Projectile.velocity * 0.01f, false, 6, 1.7f, Color.Red); - GeneralParticleHandler.SpawnParticle(spark); - } - if (Projectile.timeLeft % 4 == 0 && Time > 15 && Time < 460) - { - SparkParticle spark2 = new SparkParticle(Projectile.Center, Projectile.velocity * 0.01f, false, 6, 0.4f, Color.White); - GeneralParticleHandler.SpawnParticle(spark2); - } - } - - public override void OnKill(int timeLeft) - { - int height = 20; - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = height; - Projectile.Center = Projectile.position; - Projectile.damage = 0; - - LaserBurst(2.4f, 4.2f); // 60 dusts - - int inc; - for (int i = 0; i < 100; i = inc + 1) - { - int gatlingDust = Dust.NewDust(Projectile.Center, 6, 6, dust, 0f, 0f, 100, default, 1f); - float dustVelX = Main.dust[gatlingDust].velocity.X; - float dustVelY = Main.dust[gatlingDust].velocity.Y; - - if (dustVelX == 0f && dustVelY == 0f) - dustVelX = 1f; - - float dustVelocity = (float)Math.Sqrt(dustVelX * dustVelX + dustVelY * dustVelY); - dustVelocity = 4f / dustVelocity; - dustVelX *= dustVelocity; - dustVelY *= dustVelocity; - - Dust dust2 = Main.dust[gatlingDust]; - dust2.velocity *= 0.5f; - dust2.velocity.X = dust2.velocity.X + dustVelX; - dust2.velocity.Y = dust2.velocity.Y + dustVelY; - dust2.scale = 0.66f; - dust2.noGravity = true; - - inc = i; - } - } - - private void LaserBurst(float speed1, float speed2) - { - float angleRandom = 0.05f; - - int inc; - for (int j = 0; j < 4; j = inc + 1) - { - float dustSpeed = Main.rand.NextFloat(speed1, speed2); - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - int burstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 200, default, 0.9f); - Main.dust[burstDust].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; - Main.dust[burstDust].noGravity = true; - - Dust dust2 = Main.dust[burstDust]; - dust2.velocity *= 3f; - dust2 = Main.dust[burstDust]; - - burstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 100, default, 0.66f); - Main.dust[burstDust].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; - - dust2 = Main.dust[burstDust]; - dust2.velocity *= 2f; - - Main.dust[burstDust].noGravity = true; - Main.dust[burstDust].fadeIn = 1f; - Main.dust[burstDust].color = Color.Crimson * 0.5f; - - dust2 = Main.dust[burstDust]; - - inc = j; - } - for (int k = 0; k < 2; k = inc + 1) - { - float dustSpeed = Main.rand.NextFloat(speed1, speed2); - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - int moreBurstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 0, default, 1.2f); - Main.dust[moreBurstDust].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; - Main.dust[moreBurstDust].noGravity = true; - - Dust dust2 = Main.dust[moreBurstDust]; - dust2.velocity *= 0.5f; - dust2 = Main.dust[moreBurstDust]; - - inc = k; - } - } - } -} diff --git a/Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs b/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs similarity index 98% rename from Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs rename to Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs index 4e18c7eadf..e1c2f33af3 100644 --- a/Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs +++ b/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs @@ -11,10 +11,10 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal { - public class HolofiberImmolatorHoldout : BaseGunHoldoutProjectile + public class HolofibreImmolatorHoldout : BaseGunHoldoutProjectile { public new string LocalizationCategory => "Projectiles.Misc"; - public override int AssociatedItemID => ModContent.ItemType(); + public override int AssociatedItemID => ModContent.ItemType(); public override float MaxOffsetLengthFromArm => 15f; public override float OffsetXUpwards => -0f; public override float BaseOffsetY => -0f; @@ -167,8 +167,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal float fade = Utils.GetLerpValue(chargeMax / 3, chargeMax, CurrentChargingFrames, true); - Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolator").Value; - Texture2D glowTexture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow").Value; + Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofibreImmolator").Value; + Texture2D glowTexture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow").Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Color drawColor = Projectile.GetAlpha(lightColor); float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); diff --git a/Projectiles/DraedonsArsenal/ImmolationArrow.cs b/Projectiles/DraedonsArsenal/ImmolationArrow.cs index 313f5887a1..ec64b427de 100644 --- a/Projectiles/DraedonsArsenal/ImmolationArrow.cs +++ b/Projectiles/DraedonsArsenal/ImmolationArrow.cs @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal collideWithTiles = false; SoundStyle sound2 = new("CalamityMod/Sounds/Item/ImmolatorPreExplode"); SoundEngine.PlaySound(sound2 with { Volume = 0.3f, Pitch = 0.5f }, Projectile.Center); - SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); + SoundEngine.PlaySound(HolofibreImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) @@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorPreExplode"); SoundEngine.PlaySound(sound with { Volume = 0.3f, Pitch = 0.5f }, Projectile.Center); - SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); + SoundEngine.PlaySound(HolofibreImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); } } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/ImmolationSpray.cs b/Projectiles/DraedonsArsenal/ImmolationSpray.cs index d30ccaafbd..91349cf6b1 100644 --- a/Projectiles/DraedonsArsenal/ImmolationSpray.cs +++ b/Projectiles/DraedonsArsenal/ImmolationSpray.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); + SoundEngine.PlaySound(HolofibreImmolator.PlasmaSound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.8f); diff --git a/Projectiles/DraedonsArsenal/MountedScannerSummon.cs b/Projectiles/DraedonsArsenal/MountedScannerSummon.cs index e925397619..3ccb38ab25 100644 --- a/Projectiles/DraedonsArsenal/MountedScannerSummon.cs +++ b/Projectiles/DraedonsArsenal/MountedScannerSummon.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.NeedsUUID[Type] = true; @@ -114,6 +115,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, Projectile.Center); } } - public override bool? CanDamage() => false; } } diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index 9501d9e619..bc3e1aa9ec 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 0; @@ -173,6 +174,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Texture2D tex = TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index fc95a46d89..e9a7232cdd 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -237,8 +238,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void OnSpawn(IEntitySource source) => DoVFXPulse(); - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs index 526dcb0227..e5c35b3a87 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { Main.projFrames[Type] = 12; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -292,7 +293,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal fallThrough = Projectile.Bottom.Y < FallThroughYPoint - 120f; return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/DraedonsArsenal/VulcanFlash.png b/Projectiles/DraedonsArsenal/VulcanFlash.png new file mode 100644 index 0000000000..3fc2d1e1d9 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanFlash.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldout.cs b/Projectiles/DraedonsArsenal/VulcanHoldout.cs new file mode 100644 index 0000000000..c2805e2ff1 --- /dev/null +++ b/Projectiles/DraedonsArsenal/VulcanHoldout.cs @@ -0,0 +1,268 @@ +using System; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class VulcanHoldout : BaseGunHoldoutProjectile + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override int AssociatedItemID => ModContent.ItemType(); + + public float offsetBase = 35; + public override float MaxOffsetLengthFromArm => offsetBase; + public override float RecoilResolveSpeed => 0.2f; + public override float OffsetXUpwards => 0f; + public override float BaseOffsetY => 0f; + public override float OffsetYDownwards => 0f; + public override float WeaponTurnSpeed => (shootingTimer < 0 ? 0 : 0.35f); + public bool firingSpear => Projectile.ai[2] == 5; + public ref float shootingTimer => ref Projectile.ai[0]; + public ref float fireRate => ref Projectile.ai[1]; + public int time = 0; + public int maxShots = 25; + public int shotsToFire = 0; + public bool playRampDown = false; + public int shotsFired = 0; + public float heatVis = 0; + public float flashVis1 = 0; + public float flashVis2 = 0; + public float spearVis = 1; + public int cooldownGiven = 180; + public bool failedManaCheck = false; + public int spearFakeCooldown = 0; + + + public override void KillHoldoutLogic() + { + + } + public override void HoldoutAI() + { + if (flashVis1 > 0) flashVis1 -= 0.2f; if (flashVis1 < 0) flashVis1 = 0; + if (flashVis2 > 0) flashVis2 -= 0.2f; if (flashVis2 < 0) flashVis2 = 0; + + if (time == 0) + { + if (Owner.Calamity().arsenalCooldown > 0) + spearVis = 0; + shootingTimer = -20; + fireRate = Owner.HeldItem.useAnimation; + shotsToFire = maxShots; + OffsetLengthFromArm = offsetBase; + } + if (shootingTimer < 0) + { + // Light cooldown after firing + if (shootingTimer == -20 || shootingTimer == -1) + { + if ((!Main.mouseLeft && !firingSpear) || failedManaCheck) + { + Projectile.Kill(); + return; + } + } + if (playRampDown) + { + SoundStyle sound = new("CalamityMod/Sounds/Item/VulcanRampDown"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound with { Volume = 0.9f, MaxInstances = -1 }, Projectile.Center); + playRampDown = false; + } + if (shootingTimer == -20) + { + SoundStyle sound2 = new("CalamityMod/Sounds/Item/VulcanRampUp"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound2 with { Volume = 0.9f, MaxInstances = -1 }, Projectile.Center); + } + if (shootingTimer == -1) + { + if (!firingSpear) + shootingTimer = fireRate; + else + shootingTimer = 0; + shotsToFire = maxShots; + fireRate = Owner.HeldItem.useAnimation; + shotsFired = 0; + playRampDown = true; + } + Projectile.velocity = Owner.Center.DirectionTo(Owner.Calamity().mouseWorld); + } + if (Owner.Calamity().mouseRight && Owner.Calamity().arsenalCooldown <= 0) + { + Projectile.ai[2] = 5; + } + if (firingSpear && time > 20 && spearFakeCooldown <= 0) + { + Shoot(true); + spearFakeCooldown = 5; + shotsToFire = maxShots; + Projectile.ai[2] = 0; + Owner.Calamity().arsenalCooldown = cooldownGiven; + Owner.AddCooldown(ArsenalPower.ID, cooldownGiven); + } + if (shootingTimer >= 0) + { + if (!Main.mouseLeft && !firingSpear) + shotsToFire = 0; + + if (!firingSpear) + { + if (shotsToFire <= 0) + shootingTimer = -50; + else if (shootingTimer >= fireRate) + { + if (Owner.CheckMana(HeldItem, -1, true, false)) + { + Shoot(false); + + if (shotsFired % 2 == 0) flashVis1 = 1; + else flashVis2 = 1; + + shootingTimer = -1; + if (shotsToFire > maxShots * 0.2f) + { + fireRate -= 1; + if (fireRate < 3) + fireRate = 3; + } + else if (fireRate < Owner.HeldItem.useAnimation) + fireRate += 1; + if (fireRate > Owner.HeldItem.useAnimation) + fireRate = Owner.HeldItem.useAnimation; + + } + else + { + failedManaCheck = true; + shotsToFire = 0; + } + + shotsToFire--; + shotsFired++; + if (shotsToFire <= 0) + { + shootingTimer = -50; + } + } + } + } + if (shotsFired > 0 && shotsToFire > 0) + { + heatVis = MathHelper.Lerp(heatVis, 1, 0.007f); + } + else + heatVis = MathHelper.Lerp(heatVis, 0, 0.085f); + + spearVis = Utils.GetLerpValue(cooldownGiven / 2, 0, Owner.Calamity().arsenalCooldown, true); + spearFakeCooldown--; + + time++; + shootingTimer++; + } + public void Shoot(bool isSpear) + { + if (isSpear) + { + Vector2 spearPos = GunTipPosition + Projectile.velocity.RotatedBy(MathHelper.PiOver2 * Projectile.direction) * 12 - Projectile.velocity * 8; + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0f) * 6f; + Owner.Calamity().GeneralScreenShakePower = 3.5f; + OffsetLengthFromArm -= 16; + SoundStyle sound = new("CalamityMod/Sounds/Item/GunShotHeavy"); + SoundEngine.PlaySound(sound with { Volume = 0.8f, Pitch = 0.8f }, Projectile.Center); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spearPos, shootVelocity, ModContent.ProjectileType(), Projectile.damage * 5, 0, Projectile.owner); + } + else + { + Owner.Calamity().GeneralScreenShakePower = 1f; + OffsetLengthFromArm -= 7; + SoundStyle sound = new("CalamityMod/Sounds/Item/VulcanShot"); + SoundEngine.PlaySound(sound with { Volume = 0.6f, Pitch = Main.rand.NextFloat(-0.1f, 0), MaxInstances = 1 }, Projectile.Center); + + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0f) * 6f; + Vector2 position = GunTipPosition + Projectile.velocity.RotatedBy(MathHelper.PiOver2 * (shotsFired % 2 == 0 ? -1 : 1)) * 4; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, shootVelocity, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner); + + for (int i = 0; i < 4; i++) + { + Dust dust = Dust.NewDustPerfect(position, Main.rand.NextBool(3) ? ModContent.DustType() : Effects.ArsenalEffects.ArsenalGaussDust, (shootVelocity * 4).RotatedByRandom(0.05f) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(0.7f, 1.1f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + } + } + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 2) + return false; + + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldout").Value; + Texture2D glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutGlow").Value; + Texture2D flash = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanFlash").Value; + Texture2D spear = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpear").Value; + Texture2D spearGlow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpearGlow").Value; + Texture2D heat = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip").Value; + if (Owner.Calamity().arsenalCooldown <= 0 && false) + { + texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutSpear").Value; + glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow").Value; + } + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + float randSize = Main.rand.NextFloat(0.9f, 1f); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Projectile.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + int draws = 8; + + Vector2 spearPos = GunTipPosition + vel.RotatedBy(MathHelper.PiOver2 * Projectile.direction) * 12 - vel * 27 - Main.screenPosition; + for (int i = 0; i < draws; i++) + { + float fadeIn = Math.Min(Utils.GetLerpValue(0, 0.8f, spearVis), (float)Math.Pow(Utils.GetLerpValue(1, 0.8f, spearVis), 2)); + Vector2 offset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 6 * (1 - spearVis); + Main.EntitySpriteDraw(spear, spearPos + offset, null, Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * fadeIn * 0.5f, drawRotation, spear.Size() * 0.5f, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(spear, spearPos, null, Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }, drawColor, spearVis) * spearVis, drawRotation, spear.Size() * 0.5f, Projectile.scale, flipSprite); + } + Main.EntitySpriteDraw(spearGlow, spearPos, null, Color.White * spearVis, drawRotation, spearGlow.Size() * 0.5f, Projectile.scale, flipSprite); + + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + Main.EntitySpriteDraw(glow, drawPosition, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + for (int i = 0; i < draws; i++) + { + Vector2 offset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 4 * heatVis; + Main.EntitySpriteDraw(heat, drawPosition + offset, null, Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * heatVis * 0.35f, drawRotation, heat.Size() * 0.5f, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(heat, drawPosition, null, Color.White with { A = 0 } * heatVis * 0.3f, drawRotation, heat.Size() * 0.5f, Projectile.scale, flipSprite); + } + + float tipSeperation = 4; + // Tip flash 1 + if (flashVis1 > 0) + { + Vector2 position = GunTipPosition + vel * (12 + 30 * (1 - flashVis1)) + vel.RotatedBy(MathHelper.PiOver2) * tipSeperation - Main.screenPosition; + for (int i = 0; i < 3; i++) + Main.EntitySpriteDraw(flash, position, null, Color.White with { A = 0 } * flashVis1, drawRotation, flash.Size() * 0.5f, new Vector2(0.5f + 2f * (1 - flashVis1), 1 - 0.8f * flashVis1) * Projectile.scale, flipSprite); + } + // Tip flash 1 + if (flashVis2 > 0) + { + Vector2 position = GunTipPosition + vel * (12 + 30 * (1 - flashVis2)) + vel.RotatedBy(-MathHelper.PiOver2) * tipSeperation - Main.screenPosition; + for (int i = 0; i < 3; i++) + Main.EntitySpriteDraw(flash, position, null, Color.White with { A = 0 } * flashVis2, drawRotation, flash.Size() * 0.5f, new Vector2(0.5f + 2f * (1 - flashVis2), 1 - 0.8f * flashVis2) * Projectile.scale, flipSprite); + } + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/VulcanHoldout.png b/Projectiles/DraedonsArsenal/VulcanHoldout.png new file mode 100644 index 0000000000..3df7e215ab Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldout.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutGlow.png b/Projectiles/DraedonsArsenal/VulcanHoldoutGlow.png new file mode 100644 index 0000000000..5a1c73ba6c Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutGlow.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip.png b/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip.png new file mode 100644 index 0000000000..a6efb3b878 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutSpear.png b/Projectiles/DraedonsArsenal/VulcanHoldoutSpear.png new file mode 100644 index 0000000000..5a4cb9de3d Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutSpear.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow.png b/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow.png new file mode 100644 index 0000000000..3eaba56e73 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanProjectile.cs b/Projectiles/DraedonsArsenal/VulcanProjectile.cs new file mode 100644 index 0000000000..8f805e1a94 --- /dev/null +++ b/Projectiles/DraedonsArsenal/VulcanProjectile.cs @@ -0,0 +1,116 @@ +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 VulcanProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float time => ref Projectile.ai[0]; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.timeLeft = 720; + Projectile.extraUpdates = 8; + Projectile.penetrate = 1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20 * Projectile.MaxUpdates; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (time > 120 && Projectile.penetrate > 1) + Projectile.penetrate = 1; + + if (time > 60 && Projectile.extraUpdates > 2 && time % 4 == 0) + Projectile.extraUpdates--; + + if (Projectile.velocity.Length() < 5) + Projectile.velocity *= 1.01f; + if (targetDist < 1400) + { + if (true) + { + Particle trail = new CustomSpark(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 6, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 6, 0.15f, Effects.ArsenalEffects.ArsenalGaussColor * 0.9f, new Vector2(1f, 1f), true, true, glowCenterScale: 0.6f, glowOpacity: 0.8f, shrinkSpeed: 0.9f); + GeneralParticleHandler.SpawnParticle(trail); + } + if (time % 17 == 0) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(4, 4), Effects.ArsenalEffects.ArsenalGaussDust); + dust.velocity = Vector2.One.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(0.1f, 0.2f); + dust.scale = Main.rand.NextFloat(0.7f, 0.85f); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + dust.noLightEmittence = time % 9 != 0; + dust.fadeIn = 0.3f; + } + } + + time++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + impactDust(); + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 4; + target.MoveNPC(launchVel, launchPower, true); + } + + public override void OnKill(int timeLeft) + { + impactDust(); + } + public void impactDust() + { + for (int i = 0; i < 3; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType()); + dust.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.1f) * Main.rand.NextFloat(9f, 19f); + dust.scale = Main.rand.NextFloat(0.6f, 0.85f); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + dust.noLightEmittence = true; + } + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D proj = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanProjectile").Value; + proj = ModContent.Request("CalamityMod/Particles/SquareRotated").Value; + + Texture2D square = ModContent.Request("CalamityMod/Particles/GlowSquareParticleThick").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }; + float drawRotation = Projectile.velocity.ToRotation(); + Vector2 rotationPoint = proj.Size() * 0.5f; + + int rate = 50; + + float shrink = Utils.GetLerpValue(rate - 1, 0, time % rate); + float fade = Math.Min((float)Math.Pow(Utils.GetLerpValue(0, rate * 0.8f, time % rate, true), 3), (float)Math.Pow(Utils.GetLerpValue(rate - 1, rate * 0.8f, time % 30, true), 3)); + float speed = Utils.GetLerpValue(2, 10, Projectile.extraUpdates); + Vector2 squash = new Vector2(1 + 2 * speed, 1 - 0.3f * speed); + + for (int i = 0; i < 2; i++) + Main.EntitySpriteDraw(square, drawPosition, null, drawColor * fade * (1 - speed), drawRotation + MathHelper.PiOver4, square.Size() * 0.5f, Projectile.scale * (0.05f + 0.2f * shrink), SpriteEffects.None); + + + Main.EntitySpriteDraw(proj, drawPosition, null, drawColor, drawRotation, rotationPoint, squash * Projectile.scale * 0.1f, SpriteEffects.None); + Main.EntitySpriteDraw(proj, drawPosition, null, Color.White with { A = 0 }, drawRotation, rotationPoint, squash * Projectile.scale * 0.06f, SpriteEffects.None); + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/VulcanProjectile.png b/Projectiles/DraedonsArsenal/VulcanProjectile.png new file mode 100644 index 0000000000..f5adc1fd7f Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanProjectile.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanSpear.cs b/Projectiles/DraedonsArsenal/VulcanSpear.cs new file mode 100644 index 0000000000..3d9bc39047 --- /dev/null +++ b/Projectiles/DraedonsArsenal/VulcanSpear.cs @@ -0,0 +1,199 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class VulcanSpear : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float time => ref Projectile.ai[0]; + + public NPC targeted; + public bool stuckInGround = false; + public bool canDamage => (targeted == null && !stuckInGround); + public bool canStick = true; + public int stuckTimer = 420; + public Vector2 placementCenter; + Vector2 placementVelocity; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 35; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.timeLeft = 1200; + Projectile.extraUpdates = 30; + 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); + + Lighting.AddLight(Projectile.Center, Effects.ArsenalEffects.ArsenalGaussColor.ToVector3() * 0.5f); + if (targetDist < 1400 && canDamage) + { + if (time % 2 == 0) + { + Particle trail = new CustomSpark(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 14, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 12, 0.065f, Effects.ArsenalEffects.ArsenalGaussColor, new Vector2(1f, 2.5f), true, true, glowCenterScale: 0.7f, shrinkSpeed: 0.4f); + GeneralParticleHandler.SpawnParticle(trail); + } + } + + if (!stuckInGround && targeted == null && Collision.SolidCollision(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 15, 6, 6)) + { + Projectile.extraUpdates = 0; + stuckInGround = true; + SoundStyle hitTile = new("CalamityMod/Sounds/NPCHit/ExoHit3"); + SoundEngine.PlaySound(hitTile with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center); + //Get stuck in the ground and fade + } + if (targeted != null && (!targeted.active || targeted.life <= 0)) + targeted = null; + if (targeted != null) + { + Projectile.Center = targeted.Center - placementCenter; + } + else if (Projectile.numHits > 0) + { + Projectile.timeLeft = 1; + } + if (stuckInGround || targeted != null) + { + foreach (Projectile p in Main.ActiveProjectiles) + { + float dist = Utils.Distance(Projectile.Center, p.Center); + if (p.type == ModContent.ProjectileType() && dist <= 900 && p.ai[0] > 120) + { + if (p.velocity.Length() < 6) + p.velocity += p.Center.DirectionTo(Projectile.Center) * Utils.GetLerpValue(1500, 50, dist) * 0.9f; + else + p.velocity *= 0.9f; + if (p.ai[0] % 2 == 0) + p.timeLeft += p.MaxUpdates; + } + } + } + if (!canDamage && Projectile.timeLeft > 300) + Projectile.timeLeft = 300; + time++; + if (Projectile.timeLeft == 35) + { + SoundStyle sound2 = new("CalamityMod/Sounds/Item/VulcanRampUp"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound2 with { Volume = 0.9f, MaxInstances = 5, Pitch = -0.4f }, Projectile.Center); + } + } + public override void OnKill(int timeLeft) + { + SoundStyle die = new("CalamityMod/Sounds/NPCHit/ExoHit2"); + SoundEngine.PlaySound(die with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.4f, 0.5f), MaxInstances = 5 }, Projectile.Center); + SoundStyle sound2 = new("CalamityMod/Sounds/Item/NidhoggFire"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound2 with { Volume = 0.8f, MaxInstances = 5, Pitch = -0.1f }, Projectile.Center); + foreach (Projectile p in Main.ActiveProjectiles) + { + float dist = Utils.Distance(Projectile.Center, p.Center); + if (p.type == ModContent.ProjectileType() && dist <= 500) + { + NPC closeTarget = p.Center.ClosestNPCAt(800); + if (closeTarget != null) + p.velocity = p.Center.DirectionTo(closeTarget.Center) * 7; + else + p.velocity = Projectile.Center.DirectionTo(p.Center) * 7; + p.extraUpdates = 8; + p.ai[0] = 0; + p.penetrate = 5; + if (p.ai[1] < 4) // Pretty much just so gfb can't oneshot everything + { + p.damage = (int)(p.damage * 2f); + p.ai[1]++; + } + p.timeLeft = Main.rand.Next(100, 120 + 1); + } + } + Particle bolt = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalGaussColor, "CalamityMod/Particles/GlowSquareParticleThick", Vector2.One, MathHelper.PiOver4, 0.1f, 0.7f, 15); + GeneralParticleHandler.SpawnParticle(bolt); + Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalGaussColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, 0, 0.3f, 1.15f, 10); + GeneralParticleHandler.SpawnParticle(bolt2); + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + impactDust(); + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 12; + target.MoveNPC(launchVel, launchPower, true); + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (target.life <= 0 && target.realLife == -1) + { + // Don't stick into dead enemies + Projectile.numHits--; + } + else if (targeted == null && !stuckInGround) + { + //Stick + Projectile.extraUpdates = 0; + SoundStyle hitTile = new("CalamityMod/Sounds/NPCHit/ExoHit1"); + SoundEngine.PlaySound(hitTile with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center); + targeted = target; + placementCenter = targeted.Center - Projectile.Center; + } + } + public override bool? CanDamage() => canDamage ? null : false; + public override bool ShouldUpdatePosition() + { + return canDamage; + } + public void impactDust() + { + for (int i = 0; i < 7; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType()); + dust.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.15f) * Main.rand.NextFloat(12f, 19f); + dust.scale = Main.rand.NextFloat(0.8f, 1.35f); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + dust.noLightEmittence = true; + } + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D proj = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpear").Value; + Texture2D glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpearGlow").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }; + float drawRotation = Projectile.velocity.ToRotation() + (Projectile.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = proj.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(proj, drawPosition, null, lightColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(glow, drawPosition, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + int draws = 16; + for (int i = 0; i < draws; i++) + { + float fadeIn = (float)Math.Pow(Utils.GetLerpValue(300, 1, Projectile.timeLeft, true), 3); + Vector2 offset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 3 * fadeIn; + Main.EntitySpriteDraw(proj, Projectile.Center - Main.screenPosition + offset + Main.rand.NextVector2Circular(3, 3) * fadeIn, null, Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * fadeIn * 0.5f, drawRotation, proj.Size() * 0.5f, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(proj, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 } * fadeIn, drawRotation, proj.Size() * 0.5f, Projectile.scale, flipSprite); + } + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/VulcanSpear.png b/Projectiles/DraedonsArsenal/VulcanSpear.png new file mode 100644 index 0000000000..cfcab36090 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanSpear.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanSpearGlow.png b/Projectiles/DraedonsArsenal/VulcanSpearGlow.png new file mode 100644 index 0000000000..c010c5ec95 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanSpearGlow.png differ 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/AltTransfusionTrail.cs b/Projectiles/Healing/AltTransfusionTrail.cs index cb362dbc53..48eec7e713 100644 --- a/Projectiles/Healing/AltTransfusionTrail.cs +++ b/Projectiles/Healing/AltTransfusionTrail.cs @@ -17,13 +17,11 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.extraUpdates = 5; + Projectile.MaxUpdates = 5; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() 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/FungalHeal.cs b/Projectiles/Healing/FungalHeal.cs index 1dcb6e2a4f..bcf3dcdf59 100644 --- a/Projectiles/Healing/FungalHeal.cs +++ b/Projectiles/Healing/FungalHeal.cs @@ -12,18 +12,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; - Projectile.penetrate = 1; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.extraUpdates = 3; - Projectile.timeLeft = 300; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 3f, 15f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 4f, 15f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.BlueFairy, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; 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/Healing/HydrothermicHealOrb.cs b/Projectiles/Healing/HydrothermicHealOrb.cs index e1df042f9f..fc4d2cbd1d 100644 --- a/Projectiles/Healing/HydrothermicHealOrb.cs +++ b/Projectiles/Healing/HydrothermicHealOrb.cs @@ -13,18 +13,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.penetrate = 1; Projectile.tileCollide = false; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 8f, 15f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Healing/ManaPolarizerHealOrb.cs b/Projectiles/Healing/ManaPolarizerHealOrb.cs index 3e06d805f6..a0a0bfcf7f 100644 --- a/Projectiles/Healing/ManaPolarizerHealOrb.cs +++ b/Projectiles/Healing/ManaPolarizerHealOrb.cs @@ -13,18 +13,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.penetrate = 1; Projectile.tileCollide = false; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 5; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 4f, 15f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 6f, 15f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Healing/ReaverHealOrb.cs b/Projectiles/Healing/ReaverHealOrb.cs deleted file mode 100644 index 23d5fb22c0..0000000000 --- a/Projectiles/Healing/ReaverHealOrb.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Healing -{ - public class ReaverHealOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Healing"; - - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; - } - - public override void AI() - { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f); - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GreenFairy, 0f, 0f, 100); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f; - Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f; - } - } -} diff --git a/Projectiles/Healing/RoyalHeal.cs b/Projectiles/Healing/RoyalHeal.cs index 145c21fc49..fb596b3b52 100644 --- a/Projectiles/Healing/RoyalHeal.cs +++ b/Projectiles/Healing/RoyalHeal.cs @@ -13,18 +13,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; Projectile.tileCollide = false; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 5; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 18f, 10f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 12f, 10f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Healing/ShinobiHealOrb.cs b/Projectiles/Healing/ShinobiHealOrb.cs index 7a507a57a0..062146f90e 100644 --- a/Projectiles/Healing/ShinobiHealOrb.cs +++ b/Projectiles/Healing/ShinobiHealOrb.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Healing Projectile.width = Projectile.height = 20; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.penetrate = -1; Projectile.MaxUpdates = 5; Projectile.timeLeft = 120 * Projectile.MaxUpdates; } diff --git a/Projectiles/Healing/SilvaOrb.cs b/Projectiles/Healing/SilvaOrb.cs deleted file mode 100644 index 1d12d7230d..0000000000 --- a/Projectiles/Healing/SilvaOrb.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Healing -{ - public class SilvaOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Healing"; - - public override void SetDefaults() - { - Projectile.width = 22; - Projectile.height = 22; - Projectile.friendly = true; - Projectile.alpha = 255; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; - Projectile.tileCollide = false; - } - - public override void AI() - { - Projectile.alpha -= 2; - if (Projectile.localAI[0] == 0f) - { - Projectile.scale += 0.05f; - if (Projectile.scale > 1.2f) - Projectile.localAI[0] = 1f; - } - else - { - Projectile.scale -= 0.05f; - if (Projectile.scale < 0.8f) - Projectile.localAI[0] = 0f; - } - - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 6f, 15f); - return; - } - - public override Color? GetAlpha(Color lightColor) => new Color(Main.DiscoR, 203, 103, Projectile.alpha); - - public override void OnKill(int timeLeft) - { - for (int i = 0; i < 5; i++) - { - int silvaHeal = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ChlorophyteWeapon, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 1.5f); - Main.dust[silvaHeal].noGravity = true; - Main.dust[silvaHeal].velocity *= 0f; - } - } - } -} diff --git a/Projectiles/Healing/SilvaOrb.png b/Projectiles/Healing/SilvaOrb.png deleted file mode 100644 index 37597f4cad..0000000000 Binary files a/Projectiles/Healing/SilvaOrb.png and /dev/null differ diff --git a/Projectiles/Healing/TransfusionTrail.cs b/Projectiles/Healing/TransfusionTrail.cs index 55d1326d47..289be6034b 100644 --- a/Projectiles/Healing/TransfusionTrail.cs +++ b/Projectiles/Healing/TransfusionTrail.cs @@ -13,13 +13,11 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() diff --git a/Projectiles/Magic/AnahitasArpeggioNote.cs b/Projectiles/Magic/AnahitasArpeggioNote.cs index 2c779ac44d..3d78d39107 100644 --- a/Projectiles/Magic/AnahitasArpeggioNote.cs +++ b/Projectiles/Magic/AnahitasArpeggioNote.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.NPCs; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Systems; using Microsoft.Xna.Framework; +using ReLogic.Utilities; using System; using System.IO; using Terraria; @@ -22,7 +24,9 @@ namespace CalamityMod.Projectiles.Magic public int LingeringTime = 300; public int FadeOutTime = 20; public bool HasSetFadeOutVelocity = false; + public Vector2 ReleaseCenterPoint = Vector2.Zero; public float _randomReleaseRotationOffset; + public SlotId StupidEasterEggSlot; public Player Owner => Main.player[Projectile.owner]; @@ -63,8 +67,23 @@ namespace CalamityMod.Projectiles.Magic Projectile.localAI[0] = 0f; } + // Sound business if (Timer == 1f) - SoundEngine.PlaySound(new("CalamityMod/Sounds/Item/HarpLV" + Math.Clamp((int)NoteSequence + 1, 1, 6)), Owner.Center); + { + if (Main.zenithWorld) + { + if (NoteSequence == 0f) + StupidEasterEggSlot = SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GFB/SevenTrebleClefSouls"), Owner.Center); + } + else + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/HarpLV" + Math.Clamp((int)NoteSequence + 1, 1, 6)) with { Volume = 0.8f }, Owner.Center); + } + // They did not obey me + // Big shoutouts to NotRyo for making this Finale remix out of harp notes + if (Main.zenithWorld && NoteSequence == 0f && Timer % 2428f == 0f && AIState == 0f) + StupidEasterEggSlot = SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GFB/SevenTrebleClefSouls"), Owner.Center); + if (SoundEngine.TryGetActiveSound(StupidEasterEggSlot, out var TrebleSoul) && TrebleSoul.IsPlaying) + TrebleSoul.Position = Owner.Center; if (Main.zenithWorld) Lighting.AddLight(Projectile.Center, 1.25f, 1.25f, 1.25f); @@ -114,12 +133,19 @@ namespace CalamityMod.Projectiles.Magic Vector2 mouse = Owner.ClampedMouseWorld(); Projectile.Center = mouse + musicNoteRotationOffset * 220f; + ReleaseCenterPoint = mouse; playerDirection = Projectile.Center - mouse; playerDirection.Normalize(); - playerDirection *= -9.2f; + playerDirection *= -13f; Projectile.velocity = playerDirection; - SoundEngine.PlaySound(AnahitasArpeggio.EndSound, Projectile.Center); + if (Main.zenithWorld) + { + if (SoundEngine.TryGetActiveSound(StupidEasterEggSlot, out var Flowey)) + Flowey?.Stop(); + } + else + SoundEngine.PlaySound(AnahitasArpeggio.EndSound with { Volume = 0.8f }, Projectile.Center); AIState = 2f; } } @@ -142,9 +168,18 @@ namespace CalamityMod.Projectiles.Magic // Slow down quickly if (Projectile.velocity.Length() > 0.5f) - Projectile.velocity *= 0.95f; + Projectile.velocity *= 0.925f; else + { Projectile.velocity = Vector2.Zero; + + // Makes the notes slowly follow the mouse and rotate + Vector2 centerPointDirection = (Owner.Calamity().mouseWorld - ReleaseCenterPoint).SafeNormalize(Vector2.Zero); + float distToMove = MathF.Min(2.75f, Vector2.Distance(Owner.Calamity().mouseWorld, ReleaseCenterPoint)); // The constant value is the maximum chase speed + ReleaseCenterPoint += centerPointDirection * distToMove; + Projectile.Center += centerPointDirection * distToMove; + Projectile.Center = ReleaseCenterPoint + Utils.DirectionTo(ReleaseCenterPoint, Projectile.Center).RotatedBy(MathHelper.Pi * 0.01f) * Vector2.Distance(ReleaseCenterPoint, Projectile.Center); + } } } @@ -202,7 +237,6 @@ namespace CalamityMod.Projectiles.Magic } public override void SendExtraAI(BinaryWriter writer) => writer.Write(_randomReleaseRotationOffset); - public override void ReceiveExtraAI(BinaryReader reader) => _randomReleaseRotationOffset = reader.ReadSingle(); } } diff --git a/Projectiles/Magic/AstralachneaFang.cs b/Projectiles/Magic/AstralachneaFang.cs index cf5ed838f9..5619a355ec 100644 --- a/Projectiles/Magic/AstralachneaFang.cs +++ b/Projectiles/Magic/AstralachneaFang.cs @@ -49,7 +49,10 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + //Doze - I gave this long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + //Poison and Venom staff in vanilla do 30 seconds, so this should too as it's a spiritual successor to them. + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(30)); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/CauldronHoldout.cs b/Projectiles/Magic/CauldronHoldout.cs index 80d327c3ef..b499fdf008 100644 --- a/Projectiles/Magic/CauldronHoldout.cs +++ b/Projectiles/Magic/CauldronHoldout.cs @@ -75,11 +75,7 @@ namespace CalamityMod.Projectiles.Magic int projType = ModContent.ProjectileType(); int projDamage = Projectile.damage; float speedscale = 18f; - Vector2 shotSpeed = Vector2.Normalize(Projectile.velocity) * speedscale; - if (float.IsNaN(shotSpeed.X) || float.IsNaN(shotSpeed.Y)) - { - shotSpeed = -Vector2.UnitY; - } + Vector2 shotSpeed = Projectile.velocity.SafeNormalize(-Vector2.UnitY) * speedscale; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, shotSpeed, projType, projDamage, Projectile.knockBack, player.whoAmI); for (int i = 0; i < 6; i++) diff --git a/Projectiles/Magic/CauldronProj.cs b/Projectiles/Magic/CauldronProj.cs index 21c716e995..a414b19b1c 100644 --- a/Projectiles/Magic/CauldronProj.cs +++ b/Projectiles/Magic/CauldronProj.cs @@ -98,8 +98,8 @@ namespace CalamityMod.Projectiles.Magic Main.EntitySpriteDraw(Glow.Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire, 90); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 90); } } diff --git a/Projectiles/Magic/CauldronProjSmall.cs b/Projectiles/Magic/CauldronProjSmall.cs index 1ae7f52f9a..20ae6b8292 100644 --- a/Projectiles/Magic/CauldronProjSmall.cs +++ b/Projectiles/Magic/CauldronProjSmall.cs @@ -58,13 +58,6 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Pitch = 0.8f, Volume = 0.6f }, Projectile.Center); - Projectile.ExpandHitboxBy(46); - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage /= 2; - Projectile.Damage(); for (int i = 0; i < 10; i++) { int size = 10; @@ -86,8 +79,8 @@ namespace CalamityMod.Projectiles.Magic public override bool? CanDamage() => Projectile.velocity.Y < 0f ? false : null; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire, 90); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 90); } } diff --git a/Projectiles/Magic/EvergladeSprayProjectile.cs b/Projectiles/Magic/EvergladeSprayProjectile.cs index dbd85e0838..0cf2d5e24f 100644 --- a/Projectiles/Magic/EvergladeSprayProjectile.cs +++ b/Projectiles/Magic/EvergladeSprayProjectile.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 4; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.penetrate = 6; + Projectile.penetrate = 3; Projectile.MaxUpdates = 3; Projectile.DamageType = DamageClass.Magic; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6 * Projectile.MaxUpdates; // 6 effective, 18 total + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/GleamingBolt.cs b/Projectiles/Magic/GleamingBolt.cs index 8fdd57539f..caa9485d19 100644 --- a/Projectiles/Magic/GleamingBolt.cs +++ b/Projectiles/Magic/GleamingBolt.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 6; i++) { Vector2 velocity = ((MathHelper.TwoPi * i / 6f) - (MathHelper.Pi / 3f - Projectile.velocity.ToRotation())).ToRotationVector2() * 3.5f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner); } } SoundEngine.PlaySound(SoundID.Item105, Projectile.Center); diff --git a/Projectiles/Magic/HadalUrnHoldout.cs b/Projectiles/Magic/HadalUrnHoldout.cs index 1a806f98cf..af45bffc98 100644 --- a/Projectiles/Magic/HadalUrnHoldout.cs +++ b/Projectiles/Magic/HadalUrnHoldout.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.damage = player.ActiveItem() is null ? 0 : player.GetWeaponDamage(player.ActiveItem()); if (Projectile.ai[0] > 0f) { - Projectile.ai[0] -= 1f; + Projectile.ai[0]--; } if (Main.myPlayer == Projectile.owner) { @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Magic } Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, shotSpeed, projType, projDamage, Projectile.knockBack, player.whoAmI, ai); } - Projectile.ai[0] = 16; + Projectile.ai[0] = player.HeldItem.useTime; } else { 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/KeelhaulBubble.cs b/Projectiles/Magic/KeelhaulBubble.cs index a01363c641..53f62bc727 100644 --- a/Projectiles/Magic/KeelhaulBubble.cs +++ b/Projectiles/Magic/KeelhaulBubble.cs @@ -16,6 +16,12 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() || p.type == ModContent.ProjectileType()) + p.Kill(); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y - 80f, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y - 80f, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); } diff --git a/Projectiles/Magic/KeelhaulGeyserBottom.cs b/Projectiles/Magic/KeelhaulGeyserBottom.cs index 632c9c9e08..dbe61a5152 100644 --- a/Projectiles/Magic/KeelhaulGeyserBottom.cs +++ b/Projectiles/Magic/KeelhaulGeyserBottom.cs @@ -1,7 +1,10 @@ -using Terraria; +using CalamityMod.NPCs; +using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Magic { + [PierceResistExceptionAttribute(true)] public class KeelhaulGeyserBottom : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; @@ -19,14 +22,21 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = -1; - Projectile.timeLeft = 180; - Projectile.alpha = 90; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 20; + Projectile.timeLeft = 900; + Projectile.alpha = 255; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() { + if (Projectile.alpha > 90) + { + Projectile.alpha -= 10; + if (Projectile.alpha < 90) + Projectile.alpha = 90; + } + Projectile.frameCounter++; if (Projectile.frameCounter > 6) { diff --git a/Projectiles/Magic/KeelhaulGeyserTop.cs b/Projectiles/Magic/KeelhaulGeyserTop.cs index 69aeb8f78b..db17a5ca70 100644 --- a/Projectiles/Magic/KeelhaulGeyserTop.cs +++ b/Projectiles/Magic/KeelhaulGeyserTop.cs @@ -1,7 +1,10 @@ -using Terraria; +using CalamityMod.NPCs; +using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Magic { + [PierceResistExceptionAttribute(true)] public class KeelhaulGeyserTop : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; @@ -19,14 +22,21 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = -1; - Projectile.timeLeft = 180; - Projectile.alpha = 90; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 20; + Projectile.timeLeft = 900; + Projectile.alpha = 255; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() { + if (Projectile.alpha > 90) + { + Projectile.alpha -= 10; + if (Projectile.alpha < 90) + Projectile.alpha = 90; + } + Projectile.frameCounter++; if (Projectile.frameCounter > 6) { diff --git a/Projectiles/Magic/PhotosyntheticSolarBeam.cs b/Projectiles/Magic/PhotosyntheticSolarBeam.cs index fb6fd037ed..7196a21283 100644 --- a/Projectiles/Magic/PhotosyntheticSolarBeam.cs +++ b/Projectiles/Magic/PhotosyntheticSolarBeam.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Magic public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/UltimaRayMid", AssetRequestMode.ImmediateLoad).Value; public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd", AssetRequestMode.ImmediateLoad).Value; - public ref float ShardCooldown => ref Projectile.ai[1]; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetDefaults() { @@ -28,7 +27,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 12; + Projectile.localNPCHitCooldown = -1; Projectile.tileCollide = false; Projectile.timeLeft = (int)Lifetime; } @@ -42,11 +41,11 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < starPoints; i++) { float angle = MathHelper.TwoPi * i / starPoints; - for (int j = 0; j < 12; j++) + for (int j = 0; j < 6; j++) { - float starSpeed = MathHelper.Lerp(1f, 7f, j / 12f); - Color dustColor = Color.Lerp(Color.White, Color.YellowGreen, j / 12f); - float dustScale = MathHelper.Lerp(1.6f, 0.85f, j / 12f); + float starSpeed = MathHelper.Lerp(1f, 7f, j / 6f); + Color dustColor = Color.Lerp(Color.White, Color.YellowGreen, j / 6f); + float dustScale = MathHelper.Lerp(1.6f, 0.85f, j / 6f); Dust terraMagic = Dust.NewDustPerfect(Projectile.Center, 107); terraMagic.velocity = angle.ToRotationVector2() * starSpeed; @@ -56,7 +55,7 @@ namespace CalamityMod.Projectiles.Magic } } - int ovalPoints = 42; + int ovalPoints = 30; for (int i = 0; i < ovalPoints; i++) { float angle = MathHelper.TwoPi * i / ovalPoints; @@ -66,9 +65,6 @@ namespace CalamityMod.Projectiles.Magic terraMagic.noGravity = true; } } - - if (ShardCooldown > 0f) - ShardCooldown--; } public override void DetermineScale() => Projectile.scale = Projectile.timeLeft / Lifetime * MaxScale; @@ -89,18 +85,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (ShardCooldown > 0f) - return; - - // The "Center" of the laser is actually the start of it in this context. - // Collision is done separately. This might have a slight offset due to collision - // boxes, but that should be negligible. - float lengthFromStart = Projectile.Distance(target.Center); - - int totalShards = (int)MathHelper.Lerp(1, 3, MathHelper.Clamp(lengthFromStart / MaxLaserLength * 1.5f, 0f, 1f)); - int shardType = ModContent.ProjectileType(); - int shardDamage = (int)(Projectile.damage * 0.5); - for (int i = 0; i < totalShards; i++) + for (int i = 0; i < 2; i++) { int tries = 0; Vector2 spawnOffset; @@ -111,11 +96,8 @@ namespace CalamityMod.Projectiles.Magic } while (Collision.SolidCollision((target.Center + spawnOffset).ToTileCoordinates().ToVector2(), 4, 4) && tries < 10); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + spawnOffset, Main.rand.NextVector2CircularEdge(6f, 6f), shardType, shardDamage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + spawnOffset, Main.rand.NextVector2CircularEdge(6f, 6f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner); } - - ShardCooldown = 3f; - Projectile.netUpdate = true; } } } diff --git a/Projectiles/Magic/PlagueFang.cs b/Projectiles/Magic/PlagueFang.cs index 443df05763..adc787da24 100644 --- a/Projectiles/Magic/PlagueFang.cs +++ b/Projectiles/Magic/PlagueFang.cs @@ -78,7 +78,10 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + //Doze - I gave this long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + //Poison and Venom staff in vanilla do 30 seconds, so this should too as it's a spiritual successor to them. + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(30)); } } } 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 bb9a52caa4..454e42905e 100644 --- a/Projectiles/Magic/SHPV.cs +++ b/Projectiles/Magic/SHPV.cs @@ -87,17 +87,29 @@ namespace CalamityMod.Projectiles.Magic { if (Timer % 5 == 0f) { - if (Owner.HeldItem.ModItem is SHPC shpc && shpc.storedSoulpower > 0) + if (Owner.HeldItem.ModItem is SHPC shpc) { 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) { SoulColors.RemoveAt(0); - shpc.storedSoulpower--; + if (shpc.storedSoulpower > 0) + shpc.storedSoulpower--; + else if (SHPC.FindSoulForAmmo(Owner) != -1) + { + int soulType = SHPC.FindSoulForAmmo(Owner); + Owner.ConsumeItem(soulType); + shpc.storedSoulType = soulType; + shpc.storedSoulpower = SHPC.ShotsPerSoul; + } + else + { + SoulColors.Clear(); + } } ConsumeSoul = !ConsumeSoul; } diff --git a/Projectiles/Magic/Shadowbolt.cs b/Projectiles/Magic/Shadowbolt.cs index 1207adf6cd..d41828d09c 100644 --- a/Projectiles/Magic/Shadowbolt.cs +++ b/Projectiles/Magic/Shadowbolt.cs @@ -75,10 +75,10 @@ namespace CalamityMod.Projectiles.Magic if (reflectionTimer <= 0) { SoundStyle bounce = new("CalamityMod/Sounds/Item/ShadowboltReflect"); - SoundEngine.PlaySound(bounce with { Volume = 0.6f, Pitch = 0f }, platPosWall); + SoundEngine.PlaySound(bounce with { Volume = 0.6f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = -1 }, platPosWall); for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; - Projectile.velocity = (targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX) * 5; + Projectile.velocity = (targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX) * 12; reflecting = false; hasReboundOffPlat = true; time = 10; @@ -121,13 +121,13 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(blastRing); SoundStyle wall = new("CalamityMod/Sounds/Item/ShadowboltWallHit"); - SoundEngine.PlaySound(wall with { Volume = 0.5f, Pitch = 0f }, platPosWall); + SoundEngine.PlaySound(wall with { Volume = 0.5f, Pitch = 0f, MaxInstances = -1 }, platPosWall); reflecting = true; Projectile.extraUpdates = 0; } } - if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn && (Collision.SolidCollision(Projectile.Center, 20, 20) || time > 90)) + if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn && (Collision.SolidCollision(Projectile.Center, 20, 20) || time > 70)) { hasSetPlatSpawn = true; spawnPlat = true; @@ -151,6 +151,8 @@ namespace CalamityMod.Projectiles.Magic { if (time == 14) { + SoundEngine.PlaySound(SoundID.Item72 with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = -1 }, Projectile.Center); + Projectile.velocity = Projectile.velocity.RotatedByRandom(0.15f); for (int i = 0; i < 2; i++) { Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Indigo, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.3f, 0.75f, 12, true); @@ -176,7 +178,7 @@ namespace CalamityMod.Projectiles.Magic } if (time > 22 && time % 3 == 0) { - Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * 0.1f, false, 18, 0.05f * (hasReboundOffPlat ? 1.1f : 0.5f), Color.Lerp(Color.Indigo, Color.Orchid, 0.25f), new Vector2(0.7f, 1f), true, false, 0.3f); + Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * 0.1f, false, 18, 0.05f * (hasReboundOffPlat ? 1.1f : 0.5f), Color.Lerp(Color.Indigo, Color.Orchid, 0.25f), new Vector2(0.7f, 2f), true, false, 0.3f); GeneralParticleHandler.SpawnParticle(spark); } if (time > 30 && Main.rand.NextBool(12)) diff --git a/Projectiles/Magic/ShiftingSandsProj.cs b/Projectiles/Magic/ShiftingSandsProj.cs index 60f9c2608a..f5ca2df035 100644 --- a/Projectiles/Magic/ShiftingSandsProj.cs +++ b/Projectiles/Magic/ShiftingSandsProj.cs @@ -21,122 +21,170 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 18; Projectile.height = 18; Projectile.friendly = true; - Projectile.penetrate = 5; + Projectile.penetrate = 3; Projectile.DamageType = DamageClass.Magic; - Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.tileCollide = false; + Projectile.localNPCHitCooldown = 12; } public override void AI() { - if (Projectile.soundDelay == 0 && Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) > 2f) - { - Projectile.soundDelay = 10; - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - } - int sand = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedBrown, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[sand]; - dust.velocity *= 0.3f; - dust.position.X = Projectile.Center.X + 4f + (float)Main.rand.Next(-4, 5); - dust.position.Y = Projectile.Center.Y + (float)Main.rand.Next(-4, 5); - dust.noGravity = true; + int maxVelocity = 32; + Player player = Main.player[Projectile.owner]; + int height = Main.maxTilesY * 16; + int heightRatio = 0; - if (Main.myPlayer == Projectile.owner && Projectile.ai[0] <= 0f) + if (Projectile.ai[0] >= 0f) + heightRatio = (int)(Projectile.ai[1] / (float)height); + + bool notBeingChanneled = Projectile.ai[0] == -1f || Projectile.ai[0] == -2f; + if (Projectile.penetrate == 1 && Projectile.ai[0] >= 0f && heightRatio == 0) { - Player player = Main.player[Projectile.owner]; - if (player.channel) + Projectile.ai[1] += height; + heightRatio = 1; + Projectile.netUpdate = true; + } + if (Projectile.penetrate == 1 && Projectile.ai[0] == -1f) + { + Projectile.ai[0] = -2f; + Projectile.netUpdate = true; + } + if (heightRatio > 0 || Projectile.ai[0] == -2f) + Projectile.localAI[0] += 1f; + + if (Main.myPlayer == Projectile.owner) + { + if (Projectile.ai[0] >= 0f) { - float speed = 18f; - float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - Projectile.Center.X; - float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - Projectile.Center.Y; - if (player.gravDir == -1f) + if (player.channel && player.HeldItem.shoot == Projectile.type) { - mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - Projectile.Center.Y; - } - Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); - float mouseDist = mouseVec.Length(); - if (Projectile.ai[0] < 0f) - { - Projectile.ai[0] += 1f; - } - if (mouseDist > speed) - { - mouseDist = speed / mouseDist; - mouseVec.X *= mouseDist; - mouseVec.Y *= mouseDist; - int mouseSpeedX = (int)(mouseVec.X * 1000f); - int projSpeedX = (int)(Projectile.velocity.X * 1000f); - int mouseSpeedY = (int)(mouseVec.Y * 1000f); - int projSpeedY = (int)(Projectile.velocity.Y * 1000f); - if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + Vector2 channelPos = Main.MouseWorld; + player.LimitPointToPlayerReachableArea(ref channelPos); + if (Projectile.ai[0] != channelPos.X || Projectile.ai[1] != channelPos.Y) { Projectile.netUpdate = true; + Projectile.ai[0] = channelPos.X; + Projectile.ai[1] = channelPos.Y + (float)(height * heightRatio); } - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; } else { - int mouseSpeedX = (int)(mouseVec.X * 1000f); - int projSpeedX = (int)(Projectile.velocity.X * 1000f); - int mouseSpeedY = (int)(mouseVec.Y * 1000f); - int projSpeedY = (int)(Projectile.velocity.Y * 1000f); - if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + Projectile.netUpdate = true; + Projectile.ai[0] = -1f; + Projectile.ai[1] = -1f; + NPC homeTarget = ClosestNPCAtMagicMissileStyle(Projectile.Center, 800f); + if (homeTarget != null) { + int targetIndex = homeTarget.whoAmI; + if (targetIndex != -1) + Projectile.ai[1] = targetIndex; + } + else if (Projectile.velocity.Length() < 2f) + Projectile.velocity = Projectile.DirectionFrom(player.Center) * maxVelocity; + else + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.Zero) * maxVelocity; + } + } + + if (notBeingChanneled && Projectile.ai[1] == -1f) + { + NPC homeTarget = ClosestNPCAtMagicMissileStyle(Projectile.Center, 800f); + if (homeTarget != null) + { + int targetIndex = homeTarget.whoAmI; + if (targetIndex != -1) + { + Projectile.ai[1] = targetIndex; Projectile.netUpdate = true; } - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; } } - else if (Projectile.ai[0] <= 0f) - { - Projectile.Calamity().conditionalHomingRange = 750f; - Projectile.netUpdate = true; - float speed = 12f; - Vector2 projCenter = Projectile.Center; - float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - projCenter.X; - float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - projCenter.Y; - if (player.gravDir == -1f) - { - mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projCenter.Y; - } - Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); - float mouseDist = mouseVec.Length(); - if (mouseDist <= 2f || Projectile.ai[0] < 0f) - { - projCenter = player.Center; - mouseVec = Projectile.Center - projCenter; - mouseDist = mouseVec.Length(); - } - mouseDist = speed / mouseDist; - mouseVec.X *= mouseDist; - mouseVec.Y *= mouseDist; - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; - if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f) - { - Projectile.Kill(); - } - Projectile.ai[0] = 1f; - } } - if (Projectile.velocity.X != 0f || Projectile.velocity.Y != 0f) - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - } - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - } - public override bool PreDraw(ref Color lightColor) + Vector2 targetVector = Vector2.Zero; + float chaseLerp = 1f; + if (Projectile.ai[0] > 0f && Projectile.ai[1] > 0f) + targetVector = new Vector2(Projectile.ai[0], Projectile.ai[1] % height); + + if (notBeingChanneled && Projectile.ai[1] >= 0f) + { + Projectile.tileCollide = false; + NPC target = Main.npc[(int)Projectile.ai[1]]; + if (target.CanBeChasedBy()) + { + targetVector = target.Center; + float invFineL = Utils.GetLerpValue(0f, 100f, Projectile.Distance(targetVector), true) * Utils.GetLerpValue(600f, 400f, Projectile.Distance(targetVector), true); + chaseLerp = MathHelper.Lerp(0f, 0.2f, Utils.GetLerpValue(200f, 20f, 1f - invFineL, true)); + } + else + { + Projectile.ai[1] = -1f; + Projectile.netUpdate = true; + } + } + + if (targetVector != Vector2.Zero) + { + if (Projectile.Distance(targetVector) >= 64f) + { + Vector2 distanceVector = targetVector - Projectile.Center; + Vector2 moveVelocity = distanceVector.SafeNormalize(Vector2.Zero); + float velocityMult = Math.Min(maxVelocity, distanceVector.Length()); + moveVelocity *= velocityMult; + if (Projectile.velocity.Length() < 4f) + Projectile.velocity += Projectile.velocity.RotatedBy(MathHelper.PiOver4).SafeNormalize(Vector2.Zero) * 4f; + + Projectile.velocity = Vector2.Lerp(Projectile.velocity, moveVelocity, chaseLerp); + } + else + { + Projectile.velocity *= 0.3f; + Projectile.velocity += (targetVector - Projectile.Center) * 0.3f; + } + + if (Projectile.timeLeft < 60) + Projectile.timeLeft = 60; + } + + if (notBeingChanneled && Projectile.ai[1] < 0f) + { + if (Projectile.velocity.Length() != maxVelocity) + Projectile.velocity = Projectile.velocity.MoveTowards(Projectile.velocity.SafeNormalize(Vector2.UnitY) * maxVelocity, 4f); + + if (Projectile.timeLeft > 300) + Projectile.timeLeft = 300; + } + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + private NPC ClosestNPCAtMagicMissileStyle(Vector2 origin, float maxDistanceToCheck = 800f) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; + NPC closestTarget = null; + float distance = maxDistanceToCheck; + + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].CanBeChasedBy() && Projectile.localNPCImmunity[i] == 0) + { + float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + if (Vector2.Distance(origin, Main.npc[i].Center) < distance) + { + distance = Vector2.Distance(origin, Main.npc[i].Center); + closestTarget = Main.npc[i]; + } + } + } + return closestTarget; + } + public override bool OnTileCollide(Vector2 oldVelocity) => Projectile.ai[0] < 0f; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.ai[0] == -1f) + { + Projectile.ai[1] = -1f; + Projectile.netUpdate = true; + } } public override void OnKill(int timeLeft) @@ -151,10 +199,10 @@ namespace CalamityMod.Projectiles.Magic Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); int dustAmt = 36; - for (int index = 0; index < dustAmt; index++) + for (int i = 0; i < dustAmt; i++) { Vector2 dustPos = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - dustPos = dustPos.RotatedBy((double)((float)(index - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; + dustPos = dustPos.RotatedBy((double)((float)(i - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; Vector2 dustVel = dustPos - Projectile.Center; int sand = Dust.NewDust(dustPos + dustVel, 0, 0, DustID.UnusedBrown, dustVel.X * 1.5f, dustVel.Y * 1.5f, 100, default, 1.2f); Main.dust[sand].noGravity = true; @@ -162,5 +210,11 @@ namespace CalamityMod.Projectiles.Magic Main.dust[sand].velocity = dustVel; } } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + return false; + } } } diff --git a/Projectiles/Magic/Snowball.cs b/Projectiles/Magic/Snowball.cs index 451b62000a..e62ac2ff5b 100644 --- a/Projectiles/Magic/Snowball.cs +++ b/Projectiles/Magic/Snowball.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.coldDamage = true; Projectile.penetrate = 1; - Projectile.extraUpdates = 1; Projectile.coldDamage = true; } diff --git a/Projectiles/Magic/TearsofHeavenProjectile.cs b/Projectiles/Magic/TearsofHeavenProjectile.cs index c3c2809d12..695d4f8515 100644 --- a/Projectiles/Magic/TearsofHeavenProjectile.cs +++ b/Projectiles/Magic/TearsofHeavenProjectile.cs @@ -62,7 +62,8 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffID.OnFire3, 180); + target.AddBuff(BuffID.Frostburn2, 180); } } } diff --git a/Projectiles/Magic/ValkyrieRayBeam.cs b/Projectiles/Magic/ValkyrieRayBeam.cs index d1f2164ad8..a44f2244de 100644 --- a/Projectiles/Magic/ValkyrieRayBeam.cs +++ b/Projectiles/Magic/ValkyrieRayBeam.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic // The beam itself still stops on tiles, but its invisible "source" projectile ignores them. Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 4; + Projectile.localNPCHitCooldown = -1; // The beam lasts for only some frames and fades out over that time. Projectile.timeLeft = Lifetime; diff --git a/Projectiles/Magic/ValkyrieRayStaff.cs b/Projectiles/Magic/ValkyrieRayStaff.cs index 0fa15fb048..a84949c126 100644 --- a/Projectiles/Magic/ValkyrieRayStaff.cs +++ b/Projectiles/Magic/ValkyrieRayStaff.cs @@ -35,9 +35,9 @@ namespace CalamityMod.Projectiles.Magic // Calculate how quickly the staff should charge. Charge increases by some number close to 1 every frame. // Speed increasing reforges make this number greater than 1. Slowing reforges make it smaller than 1. if (Projectile.localAI[0] == 0f) - Projectile.localAI[0] = 47f / player.ActiveItem().useTime; + Projectile.localAI[0] = (ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames) / player.ActiveItem().useTime; - // Increment the timer for the staff. If the timer has passed 47, destroy it. + // Increment the timer for the staff. If the timer has passed the total time, destroy it. Projectile.ai[0] += Projectile.localAI[0]; int maxTime = ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames; if (Projectile.ai[0] > maxTime) @@ -127,8 +127,8 @@ namespace CalamityMod.Projectiles.Magic private void FiringEffects(Vector2 center) { - SoundEngine.PlaySound(SoundID.Item28, center); - SoundEngine.PlaySound(SoundID.Item60, center); + SoundEngine.PlaySound(SoundID.Item28 with { Volume = 0.7f }, center); + SoundEngine.PlaySound(SoundID.Item60 with { Volume = 0.7f }, center); int numDust = 36; int dustID = 73; for (int i = 0; i < numDust; ++i) 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/AbyssBladeProjectile.cs b/Projectiles/Melee/AbyssBladeProjectile.cs index 1ea0f6191b..cb0d83bc3f 100644 --- a/Projectiles/Melee/AbyssBladeProjectile.cs +++ b/Projectiles/Melee/AbyssBladeProjectile.cs @@ -159,6 +159,7 @@ namespace CalamityMod.Projectiles.Melee GenericSparkle sparker = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.DodgerBlue, Color.MediumBlue, Main.rand.NextFloat(2.5f, 2.9f) - i * 0.55f, 14, Main.rand.NextFloat(-0.01f, 0.01f), 2.5f); GeneralParticleHandler.SpawnParticle(sparker); } + Projectile.ResetLocalNPCHitImmunity(); Projectile.penetrate = 1; Projectile.damage = (int)(startDamage * 2); // Launched blade deals 200% damage Time = 0; diff --git a/Projectiles/Melee/AncientStar.cs b/Projectiles/Melee/AncientStar.cs index d798f5435c..bc1885c66b 100644 --- a/Projectiles/Melee/AncientStar.cs +++ b/Projectiles/Melee/AncientStar.cs @@ -50,11 +50,6 @@ namespace CalamityMod.Projectiles.Melee } } - if (Projectile.timeLeft < MaxTime - 5) - { - Projectile.tileCollide = true; - } - if (Timer / MaxTime > 0.25f) { Projectile.velocity *= 0.95f; diff --git a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs index cf2aace6b5..ed61618cec 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.noEnchantmentVisuals = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; + Projectile.timeLeft = (int)MaxTime; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; @@ -108,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee { if (!initialized) //Initialization { - Projectile.timeLeft = (int)MaxTime; + //Projectile.timeLeft = (int)MaxTime; SoundEngine.PlaySound(SoundID.Item84 with { Volume = SoundID.Item84.Volume * 0.3f }, Projectile.Center); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction diff --git a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs index 65c5cce750..854b5d2c48 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Linq; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Sounds; @@ -273,6 +274,15 @@ namespace CalamityMod.Projectiles.Melee float extraRotations = (direction.ToRotation() + MathHelper.PiOver4 > Projectile.velocity.ToRotation()) ? -MathHelper.TwoPi : 0f; Projectile.rotation = MathHelper.Lerp(Projectile.velocity.ToRotation(), direction.ToRotation() + extraRotations, orientateProperly); + if (ChanceMissed == 0f && Owner.controlUseTile && ThrowCompletion > 0.99f) + { + ArkoftheCosmos sword = (Owner.HeldItem.ModItem as ArkoftheCosmos); + Projectile parrier = Main.projectile.FirstOrDefault(p => p.active && p.owner == Owner.whoAmI && p.type == ProjectileType(), null); + if (sword is not null && parrier is null) + { + int parryID = Projectile.NewProjectile(Owner.GetSource_ItemUse(sword.Item), Owner.Center, Owner.DirectionTo(Projectile.Center), ModContent.ProjectileType(), 0, 0, Owner.whoAmI); + } + } } //Sharticles diff --git a/Projectiles/Melee/Blood.cs b/Projectiles/Melee/Blood.cs index d87e1880b7..da2bb26ee6 100644 --- a/Projectiles/Melee/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -42,16 +42,6 @@ namespace CalamityMod.Projectiles.Melee CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 20f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.075); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.075)); } } diff --git a/Projectiles/Melee/BotanicSpear.cs b/Projectiles/Melee/BotanicSpear.cs index f42ce6103b..c6409abe97 100644 --- a/Projectiles/Melee/BotanicSpear.cs +++ b/Projectiles/Melee/BotanicSpear.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 16; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = -1; + Projectile.penetrate = 2; Projectile.tileCollide = false; Projectile.timeLeft = TimeLeft; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index 8c7e3ac1c3..4f6706afe6 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -25,9 +25,6 @@ namespace CalamityMod.Projectiles.Melee public const float LungeSpeed = 16; public ref float CanBounce => ref Projectile.localAI[0]; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -91,20 +88,14 @@ namespace CalamityMod.Projectiles.Melee Owner.velocity = direction.SafeNormalize(Vector2.UnitX * Owner.direction) * LungeSpeed; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - - private void OnHitEffects(bool cannotLifesteal) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Projectile.ForceNetUpdate(); if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - if (!cannotLifesteal) //trolled - { - Owner.HealPlayer(BrokenBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck - } + Owner.DoLifestealDirect(target, BrokenBiomeBlade.EvilAttunement_Lifesteal, 1.25f); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; 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/DevilsSunriseCyclone.cs b/Projectiles/Melee/DevilsSunriseCyclone.cs index cab7c87dbf..4e5e3888ab 100644 --- a/Projectiles/Melee/DevilsSunriseCyclone.cs +++ b/Projectiles/Melee/DevilsSunriseCyclone.cs @@ -141,9 +141,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(HitSound, target.Center); target.AddBuff(ModContent.BuffType(), 180); // Heals on each hit - Player own = Main.player[Projectile.owner]; - if (!own.moonLeech) - own.HealPlayer(1); + Main.player[Projectile.owner].DoLifestealDirect(target, 1, 0.75f); // Start slicing the hit enemy if not doing so already if (State != 2f) 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/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 8406697e38..e7800cc539 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -302,11 +302,11 @@ namespace CalamityMod.Projectiles.Melee spawnBoom = false; } - int healPower = Projectile.ai[1] == -1 ? 90 : 80; - int heal = (int)(MathHelper.Clamp(healPower - Projectile.numHits * 75, 1, healPower)); + int healPower = Projectile.ai[1] == -1 ? 60 : 50; + int heal = (int)(MathHelper.Clamp(healPower - Projectile.numHits * 35, 1, healPower)); if (Projectile.numHits < 10) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.2f); } if (Projectile.numHits <= 2) diff --git a/Projectiles/Melee/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs index 26ee16b06f..89cf2d5927 100644 --- a/Projectiles/Melee/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -78,29 +78,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - int heal = (int)Math.Round(info.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.015), 0.75f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index f487a0cd93..64b2e4eba6 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -78,11 +78,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - if (target.life <= 0 && target.lifeMax > 5) - { - if (Projectile.owner == Main.myPlayer) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], 8, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, 0f); - } + if (target.life <= 0) + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 8, 0f); } } } diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index 884824bdbe..90957183db 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -628,17 +628,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.NewProjectile(Projectile.GetSource_FromAI(), target.Center, Vector2.Zero, ModContent.ProjectileType(), explosionDamage, 0f, Projectile.owner); } - if (target.lifeMax <= 5 || Owner.lifeSteal <= 0) - return; - - int healAmt = (int)Math.Round(hit.Damage * 0.04); - if (healAmt > BalancingConstants.LifeStealCap) - healAmt = BalancingConstants.LifeStealCap; - - if (healAmt <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Owner, healAmt, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + Owner.DoLifestealDirect(target, (int)Math.Round(hit.Damage * 0.04), 0.4f); } } diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index c473cb8de7..0e9dd39a3d 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -263,8 +263,7 @@ namespace CalamityMod.Projectiles.Melee if (CurrentState == 1f && Main.myPlayer == Projectile.owner && !AnyProjectiles(ProjectileType())) { Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), Projectile.damage, 0f, Projectile.owner, target.whoAmI); - if (proj.ModProjectile is PhoenixsPrideFirewall fire) - fire.Scale = MathHelper.Clamp(target.width / 100f, 0.3f, 1.25f); + (proj.ModProjectile as PhoenixsPrideFirewall).Scale = MathHelper.Clamp(target.width / 100f, 0.3f, 1.25f); } } diff --git a/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs index 2f4a52d81d..90f305fa35 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs @@ -1,8 +1,10 @@ using CalamityMod.CalPlayer; using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using System.IO; using Terraria; using Terraria.Graphics.Shaders; @@ -11,11 +13,11 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PhoenixsPrideFirewall : ModProjectile, ILocalizedModType + public class PhoenixsPrideFirewall : ModProjectile, ILocalizedModType, IPixelatedPrimitiveRenderer { public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public const int TornadoHeight = 480; + public const int MaxTornadoHeight = 270; public float Scale; // Size of the firewall, scales with NPC width public float fadeOut = 0f; // Used to control the firewall fading in and out at the start and end of its lifespan @@ -32,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.alpha = 255; Projectile.scale = Scale; - Projectile.timeLeft = 150; + Projectile.timeLeft = 180; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = FourSeasonsGalaxia.PhoenixAttunement_FlamePillarLocalIFrames; } @@ -40,20 +42,30 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { // Constantly follow its target - // Die if the target is no longer active + // Immediately start fading away if the target is no longer active if (!Target.active) { - Projectile.Kill(); - return; + Projectile.velocity *= 0.975f; + if (Projectile.timeLeft > 15) + Projectile.timeLeft = 15; } else - Projectile.Center = Target.Center + Target.velocity; + Projectile.velocity = (Projectile.velocity * 13f + (Target.Center - Projectile.Center).SafeNormalize(Vector2.Zero) * 24f) / 14f; // Fade in and out at the start and end of its lifespan - if (Projectile.timeLeft > 145) - fadeOut += 0.15f; + if (Projectile.timeLeft > 170) + fadeOut += 0.1f; if (Projectile.timeLeft < 15) fadeOut -= 0.05f; + + // Some smoke on the base + if (Projectile.timeLeft % 3 == 0) + { + MediumMistParticle smoke = new(Projectile.Center, Main.rand.NextVector2Circular(6f, 6f), Color.Orange, Color.DarkOrange, 1.1f, 170f); + GeneralParticleHandler.SpawnParticle(smoke); + SquareParticle spark = new(Projectile.Center, -Vector2.UnitY.RotatedByRandom(MathHelper.PiOver2) * 8f, true, 20, 0.9f, Color.White); + GeneralParticleHandler.SpawnParticle(spark); + } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -62,46 +74,29 @@ namespace CalamityMod.Projectiles.Melee return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Bottom, - Projectile.Bottom - Vector2.UnitY * TornadoHeight, + Projectile.Bottom - Vector2.UnitY * MaxTornadoHeight, 72, ref _); } - public float WidthFunction(float completionRatio) => 50f * Scale * (completionRatio > 0.4f ? 1f : completionRatio * 2.5f); - - public override bool PreDraw(ref Color lightColor) + public float WidthFunction(float completionRatio) => MathF.Max(50f * Scale * (MathF.Pow(1f - completionRatio, 2) * 2.75f), 0.35f); + public Color ColorFunction(float completionRatio) => Color.Orange * (completionRatio > 0.1f ? 1f : completionRatio * 10f); + public void RenderPixelatedPrimitives(SpriteBatch spritebatch, PixelationPrimitiveLayer layer) { - Main.spriteBatch.EnterShaderRegion(); - GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); GameShaders.Misc["CalamityMod:Bordernado"].UseOpacity(fadeOut); GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.Request("Terraria/Images/Misc/Perlin")); - Vector2[] drawPoints = new Vector2[5]; - Vector2 upwardAscent = Vector2.UnitY * TornadoHeight; + Vector2[] drawPoints = new Vector2[7]; + Vector2 upwardAscent = Vector2.UnitY * MaxTornadoHeight * fadeOut; Vector2 bottom = Projectile.Center; Vector2 top = bottom - upwardAscent; + // Offset is intentionally applied here instead of with an offset function in PrimitiveSettings to make it a bit choppier for (int i = 0; i < drawPoints.Length - 1; i++) - drawPoints[i] = Vector2.Lerp(top, bottom, i / (float)(drawPoints.Length - 1)); + drawPoints[i] = Vector2.Lerp(top + Vector2.UnitX * (MathF.Sin(Main.GameUpdateCount * 0.15f + i) * i * 6f), bottom, i / (float)(drawPoints.Length - 1)); drawPoints[drawPoints.Length - 1] = bottom; - PrimitiveRenderer.RenderTrail(drawPoints, new(WidthFunction, (_) => Color.Orange, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 80); - - Main.spriteBatch.ExitShaderRegion(); - - Texture2D vortexTexture = ModContent.Request("CalamityMod/Projectiles/Boss/OldDukeVortex").Value; - for (int i = 0; i < 90; i++) - { - float angle = MathHelper.TwoPi * i / (25f * Scale) + Main.GlobalTimeWrappedHourly * MathHelper.TwoPi; - Color drawColor = Color.White * 0.04f; - drawColor.A = 0; - Vector2 drawPosition = bottom + angle.ToRotationVector2() * 4f - Main.screenPosition; - - drawPosition += (angle + Main.GlobalTimeWrappedHourly * i / 16f).ToRotationVector2() * 6f; - Main.EntitySpriteDraw(vortexTexture, drawPosition, null, drawColor * fadeOut, angle + MathHelper.PiOver2, vortexTexture.Size() * 0.5f, 0.2f * Scale, SpriteEffects.None, 0); - } - - return false; + PrimitiveRenderer.RenderTrail(drawPoints, new(WidthFunction, ColorFunction, pixelate: true, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 80); } } } diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index a1cf5ba28d..df2af4e30b 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -234,7 +234,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(20 - Projectile.numHits * 12, 1, 20)); if (Projectile.numHits < 10) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.5f); } if (target.CanBeMoved(true) || Main.zenithWorld || target.type == ModContent.NPCType() || (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) diff --git a/Projectiles/Melee/GrandGuardianHoldout.cs b/Projectiles/Melee/GrandGuardianHoldout.cs index d184324240..1b9181626a 100644 --- a/Projectiles/Melee/GrandGuardianHoldout.cs +++ b/Projectiles/Melee/GrandGuardianHoldout.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(5 - Projectile.numHits * 3, 1, 5)); if (Projectile.numHits < 5) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.75f); } int points = 4; diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index 7955c988a0..bae234c799 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -21,11 +21,12 @@ namespace CalamityMod.Projectiles.Melee Projectile.aiStyle = ProjAIStyleID.Beam; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 3; + Projectile.penetrate = 2; + Projectile.MaxUpdates = 2; Projectile.timeLeft = 600; AIType = ProjectileID.SporeCloud; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 8 * Projectile.MaxUpdates; } public override void AI() @@ -73,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee var source = Projectile.GetSource_FromThis(); if (Projectile.owner == Main.myPlayer) { - Projectile petal = CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ProjectileID.FlowerPetal, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, true); + Projectile petal = CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 24f, ProjectileID.FlowerPetal, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, false, 0f); if (petal.whoAmI.WithinBounds(Main.maxProjectiles)) { petal.DamageType = DamageClass.Melee; diff --git a/Projectiles/Melee/HellkiteHoldout.cs b/Projectiles/Melee/HellkiteHoldout.cs index 87e4127d6d..d95a2aad4c 100644 --- a/Projectiles/Melee/HellkiteHoldout.cs +++ b/Projectiles/Melee/HellkiteHoldout.cs @@ -424,7 +424,7 @@ namespace CalamityMod.Projectiles.Melee float minMult = 0.25f; int hitsToMinMult = 10; float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (chargedSwing ? (3f * (GFBMulti) + critDamage) : 1) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? (2.9f * GFBMulti + critDamage) : 1) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/HolyColliderHoldout.cs b/Projectiles/Melee/HolyColliderHoldout.cs index 1ae89b259a..0dba23aa5b 100644 --- a/Projectiles/Melee/HolyColliderHoldout.cs +++ b/Projectiles/Melee/HolyColliderHoldout.cs @@ -432,7 +432,7 @@ namespace CalamityMod.Projectiles.Melee } for (int i = 0; i < 4; i++) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -35).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0, target.whoAmI); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -35).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0); } } } diff --git a/Projectiles/Melee/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs index 9f9b9c19d9..d66941830f 100644 --- a/Projectiles/Melee/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -73,31 +73,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - - int heal = (int)Math.Round(info.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), (int)Math.Round(hit.Damage * 0.015), 0.4f); public override bool PreDraw(ref Color lightColor) { 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/TumbleweedFlail.cs b/Projectiles/Melee/MaceFlails/TumbleweedFlail.cs index d1da4b4c20..c24c63a25c 100644 --- a/Projectiles/Melee/MaceFlails/TumbleweedFlail.cs +++ b/Projectiles/Melee/MaceFlails/TumbleweedFlail.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails public override float RetractAcceleration => 4f; public static float MaxAuraTime = 60f; + private bool hasDetached = false; + private int detachDelay = 0; public ref float AuraScale => ref Projectile.ai[2]; @@ -54,6 +56,13 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails sand.velocity = CurrentFlailState == FlailState.Spinning ? Main.rand.NextVector2Unit() * 1.5f : Projectile.velocity * 0.25f; } + // Force the flail to stay in launch state for a few frames after detaching to prevent spam-click abuse at point-blank + if (detachDelay > 0) + { + detachDelay--; + CurrentFlailState = detachDelay == 0 ? FlailState.ForcedRetracting : FlailState.LaunchingForward; + } + if (CurrentFlailState == FlailState.Spinning) { Projectile.ownerHitCheck = false; // Dust aura can hit through walls @@ -94,7 +103,21 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails Main.EntitySpriteDraw(Aura, position, null, drawColor, Main.GlobalTimeWrappedHourly * 0.5f + (i * i * 0.03f), Aura.Size() * 0.5f, AuraScale - (i * 0.03f), SpriteEffects.None, 0); } } - return base.PreDraw(ref lightColor); + + if (hasDetached) + { + DrawChain(); + return false; + } + else + return base.PreDraw(ref lightColor); + } + + public override bool? CanDamage() + { + if (hasDetached) + return false; + return base.CanDamage(); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) @@ -123,7 +146,11 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails if (Projectile.owner == Main.myPlayer) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage * LaunchDamage), Projectile.knockBack, Projectile.owner, CurrentFlailState == FlailState.LaunchingForward ? 0f : 1f); - Projectile.Kill(); + hasDetached = true; + if ((CurrentFlailState == FlailState.LaunchingForward || CurrentFlailState == FlailState.Ricochet) && StateTimer < 6) + detachDelay = 6; + else + CurrentFlailState = FlailState.ForcedRetracting; } } } 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/MajesticGuardHoldout.cs b/Projectiles/Melee/MajesticGuardHoldout.cs index b336a0b32d..1ec5cb2f5f 100644 --- a/Projectiles/Melee/MajesticGuardHoldout.cs +++ b/Projectiles/Melee/MajesticGuardHoldout.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(7 - Projectile.numHits * 5, 1, 7)); if (Projectile.numHits < 5) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal); } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); diff --git a/Projectiles/Melee/MantisClawHoldout.cs b/Projectiles/Melee/MantisClawHoldout.cs index 190f752a77..41b861553a 100644 --- a/Projectiles/Melee/MantisClawHoldout.cs +++ b/Projectiles/Melee/MantisClawHoldout.cs @@ -1,21 +1,14 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using CalamityMod.Items.BaseItems; -using Terraria.ModLoader; +using System; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; -using CalamityMod.Balancing; +using Terraria; using Terraria.Audio; -using CalamityMod.Items.Weapons.Melee; -using System; -using CalamityMod.Particles; -using Terraria.DataStructures; -using System.Collections.Generic; -using CalamityMod.Graphics.Primitives; -using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -23,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee { bool AnimationCooldown = false; - float JetDamageMultiplier => 7.5f; + float JetDamageMultiplier => 6.5f; int SlashSpeed => 6; int BlastChargeUses => 3; @@ -37,6 +30,12 @@ namespace CalamityMod.Projectiles.Melee public float BubbleSize = 0f; public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Items/Weapons/Melee/MantisClaws"; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Melee; + } public override void ResetStyle() { if (AnimationCooldown) @@ -71,7 +70,7 @@ namespace CalamityMod.Projectiles.Melee // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(20, 0).RotatedBy(Projectile.rotation), - Owner.DirectionTo(Owner.Calamity().mouseWorld) * 30, ModContent.ProjectileType(), (int)(Projectile.damage * JetDamageMultiplier), 7, Owner.whoAmI); + Owner.DirectionTo(Owner.Calamity().mouseWorld) * 30, ModContent.ProjectileType(), (int)(Projectile.damage * JetDamageMultiplier), 7, Owner.whoAmI, 0f, 40f); for (int i = 0; i < 9; i++) { @@ -129,7 +128,7 @@ namespace CalamityMod.Projectiles.Melee Owner.Calamity().mouseWorldListener = true; // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Projectile slash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.DirectionTo(Owner.Calamity().mouseWorld) * 6f, ModContent.ProjectileType(), Projectile.damage, 4f, Owner.whoAmI); + Projectile slash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.DirectionTo(Owner.Calamity().mouseWorld) * 6f, ModContent.ProjectileType(), Projectile.damage, 2f, Owner.whoAmI); slash.rotation = Owner.AngleTo(Owner.Calamity().mouseWorld) + MathHelper.ToRadians(Main.rand.NextFloat(-25, 25)); } diff --git a/Projectiles/Melee/MantisClawJet.cs b/Projectiles/Melee/MantisClawJet.cs index 87821016d3..5e9bee31aa 100644 --- a/Projectiles/Melee/MantisClawJet.cs +++ b/Projectiles/Melee/MantisClawJet.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 60; Projectile.timeLeft = TimerCap; - Projectile.knockBack = 2; Projectile.tileCollide = false; Projectile.width = 20; Projectile.height = 20; @@ -47,7 +46,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.extraUpdates = 5; Projectile.DamageType = DamageClass.Melee; - Projectile.ai[1] = 40; } public override void OnSpawn(IEntitySource source) @@ -64,16 +62,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.ai[0]++; } - public override bool? CanDamage() - { - return true; - } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Player owner = Main.player[Projectile.owner]; - if (Main.rand.Next(100) < owner.GetWeaponCrit(owner.ActiveItem()) + 20) - modifiers.SetCrit(); + modifiers.SetCrit(); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/MantisClawSlash.cs b/Projectiles/Melee/MantisClawSlash.cs index bdf5b9b823..a0783efbce 100644 --- a/Projectiles/Melee/MantisClawSlash.cs +++ b/Projectiles/Melee/MantisClawSlash.cs @@ -1,51 +1,37 @@ -using CalamityMod.Projectiles.Typeless; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using CalamityMod.Items.BaseItems; -using Terraria.ModLoader; -using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; -using CalamityMod.Balancing; -using Terraria.Audio; -using CalamityMod.Items.Weapons.Melee; -using System; -using CalamityMod.Particles; +using Terraria; using Terraria.DataStructures; -using System.Collections.Generic; -using CalamityMod.Graphics.Primitives; -using Terraria.Graphics.Shaders; -using CalamityMod.Buffs.DamageOverTime; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { public class MantisClawSlash : ModProjectile, ILocalizedModType { - public int TimerCap => 20; - public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Particles/SlashSmear"; + private const int TimerCap = 20; Color startColor; Color endColor; + int dir = 1; public override void SetDefaults() { Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 60; Projectile.timeLeft = TimerCap; - Projectile.knockBack = 2; Projectile.tileCollide = false; Projectile.width = 256; Projectile.height = 256; Projectile.friendly = true; Projectile.penetrate = -1; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeDamageClass.Instance; } - int dir = 1; - public override void OnSpawn(IEntitySource source) { Projectile.scale = 0f; @@ -53,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.rand.NextBool(2)) dir = -1; - // i cherry picked five specific colors to make a similar but different palette to the claws themselves + // I cherry picked five specific colors to make a similar but different palette to the claws themselves // of those five, the projectile lerps between two, randomly chosen when the projectile is spawned List ColorList = [ @@ -89,23 +75,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = Projectile.velocity.RotatedBy(MathHelper.ToRadians(3f) * dir); Projectile.ai[1]++; - Projectile.ai[0] = MathHelper.Lerp(Projectile.ai[0], MathHelper.TwoPi * dir, 0.15f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override bool? CanDamage() - { - return true; - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); public override bool PreDraw(ref Color lightColor) { @@ -116,7 +90,6 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), Color.Lerp(startColor, endColor, Projectile.ai[1] / TimerCap).MultiplyRGBA(new Color(255, 255, 255, 0f)), Projectile.rotation - (dir == -1 ? MathHelper.ToRadians(-135f) : MathHelper.ToRadians(180f)) + Projectile.ai[0], tex.Size() / 2, MathHelper.Lerp(0.6f, 1f, i) * Projectile.scale, dir == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically); } - 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/MendedBiomeBlade_TrueDecaysRetort.cs b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs index 56033def56..966f0d858e 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs @@ -30,9 +30,6 @@ namespace CalamityMod.Projectiles.Melee private Vector2 PowerLungeStart; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -140,10 +137,7 @@ namespace CalamityMod.Projectiles.Melee Owner.GiveUniversalIFrames(TrueBiomeBlade.EvilAttunement_SlashIFrames); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - - private void OnHitEffects(bool cannotLifesteal) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (ChargedUp) return; @@ -153,10 +147,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - if (!cannotLifesteal) //trolled - { - Owner.HealPlayer(TrueBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck - } + Owner.DoLifestealDirect(target, TrueBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; diff --git a/Projectiles/Melee/MonstrousKnife.cs b/Projectiles/Melee/MonstrousKnife.cs index 41b96a3f76..26a473b776 100644 --- a/Projectiles/Melee/MonstrousKnife.cs +++ b/Projectiles/Melee/MonstrousKnife.cs @@ -47,28 +47,6 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * Main.rand.NextFloat(0.05f, 0.1f)); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - int heal = (int)Math.Round(info.Damage * Main.rand.NextFloat(0.05f, 0.1f)); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + 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/NebulashFlail.cs b/Projectiles/Melee/NebulashFlail.cs index 04c51a2b4f..0e71521e37 100644 --- a/Projectiles/Melee/NebulashFlail.cs +++ b/Projectiles/Melee/NebulashFlail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 2; + Projectile.localNPCHitCooldown = 6; } public override Color SpecialDrawColor => new(255, 200, 0); public override int ExudeDustType => ModContent.DustType(); diff --git a/Projectiles/Melee/PwnagehammerProj.cs b/Projectiles/Melee/PwnagehammerProj.cs index 3f656010c7..5235f02946 100644 --- a/Projectiles/Melee/PwnagehammerProj.cs +++ b/Projectiles/Melee/PwnagehammerProj.cs @@ -92,7 +92,8 @@ namespace CalamityMod.Projectiles.Melee else SoundEngine.PlaySound(UseSound with { Pitch = EmpoweredHammer * 0.1f - 0.2f }, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); return false; } 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/RespiteblockHoldout.cs b/Projectiles/Melee/RespiteblockHoldout.cs index d999e088e3..4ec0e55ed9 100644 --- a/Projectiles/Melee/RespiteblockHoldout.cs +++ b/Projectiles/Melee/RespiteblockHoldout.cs @@ -113,13 +113,7 @@ namespace CalamityMod.Projectiles.Melee SoundStyle fire = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit", 2); SoundEngine.PlaySound(fire with { Volume = 0.55f, Pitch = 0.3f }, Projectile.Center); - - if (player.moonLeech || player.lifeSteal <= 0f || target.lifeMax <= 5) - return; - - int heal = Main.rand.NextBool(4) ? 2 : 1; - player.lifeSteal -= heal; - player.HealPlayer(heal); + player.DoLifestealDirect(target, Main.rand.NextBool(4) ? 2 : 1, 0.75f); } public void PlayChainsawSounds() 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/BotanicPiercerProjectile.cs b/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs index 6c829928f4..3960a33083 100644 --- a/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs +++ b/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void SetDefaults() { Projectile.width = Projectile.height = 40; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.friendly = true; Projectile.hostile = false; @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.penetrate = -1; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 8; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 76bbf419ed..5a96b2970e 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -1,58 +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); - - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.002)); } } } diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index 88f394f1cc..8d20e38bb7 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void SetDefaults() { Projectile.width = Projectile.height = 40; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.friendly = true; Projectile.hostile = false; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.8f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 2.4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), Projectile.knockBack * 0.85f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 2f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.85f, Projectile.owner); }; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) 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/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 4be39fcdda..a4ce26890d 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -277,19 +277,6 @@ namespace CalamityMod.Projectiles.Melee #endregion Drawing #region Hit Effects and Collision - - public void OnHitHealEffect(int damage) - { - int heal = (int)Math.Round(damage * 0.025); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float point = 0f; @@ -300,9 +287,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), Terratomere.TrueMeleeGlacialStateTime); - - if (target.lifeMax > 5) - OnHitHealEffect(hit.Damage); + Owner.DoLifestealDirect(target, (int)Math.Round(hit.Damage * 0.025), 0.75f); // Create a slash creator on top of the hit target. int slashCreatorID = ModContent.ProjectileType(); @@ -312,12 +297,6 @@ namespace CalamityMod.Projectiles.Melee Owner.ownedProjectileCounts[slashCreatorID]++; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), Terratomere.TrueMeleeGlacialStateTime); - OnHitHealEffect(info.Damage); - } #endregion Hit Effects and Collision } } 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/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs index 68dda29ff5..50216466a3 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.width = Projectile.height = 60; Projectile.width = Projectile.height = 60; Projectile.tileCollide = false; diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs index 47863bc102..cd19d30216 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs @@ -57,10 +57,7 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(Spark); } - if (Owner.moonLeech) - return; - - Owner.HealPlayer(OmegaBiomeBlade.SuperPogoAttunementSliceLifesteal); + Owner.DoLifestealDirect(target, OmegaBiomeBlade.SuperPogoAttunementSliceLifesteal, 0.75f); } public override bool PreDraw(ref Color lightColor) //OMw to reuse way too much code from the entangling vines 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/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index 067878f5a1..8e5be19829 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -2,6 +2,7 @@ using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.NPCs; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,23 +14,17 @@ using CalamityMod.Particles; namespace CalamityMod.Projectiles.Melee.Yoyos { + // Although normally yoyos are automatically exempted from pierce resist, + // the damage logic for the buzzsaw briefly clobbers aiStyle, necessitating a manual pierce resist exception. + [PierceResistException] public class LaceratorYoyo : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public const int MaxUpdates = 3; - private static int CircleRes = 60; - private static int VertRes = 4; - private static int SpikeCount = 8; - - private float circleProgress = 0; - private float verticalProgress = 1; - private bool goingUp = false; public float chargeProgress = 0; - private bool sawHit = false; private bool spawnedBlood = false; - private int sawDir = 0; public override void SetStaticDefaults() @@ -63,6 +58,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos chargeProgress = 1; if (chargeProgress > 0) { + // Handles damage logic for the buzzsaw visual if (Main.player[Projectile.owner].miscCounter % 5 == 0 && Projectile.FinalExtraUpdate() && chargeProgress > 0.05f) { spawnedBlood = false; @@ -71,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.height = 196; Projectile.Center = Projectile.position; Projectile.originalDamage = Projectile.damage; - Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 1f, chargeProgress)); + Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 0.75f, chargeProgress)); sawHit = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.aiStyle = -1; @@ -108,11 +104,10 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { if (sawHit) { - target.AddBuff(ModContent.BuffType(), 60); Vector2 bloodpos = Projectile.Center + Projectile.DirectionTo(target.Center) * 84; if (!spawnedBlood && Main.rand.NextBool() && chargeProgress > 0.2f && target.Hitbox.Contains(bloodpos.ToPoint())) { - Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 1, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 4, 0f, Projectile.owner); spawnedBlood = true; } return; diff --git a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs index 83942f5fa5..b96f270a03 100644 --- a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs +++ b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public const int MaxUpdates = 2; + public ref float Timer => ref Projectile.localAI[2]; public override void SetStaticDefaults() { @@ -34,19 +35,17 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { + Timer++; if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); if (Main.rand.NextBool(5 * MaxUpdates)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.JungleSpore, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); if (Projectile.owner == Main.myPlayer) { - if (Main.rand.NextBool(10 * MaxUpdates)) + if (Timer % (10 * MaxUpdates) == 0) { - Projectile spore = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * Main.rand.NextFloat(0.15f, 0.35f) + Vector2.UnitX.RotatedByRandom(MathHelper.Pi), ProjectileID.SporeGas + Main.rand.Next(3), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner); + Projectile spore = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * Main.rand.NextFloat(0.15f, 0.35f) + Vector2.UnitX.RotatedByRandom(MathHelper.Pi), ProjectileID.SporeGas + Main.rand.Next(3), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); spore.DamageType = DamageClass.MeleeNoSpeed; - spore.usesLocalNPCImmunity = true; - spore.usesIDStaticNPCImmunity = false; - spore.localNPCHitCooldown = 30; } } } diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 9c1a966825..51e9c5e621 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -40,23 +40,17 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); - } - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - if (Projectile.owner == Main.myPlayer) + for (int i = 0; i < 2; i++) // Burst into 2 shards upwards { - for (int i = -1; i < 2; i++) // Burst into 3 shards upwards - { - Vector2 baseVelocity = Vector2.UnitY * -12f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Top, baseVelocity.RotatedBy(MathHelper.ToRadians(10 * i)), ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack * 0.25f, Projectile.owner); - } + Vector2 baseVelocity = Vector2.UnitY * -12f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Top, baseVelocity.RotatedByRandom(MathHelper.Pi * 0.1f), ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack * 0.25f, Projectile.owner); } } + public override void OnKill(int timeLeft) => SoundEngine.PlaySound(SoundID.Item14, Projectile.position); + public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index 5a1869b20e..87e63d5d6e 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -198,7 +198,7 @@ namespace CalamityMod.Projectiles.Ranged { if (improvedHeal) { - BloodstoneHealOrb.Heal(player, 8); + BloodstoneHealOrb.Heal(player, 6); } Projectile.Kill(); diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index fed7ab39e5..fa3534bfaa 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -116,12 +116,6 @@ namespace CalamityMod.Projectiles.Ranged Player player = Main.player[Projectile.owner]; player.lifeRegenTime += 2; - if (player.moonLeech) - return; - - if (target.lifeMax <= 5) - return; - float lifeRatio = (float)player.statLife / player.statLifeMax2; float averageHealAmount = MathHelper.Lerp(4.0f, 0.5f, lifeRatio); // Average heal increases from 1/2 to 4 HP based on missing health int guaranteedHeal = (int)averageHealAmount; @@ -129,11 +123,7 @@ namespace CalamityMod.Projectiles.Ranged float chanceOfOneMoreHP = averageHealAmount - guaranteedHeal; bool bonusHeal = Main.rand.NextFloat() < chanceOfOneMoreHP; int finalHeal = guaranteedHeal + (bonusHeal ? 1 : 0); - if (finalHeal > BalancingConstants.LifeStealCap) - finalHeal = BalancingConstants.LifeStealCap; - - if (finalHeal > 0) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], finalHeal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + player.SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, finalHeal, 0.5f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/BuzzkillHoldout.cs b/Projectiles/Ranged/BuzzkillHoldout.cs index 04c8fdb96e..c10454ba39 100644 --- a/Projectiles/Ranged/BuzzkillHoldout.cs +++ b/Projectiles/Ranged/BuzzkillHoldout.cs @@ -82,13 +82,16 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle ShootSound = new("CalamityMod/Sounds/Item/SawShot", 2) { PitchVariance = 0.1f, Volume = 0.4f + SawPower * 0.5f }; SoundEngine.PlaySound(ShootSound, GunTipPosition); - float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower) / 1.5f; // The damage must be divided by 1.5 to offset the holdout having 1.5x base damage. - int sawPierce = (int)MathHelper.Lerp(2f, 6f, SawPower); int sawLevel = (SawPower >= 1f).ToInt() + (SawPower >= 0.25f).ToInt(); + if (Main.myPlayer == Projectile.owner) + { + float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower) / 1.5f; // The damage must be divided by 1.5 to offset the holdout having 1.5x base damage. + int sawPierce = (int)MathHelper.Lerp(2f, 6f, SawPower); - Projectile buzzsaw = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * Owner.ActiveItem().shootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * sawDamageMult), (int)(Projectile.knockBack * (sawDamageMult / 2)), Main.myPlayer, sawLevel); - buzzsaw.penetrate = sawPierce; - buzzsaw.rotation = Main.rand.NextFloat(0f, MathHelper.TwoPi); + Projectile buzzsaw = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * Owner.ActiveItem().shootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * sawDamageMult), (int)(Projectile.knockBack * (sawDamageMult / 2)), Main.myPlayer, sawLevel); + buzzsaw.penetrate = sawPierce; + buzzsaw.rotation = Main.rand.NextFloat(0f, MathHelper.TwoPi); + } NoSawOnHoldout = true; OffsetLengthFromArm -= 4f + 12f * SawPower; diff --git a/Projectiles/Ranged/CardHeart.cs b/Projectiles/Ranged/CardHeart.cs index 368d219ab7..0ce2fd9a85 100644 --- a/Projectiles/Ranged/CardHeart.cs +++ b/Projectiles/Ranged/CardHeart.cs @@ -59,17 +59,7 @@ namespace CalamityMod.Projectiles.Ranged } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.01), 0.4f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Ranged/FirestormCannonHoldout.cs b/Projectiles/Ranged/FirestormCannonHoldout.cs new file mode 100644 index 0000000000..9b1b5d20bc --- /dev/null +++ b/Projectiles/Ranged/FirestormCannonHoldout.cs @@ -0,0 +1,164 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FirestormCannonHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 16f; + public override float BaseOffsetY => -5f; + public override float OffsetYDownwards => 5f; + public override Vector2 GunTipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.35f; + + public static readonly SoundStyle WarningSound = new SoundStyle("CalamityMod/Sounds/Item/FireImplosion") with { Volume = 0.75f }; + public static readonly SoundStyle OverheatSound = new("CalamityMod/Sounds/Item/HeliumFlashSteamRelease"); + public SlotId WarningSlot; + public ref float Timer => ref Projectile.ai[0]; + private int BuiltHeat => (Owner.ActiveItem().ModItem as FirestormCannon).BuiltUpHeat; + private bool displayOverheat = false; + private const int WarningTime = FirestormCannon.OverheatLevel - 100; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Ranged; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + public override void KillHoldoutLogic() + { + // What kills the holdout: + // Dead, CCed, Cursed, etc. + // Not holding the item + // Right-clicking (Can kill it early) (Does not work if in overheat state) + // Completely cooling while not firing + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type || + (Owner.Calamity().mouseRight && !displayOverheat) || (BuiltHeat == 0 && !Main.mouseLeft)) + { + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warn)) + warn.Stop(); + + Projectile.Kill(); + } + } + + public override void HoldoutAI() + { + // Timer should only increment while firing and not overheated + if (Main.mouseLeft && Owner.Calamity().flareGunOverheat == 0) + Timer++; + else + Timer = 0; + + // Once holding the fire button down long enough, start actually firing + if (Timer >= 30) + { + // For some reason using ActiveItem() here breaks its functionality while being held on the cursor + (Owner.HeldItem.ModItem as FirestormCannon).BuiltUpHeat++; + + // Overheat yourself if you fire too long + if (BuiltHeat >= FirestormCannon.OverheatLevel) + { + WarningSlot = SoundEngine.PlaySound(OverheatSound, Owner.Center); + for (int e = 0; e < 7; e++) + { + Vector2 dustVel = -Projectile.rotation.ToRotationVector2().RotatedByRandom(MathHelper.Pi * 0.15f) * Main.rand.NextFloat(3.8f, 5.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.Flare, dustVel, Scale: 1.5f); + dust.noGravity = true; + } + + // Overheat damage ignores defense and is undodgeable, also inflicts On Fire + Owner.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FlareGunOverheat").ToNetworkText(Owner.name)), FirestormCannon.OverheatDamage, 1, dodgeable: false, scalingArmorPenetration: 1f, knockback: 0f); + Owner.AddBuff(BuffID.OnFire, FirestormCannon.OverheatCooldown); + Owner.Calamity().flareGunOverheat = FirestormCannon.OverheatCooldown; + displayOverheat = true; + return; + } + + // Play a warning sound + if (BuiltHeat == WarningTime) + { + WarningSlot = SoundEngine.PlaySound(WarningSound, Owner.Center); + } + + // Controls the escalating firing speed + float firingLerp = Utils.GetLerpValue(0, 90, Timer - 30, true); + int firingFrequency = (int)MathHelper.Lerp(HeldItem.useTime, HeldItem.useTime / 2, firingLerp); + // Actually fire shtuff + if (Timer % firingFrequency == 0) + { + SoundEngine.PlaySound(SoundID.Item11 with { Volume = 0.8f }, Owner.Center); + if (Main.myPlayer == Projectile.owner) + { + Owner.PickAmmo(HeldItem, out int flareType, out _, out _, out _, out _, Main.rand.Next(100) >= 70); + Vector2 velocity = Projectile.velocity.RotatedByRandom(MathHelper.Pi * 0.04f * (1f + firingLerp * 0.5f)) * Owner.ActiveItem().shootSpeed; + Projectile flare = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, velocity, flareType, Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f, 1f); + flare.penetrate = 3; + flare.MaxUpdates = 2; + flare.timeLeft = 600; + flare.DamageType = DamageClass.Ranged; + flare.usesIDStaticNPCImmunity = false; + flare.usesLocalNPCImmunity = true; + flare.localNPCHitCooldown = 30 * 2; + } + } + } + + // Reset overheat draw color once the heat passes below the warning indicator + if (BuiltHeat < WarningTime) + displayOverheat = false; + // Draw smoke effect while overheated + if (displayOverheat && Main.rand.NextBool(3)) + { + HeavySmokeParticle smoke = new(GunTipPosition, -Vector2.UnitY * 7.5f, Color.DarkGray, 25, 0.4f, 0.75f); + GeneralParticleHandler.SpawnParticle(smoke); + } + // Constantly move the warning sound on top of the player + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warning) && warning.IsPlaying) + warning.Position = Projectile.Center; + } + + // Pan-searing mechanic; reduces heat a bit + public override bool? CanDamage() => BuiltHeat >= 120 && Owner.Calamity().flareGunOverheat == 0; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire, 300); + (Owner.HeldItem.ModItem as FirestormCannon).BuiltUpHeat -= 6; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Color tintColor = displayOverheat ? Color.Black : + BuiltHeat >= WarningTime ? Color.Lerp(Color.Tomato, Color.White, MathF.Abs(MathF.Sin(Owner.miscCounter * MathHelper.Pi / 30f))) : Color.Tomato; + + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(Utils.GetLerpValue(0, WarningTime, BuiltHeat, true) * 0.45f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(tintColor); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + return false; + } + } +} diff --git a/Projectiles/Ranged/Flash.cs b/Projectiles/Ranged/Flash.cs index a5eb54f88e..861de2d98c 100644 --- a/Projectiles/Ranged/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -23,73 +23,21 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.timeLeft = 5; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; } public override void AI() { Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f); Color dustColor = Projectile.ai[1] == 1f ? CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f) : default; - bool xflag = false; - bool yflag = false; - if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0]) - { - xflag = 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(-30, 31); - float rand2 = (float)Main.rand.Next(-30, 31); - float rand3 = (float)Main.rand.Next(9, 27); - float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2)); - randAdjust = rand3 / randAdjust; - rand1 *= randAdjust; - rand2 *= randAdjust; - int flashDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PortalBoltTrail, 0f, 0f, 100, dustColor, 2f); - Dust dust = Main.dust[flashDust]; - 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++; - } - } + float randRot = Main.rand.NextFloat(MathHelper.TwoPi); - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Confused, 300); + for (int i = 0; i < 4; i++) + { + Vector2 dustVel = Vector2.UnitX.RotatedBy(MathHelper.PiOver2 * i + randRot) * 3f; + Dust flashDust = Dust.NewDustPerfect(Projectile.Center, DustID.PortalBoltTrail, dustVel, 100, dustColor, 1.5f); + flashDust.noGravity = true; + } } } } diff --git a/Projectiles/Ranged/FossilShard.cs b/Projectiles/Ranged/FossilShard.cs index 04c56abf8c..03a853f3db 100644 --- a/Projectiles/Ranged/FossilShard.cs +++ b/Projectiles/Ranged/FossilShard.cs @@ -23,11 +23,10 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.ai[1] != 1f) { - if (Projectile.velocity.Y <= 0f) - Projectile.velocity.Y = 0.1f; - Projectile.velocity.Y *= 1.05f; + if (Projectile.velocity.Y <= -2f) + Projectile.velocity.Y = -2f; } - + Projectile.velocity.Y += 0.025f; Projectile.rotation += Projectile.velocity.Y; } diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index be4ba1de28..1bed54d8eb 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -77,7 +77,10 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 450); + //Doze - I gave this long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + //Both Elf Melter and Flamethrower in vanilla do 20 seconds of their debuff. This is done to match. + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(20)); SoundEngine.PlaySound(HalleysInferno.Hit, Projectile.Center); // Dust emission on hit diff --git a/Projectiles/Ranged/HydraHead.cs b/Projectiles/Ranged/HydraHead.cs index f6439a1330..f40a49a417 100644 --- a/Projectiles/Ranged/HydraHead.cs +++ b/Projectiles/Ranged/HydraHead.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged //Calculation for damage and co Owner.PickAmmo(heldItem, out _, out float itemVelocity, out int itemDamage, out float itemKB, out _); int type = ModContent.ProjectileType(); - for (int i = 0; i < 3; i++) + for (int i = 0; i < Hydra.BulletsPerShot - 1; i++) { Vector2 spreadDirection = shootDirection.RotatedByRandom(MathHelper.ToRadians(Hydra.ShotSpread / 2f)); float spreadVelocity = itemVelocity * Main.rand.NextFloat(1f, 1.4f); 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/OntoligicalDespoilerBurst.cs b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs index 4de91212fa..8877b11310 100644 --- a/Projectiles/Ranged/OntoligicalDespoilerBurst.cs +++ b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -28,10 +29,17 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.45f; int hitsToMinMult = 15; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult; + modifiers.SourceDamage *= (damageMult + critDamage); + + Vector2 launchVel = Projectile.Center.DirectionTo(target.Center); + float launchPower = 20; + target.MoveNPC(launchVel, launchPower, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 450, targetHitbox); } diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index 181d634eea..decb1d6519 100644 --- a/Projectiles/Ranged/OntologicalDespoilerBeam.cs +++ b/Projectiles/Ranged/OntologicalDespoilerBeam.cs @@ -116,6 +116,17 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle fire2 = new("CalamityMod/Sounds/Item/MeldExplosion"); SoundEngine.PlaySound(fire2 with { Volume = 1, Pitch = Main.rand.NextFloat(-0.5f, -0.6f) }, Projectile.Center); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + modifiers.SourceDamage *= 1 + critDamage; + + Vector2 launchVel = Projectile.velocity; + float launchPower = 60; + target.MoveNPC(launchVel, launchPower, true); + } public override bool? CanDamage() => Projectile.numHits < 1 ? null : false; public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index fec35012f6..d9536f73f1 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle fire2 = new("CalamityMod/Sounds/Item/ShadowboltReflect"); SoundEngine.PlaySound(fire2 with { Volume = 0.9f, Pitch = -0.4f}, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 14f), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 12f), 0, Projectile.owner, 0, 0, 0); } else { @@ -199,6 +199,13 @@ namespace CalamityMod.Projectiles.Ranged useColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); return useColor; } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + modifiers.SourceDamage *= 1 + critDamage; + } public override bool PreDraw(ref Color lightColor) { if (time < 2) diff --git a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs index cf66a738c5..9ee761fe41 100644 --- a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs +++ b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs @@ -207,8 +207,8 @@ namespace CalamityMod.Projectiles.Ranged ChargeSound?.Stop(); Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; - int charge2DamagePos = Projectile.damage; // Most of the damage comes from the explosion - int charge2DamageNeg = Projectile.damage * 32; // Big charge time? Check. No pierce? Check. 32x damage? Yes! + int charge2DamagePos = (int)(Projectile.damage * 0.5f); // Most of the damage comes from the explosion + int charge2DamageNeg = Projectile.damage * 20; // Big charge time? Check. No pierce? Check. 20x damage? Yes! if (Positive) { @@ -267,7 +267,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 3; i++) { float angle = i == 0 ? -0.25f : i == 2 ? 0.25f : 0; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec.RotatedBy(angle) * (1 - Math.Abs(angle * 0.25f)), ModContent.ProjectileType(), (int)(Projectile.damage / 1.5f), Projectile.knockBack, Projectile.owner, 0, 0, i); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec.RotatedBy(angle) * (1 - Math.Abs(angle * 0.25f)), ModContent.ProjectileType(), (int)(Projectile.damage / 1.2f), Projectile.knockBack, Projectile.owner, 0, 0, i); } } else diff --git a/Projectiles/Ranged/OntologicalDespoilerShot.cs b/Projectiles/Ranged/OntologicalDespoilerShot.cs index 0056e5832b..2d0d3f96e2 100644 --- a/Projectiles/Ranged/OntologicalDespoilerShot.cs +++ b/Projectiles/Ranged/OntologicalDespoilerShot.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - float minMult = 0.35f; + float minMult = 0.3f; int hitsToMinMult = 3; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); modifiers.SourceDamage *= damageMult; 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/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index 79fef66857..6e945c6f49 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -81,14 +81,7 @@ namespace CalamityMod.Projectiles.Ranged Main.projectile[proj].scale = (Projectile.ai[1] * 0.5f) + 1f; } - int heal = (int)Math.Round(hit.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), (int)Math.Round(hit.Damage * 0.05)); } } } diff --git a/Projectiles/Ranged/SpectralFlare.cs b/Projectiles/Ranged/SpectralFlare.cs new file mode 100644 index 0000000000..d8e99defad --- /dev/null +++ b/Projectiles/Ranged/SpectralFlare.cs @@ -0,0 +1,88 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; +using Terraria; +using Terraria.ID; +using CalamityMod.Buffs.DamageOverTime; +using System; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SpectralFlare : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 6; + Projectile.scale = 1.15f; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.netImportant = true; + Projectile.aiStyle = ProjAIStyleID.Flare; + Projectile.alpha = 255; + Projectile.penetrate = 3; + Projectile.MaxUpdates = 2; + Projectile.timeLeft = 600; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30 * Projectile.MaxUpdates; + DrawOriginOffsetY = -10; + } + + public override bool PreAI() + { + if (Projectile.alpha > 0) + { + Projectile.alpha -= 80; + if (Projectile.alpha < 0) + Projectile.alpha = 0; + } + + float xVel = Projectile.ai[0]; + float yVel = Projectile.ai[1]; + if (xVel == 0f && yVel == 0f) + xVel = 1f; + float dist = MathF.Sqrt(xVel * xVel + yVel * yVel); + dist = 4f / dist; + xVel *= dist; + yVel *= dist; + + if (Projectile.alpha < 70) + { + Dust dust = Dust.NewDustDirect(Projectile.position - Vector2.UnitY * 2f, 7, 7, DustID.SpectreStaff, Projectile.velocity.X, Projectile.velocity.Y, Scale: 1.15f); + dust.noGravity = true; + dust.velocity *= 0.3f; + dust.position.X -= xVel; + dust.position.Y -= yVel; + dust.velocity.X -= xVel; + dust.velocity.Y -= yVel; + } + + if (Projectile.localAI[0] == 0f) + { + Projectile.ai[0] = Projectile.velocity.X; + Projectile.ai[1] = Projectile.velocity.Y; + + if (Projectile.localAI[1] == 1f) + { + Projectile.velocity.Y += 0.09f; + if (Projectile.velocity.Y > 16f) + Projectile.velocity.Y = 16f; + } + } + else + { + if (!Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + { + Projectile.localAI[0] = 0f; + Projectile.localAI[1] = 1f; + } + + Projectile.damage = 0; + } + Projectile.rotation = MathF.Atan2(Projectile.ai[1], Projectile.ai[0]) + MathHelper.PiOver2; + + return false; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), Main.rand.NextBool(3) ? 600 : 300); + } +} diff --git a/Projectiles/Ranged/SpectralFlare.png b/Projectiles/Ranged/SpectralFlare.png new file mode 100644 index 0000000000..ecba14a897 Binary files /dev/null and b/Projectiles/Ranged/SpectralFlare.png differ diff --git a/Projectiles/Ranged/SpectralstormCannonHoldout.cs b/Projectiles/Ranged/SpectralstormCannonHoldout.cs new file mode 100644 index 0000000000..4f3e4e59d9 --- /dev/null +++ b/Projectiles/Ranged/SpectralstormCannonHoldout.cs @@ -0,0 +1,205 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using System; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SpectralstormCannonHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 16f; + public override float BaseOffsetY => -5f; + public override float OffsetYDownwards => 5f; + public override Vector2 GunTipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.35f; + + public static readonly SoundStyle OverheatSound = new SoundStyle("CalamityMod/Sounds/Custom/AbilitySounds/OmegaBlueAbility") with { Pitch = -0.5f }; + public SlotId WarningSlot; + public ref float Timer => ref Projectile.ai[0]; + public ref float SoulTimer => ref Projectile.ai[1]; + private int BuiltHeat => (Owner.ActiveItem().ModItem as SpectralstormCannon).BuiltUpHeat; + private bool displayOverheat = false; + private const int WarningTime = SpectralstormCannon.OverheatLevel - 100; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Ranged; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + public override void KillHoldoutLogic() + { + // What kills the holdout: + // Dead, CCed, Cursed, etc. + // Not holding the item + // Right-clicking (Can kill it early) (Does not work if in overheat state) + // Completely cooling while not firing + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type || + (Owner.Calamity().mouseRight && !displayOverheat) || (BuiltHeat == 0 && !Main.mouseLeft)) + { + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warn)) + warn.Stop(); + + Projectile.Kill(); + } + } + + public override void HoldoutAI() + { + // Timer should only increment while firing and not overheated + if (Owner.Calamity().flareGunOverheat == 0) + { + if (Main.mouseLeft) + { + Timer++; + SoulTimer = 0; + } + else + { + Timer = 0; + SoulTimer++; + } + } + else + { + Timer = 0; + SoulTimer = 0; + } + + // Once holding the fire button down long enough, start actually firing + if (Timer >= 30) + { + // For some reason using ActiveItem() here breaks its functionality while being held on the cursor + (Owner.HeldItem.ModItem as SpectralstormCannon).BuiltUpHeat++; + + // Overheat yourself if you fire too long + if (BuiltHeat >= SpectralstormCannon.OverheatLevel) + { + WarningSlot = SoundEngine.PlaySound(OverheatSound, Owner.Center); + for (int e = 0; e < 7; e++) + { + Vector2 dustVel = -Projectile.rotation.ToRotationVector2().RotatedByRandom(MathHelper.Pi * 0.15f) * Main.rand.NextFloat(3.8f, 5.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.Flare, dustVel, Scale: 1.5f); + dust.noGravity = true; + } + + // Overheat damage ignores defense and is undodgeable, also inflicts Nightwither + Owner.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FlareGunOverheat").ToNetworkText(Owner.name)), SpectralstormCannon.OverheatDamage, 1, dodgeable: false, scalingArmorPenetration: 1f, knockback: 0f); + Owner.AddBuff(ModContent.BuffType(), SpectralstormCannon.OverheatCooldown); + Owner.Calamity().flareGunOverheat = SpectralstormCannon.OverheatCooldown; + displayOverheat = true; + // Spectralstorm Cannon's overheat immediately resets heat after triggered + (Owner.HeldItem.ModItem as SpectralstormCannon).BuiltUpHeat = 1; + + // Spawn a burst of souls on overheat + if (Main.myPlayer == Projectile.owner) + { + for (int i = 0; i < 25; i++) + { + Vector2 soulVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4f, 7.5f); + Projectile soul = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, soulVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.15f), 0f, Projectile.owner); + soul.timeLeft = 250; + soul.DamageType = DamageClass.Ranged; + soul.frame = Main.rand.Next(4); + } + } + return; + } + + // Play a warning sound + if (BuiltHeat == WarningTime) + { + WarningSlot = SoundEngine.PlaySound(FirestormCannonHoldout.WarningSound, Owner.Center); + } + + // Controls the escalating firing speed + float firingLerp = Utils.GetLerpValue(0, 90, Timer - 30, true); + int firingFrequency = (int)MathHelper.Lerp(HeldItem.useTime, HeldItem.useTime / 2, firingLerp); + // Actually fire shtuff + if (Timer % firingFrequency == 0) + { + SoundEngine.PlaySound(SoundID.Item11 with { Volume = 0.8f }, Owner.Center); + if (Main.myPlayer == Projectile.owner) + { + Owner.PickAmmo(HeldItem, out _, out _, out _, out _, out _, Main.rand.Next(100) >= 70); + Vector2 velocity = Projectile.velocity.RotatedByRandom(MathHelper.Pi * 0.015f * (1f + firingLerp * 0.25f)) * Owner.ActiveItem().shootSpeed; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + } + } + + // Fire souls while dissipating heat + if (SoulTimer % 8 == 4f) + { + if (SoulTimer % 16 == 4f) + SoundEngine.PlaySound(SoundID.Item103 with { Volume = 0.7f }, Owner.Center); + if (Main.myPlayer == Projectile.owner) + { + Vector2 velocity = Projectile.velocity.RotatedByRandom(MathHelper.Pi * 0.03f) * Owner.ActiveItem().shootSpeed * 0.8f; + Projectile soul = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, velocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 2f); + soul.DamageType = DamageClass.Ranged; + soul.frame = Main.rand.Next(4); + } + } + + // Reset overheat draw color once the overheat ends + if (Owner.Calamity().flareGunOverheat == 0) + displayOverheat = false; + // Draw smoke effect while overheated + if (displayOverheat && Main.rand.NextBool(3)) + { + HeavySmokeParticle smoke = new(GunTipPosition, -Vector2.UnitY * 7.5f, Color.DarkCyan, 25, 0.4f, 0.75f); + GeneralParticleHandler.SpawnParticle(smoke); + } + // Constantly move the warning sound on top of the player + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warning) && warning.IsPlaying) + warning.Position = Projectile.Center; + } + + // Pan-searing mechanic; reduces heat a bit + public override bool? CanDamage() => BuiltHeat >= 120 && Owner.Calamity().flareGunOverheat == 0; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire3, 300); + (Owner.HeldItem.ModItem as SpectralstormCannon).BuiltUpHeat -= 6; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Color tintColor = displayOverheat ? Color.Black : + BuiltHeat >= WarningTime ? Color.Lerp(Color.LightSalmon, Color.White, MathF.Abs(MathF.Sin(Owner.miscCounter * MathHelper.Pi / 30f))) : Color.LightSalmon; + float opacity = Utils.GetLerpValue(0, WarningTime, BuiltHeat, true); + + Projectile.DrawBackglow(Color.HotPink * opacity, 4f, null, null, (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipVertically : SpriteEffects.None); + + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity((displayOverheat ? 1f : opacity) * 0.45f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(tintColor); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + return false; + } + } +} diff --git a/Projectiles/Ranged/SproutingArrowMain.cs b/Projectiles/Ranged/SproutingArrowMain.cs index a11c438710..af42a4fbfc 100644 --- a/Projectiles/Ranged/SproutingArrowMain.cs +++ b/Projectiles/Ranged/SproutingArrowMain.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged float blastSize = 45; float minMultiplier = 0.4f; int hitsToMinMult = 4; - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25f), 0, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); blast.DamageType = DamageClass.Ranged; blast.ArmorPenetration = 8; @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged GeneralParticleHandler.SpawnParticle(sparker); Projectile split1 = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel1 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), Projectile.damage * 2, 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); Projectile split2 = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel2 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), Projectile.damage * 2, 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); - if (Projectile.Calamity().conditionalHomingRange > 0f) // Allows the split arrows to home when using Arterial Assault as well + if (Projectile.Calamity().conditionalHomingRange > 0f) // Allows the split arrows to home if the main arrow homes { split1.Calamity().conditionalHomingRange = Projectile.Calamity().conditionalHomingRange; split2.Calamity().conditionalHomingRange = Projectile.Calamity().conditionalHomingRange; 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/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index ce88e9d5ee..636d1ed595 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -12,11 +12,11 @@ namespace CalamityMod.Projectiles.Rogue public class AuroradicalStar : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public int[] dustTypes = new int[] - { + public int[] dustTypes = + [ ModContent.DustType(), ModContent.DustType() - }; + ]; public override void SetStaticDefaults() { @@ -107,39 +107,26 @@ namespace CalamityMod.Projectiles.Rogue } } - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - - public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - OnHitEffect(target.Center, target.width); + OnHitEffect(target); } - - private void OnHitEffect(Vector2 targetPos, int width) - { - if (Projectile.Calamity().stealthStrike && Main.myPlayer == Projectile.owner) - { - Vector2 pos = new Vector2(targetPos.X + width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (targetPos - pos) / 40f; - int comet = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25), Projectile.knockBack, Projectile.owner); - if (comet.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[comet].DamageType = RogueDamageClass.Instance; - Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3); - } - } - } - public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 180); - OnHitEffect(target.Center, target.width); + OnHitEffect(target); + } + private void OnHitEffect(Entity target) + { + if (Projectile.Calamity().stealthStrike && Main.myPlayer == Projectile.owner) + { + Vector2 pos = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + 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; + } } public override void OnKill(int timeLeft) @@ -166,5 +153,12 @@ namespace CalamityMod.Projectiles.Rogue } } } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + return false; + } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); } } diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index f4d204e888..7300ceacc7 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -60,10 +60,9 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.ExpandHitboxBy(128); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - int spikeAmt = Main.rand.Next(3, 4+1); if (Projectile.owner == Main.myPlayer) { - for (int s = 0; s < spikeAmt; s++) + for (int s = 0; s < 3; s++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner); @@ -72,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue for (int c = 0; c < cloudAmt; c++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 10f, 200f, 0.01f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), 0f, Projectile.owner, 0f, Projectile.Calamity().stealthStrike ? 1f : 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.6f), 0f, Projectile.owner, 0f, Projectile.Calamity().stealthStrike ? 1f : 0f); } } for (int d = 0; d < 5; d++) @@ -99,42 +98,13 @@ namespace CalamityMod.Projectiles.Rogue Vector2 goreSource = Projectile.Center; int goreAmt = 3; Vector2 source = new Vector2(goreSource.X - 24f, goreSource.Y - 24f); - for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) + for (int goreIndex = 1; goreIndex <= goreAmt; goreIndex++) { - float velocityMult = 0.33f; - if (goreIndex < (goreAmt / 3)) - { - velocityMult = 0.66f; - } - if (goreIndex >= (2 * goreAmt / 3)) - { - velocityMult = 1f; - } - Mod mod = ModContent.GetInstance(); + float velocityMult = 0.33f * goreIndex; int type = Main.rand.Next(61, 64); - int smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); + int smoke = Gore.NewGore(Projectile.GetSource_Death(), source, Main.rand.NextVector2CircularEdge(2f, 2f), type, 1f); Gore gore = Main.gore[smoke]; gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y += 1f; - type = Main.rand.Next(61, 64); - smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); - gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y += 1f; - type = Main.rand.Next(61, 64); - smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); - gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y -= 1f; - type = Main.rand.Next(61, 64); - smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); - gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y -= 1f; } } } @@ -144,7 +114,6 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 180); Projectile.Kill(); } - public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(BuffID.Venom, 180); diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 090ef8dd38..c9bece2786 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue else { // Gravity - Projectile.velocity.Y += 0.11f; + Projectile.velocity.Y += 0.07f; // Cap velocity. speed = Projectile.velocity.Length(); @@ -104,16 +104,14 @@ namespace CalamityMod.Projectiles.Rogue private void OnHitEffects(int damage) { - grind += 5; //THE GRIND NEVER STOPS - if (grind > 15) - grind = 15; // except when it's too much + grind += 6; //THE GRIND NEVER STOPS + if (grind > 18) + grind = 18; // except when it's too much if (Projectile.Calamity().stealthStrike && Projectile.owner == Main.myPlayer) //stealth strike attack { int projID = ModContent.ProjectileType(); - int bloodDamage = Projectile.damage; - float bloodKB = 1f; - int stealth = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi)*4f, projID, bloodDamage, bloodKB, Projectile.owner, 1f, 0.85f + Main.rand.NextFloat() * 1.15f); + int stealth = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 4f, projID, (int)(Projectile.damage * 0.5f), 1f, Projectile.owner, 1f, 0.85f + Main.rand.NextFloat() * 1.15f); if (stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].DamageType = RogueDamageClass.Instance; @@ -127,7 +125,7 @@ namespace CalamityMod.Projectiles.Rogue float spreadAmount = MathHelper.ToRadians(360); for (var i = 0; i < orbAmount; i++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.One.RotatedByRandom(spreadAmount) * 2f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.One.RotatedByRandom(spreadAmount) * 2f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 10, 0f, Projectile.owner); } } diff --git a/Projectiles/Rogue/BlunderBoosterLightning.cs b/Projectiles/Rogue/BlunderBoosterLightning.cs index 29bd9d4098..a22183b817 100644 --- a/Projectiles/Rogue/BlunderBoosterLightning.cs +++ b/Projectiles/Rogue/BlunderBoosterLightning.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public static int frameWidth = 12; public static int frameHeight = 26; + public int dir = 0; + public float intensity = 0; public override void SetStaticDefaults() { @@ -23,15 +25,17 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 10; - Projectile.height = 10; + Projectile.width = 40; + Projectile.height = 40; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = 120; + Projectile.extraUpdates = 2; + Projectile.timeLeft = 290; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15; + Projectile.localNPCHitCooldown = -1; + Projectile.ArmorPenetration = 15; } public override void AI() @@ -49,43 +53,20 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (Projectile.timeLeft < 55 && Projectile.ai[1] != 1f) - { - Projectile.tileCollide = true; - } - Projectile.ai[1]++; - if (Projectile.ai[1] >= 15f) - { - float minDist = 999f; - int index = -1; - foreach (NPC npc in Main.ActiveNPCs) - { - if (npc.CanBeChasedBy(Projectile, false)) - { - float dist = (Projectile.Center - npc.Center).Length(); - if (dist < minDist) - { - minDist = dist; - index = npc.whoAmI; - } - } - } - Vector2 velocityNew; - if (minDist < 999f && index != -1) - { - velocityNew = Main.npc[index].Center - Projectile.Center; - velocityNew.Normalize(); - velocityNew *= 2f; - Projectile.velocity += velocityNew; - if (Projectile.velocity.Length() > 10f) - { - Projectile.velocity.Normalize(); - Projectile.velocity *= 10f; - } - } + if (dir == 0) + { + Projectile.timeLeft -= Main.rand.Next(5, 20 + 1); + dir = Main.rand.NextBool() ? -1 : 1; + intensity = Main.rand.NextFloat(0.2f, 1.2f); } + + + if (Projectile.timeLeft < 190) + CalamityUtils.HomeInOnSelectedNPC(Projectile, Projectile.Center.ClosestNPCAt(1500), true, 0.65f * intensity, 8, 0.98f, 0.99f, true); + else + Projectile.velocity = Projectile.velocity.RotatedBy(0.04f * dir * intensity) * Main.rand.NextFloat(0.985f, 1f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Rogue/CorpusAvertorProj.cs b/Projectiles/Rogue/CorpusAvertorProj.cs index 7c00bf1283..c0175b8285 100644 --- a/Projectiles/Rogue/CorpusAvertorProj.cs +++ b/Projectiles/Rogue/CorpusAvertorProj.cs @@ -79,29 +79,9 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - - int heal = (int)Math.Round(hit.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.player[Projectile.owner].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.05)); } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - - int heal = (int)Math.Round(info.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.player[Projectile.owner].lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Rogue/CorpusAvertorStealth.cs b/Projectiles/Rogue/CorpusAvertorStealth.cs index 57b5178d67..9735ca9cc8 100644 --- a/Projectiles/Rogue/CorpusAvertorStealth.cs +++ b/Projectiles/Rogue/CorpusAvertorStealth.cs @@ -93,8 +93,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - if (target.lifeMax > 5 && Projectile.numHits == 0 && Slash == 0f) - OnHitEffects(hit.Damage); + if (target.IsAnEnemy(false) && Projectile.numHits == 0 && Slash == 0f) + { + Player player = Main.player[Projectile.owner]; + player.SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.025)); + if (Main.LocalPlayer.team == player.team && player.team != 0) + Main.LocalPlayer.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(20f), true); + } if (Projectile.numHits > 0 && !(target.life <= 0 && target.realLife == -1)) Projectile.damage = (int)(Projectile.damage * 0.9f); @@ -102,29 +107,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.damage = 1; } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - if (Projectile.numHits == 0 && Slash == 0f) - OnHitEffects(info.Damage); - } - - private void OnHitEffects(int damage) - { - Player player = Main.player[Projectile.owner]; - if (Main.LocalPlayer.team == player.team && player.team != 0) - { - Main.LocalPlayer.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(20f), true); - - int heal = (int)Math.Round(damage * 0.025); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.LocalPlayer, heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index f8f7e01382..c3b7f5d28c 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -32,8 +32,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ai[0]++; if (Projectile.ai[0] >= 20f) { - Projectile.velocity.Y += 0.35f; - Projectile.velocity.X *= 0.97f; + if (CalamityUtils.ClosestNPCAt(Projectile.Center, 280f) == null) + { + Projectile.velocity.Y += 0.35f; + Projectile.velocity.X *= 0.97f; + } + else + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 280f, 14f, 20f); } else { @@ -42,9 +47,6 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.velocity.Y > 15f) Projectile.velocity.Y = 15f; - - if (Projectile.ai[0] >= 20f) - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 280f, 14f, 20f); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Rogue/DeepWounderProjectile.cs b/Projectiles/Rogue/DeepWounderProjectile.cs index 8575ee7ec5..fac6e2ac45 100644 --- a/Projectiles/Rogue/DeepWounderProjectile.cs +++ b/Projectiles/Rogue/DeepWounderProjectile.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - Projectile.rotation += (StuckTo == null ? 0.2f : 0.35f) * Projectile.direction; + Projectile.rotation += (StuckTo == null ? 0.3f : 0.6f) * Projectile.direction; if (Projectile.Calamity().stealthStrike) { @@ -64,11 +64,10 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); if (Projectile.Calamity().stealthStrike) { - target.AddBuff(ModContent.BuffType(), 120); if (StuckTo == null) { StuckTo = target; diff --git a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs index 6788a60063..063e90bd0a 100644 --- a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs +++ b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Projectiles.Rogue public int maxStealthHits = 5; // How many bounces the stealth strike has. This does not include the inital and final hit, so be sure to take those into account if you adjust this. public Color mainColor = Color.White; + public Color c1 = new Color(121, 240, 17); + public Color c2 = new Color(0, 208, 240); public NPC lastHitTarget; public override void SetDefaults() @@ -57,8 +59,8 @@ namespace CalamityMod.Projectiles.Rogue float rate = (Main.GlobalTimeWrappedHourly * 6); List eColors = new List() { - Color.Turquoise, - Color.Orchid + c1, + c2 }; int colorIndex = (int)(rate / 2 % eColors.Count); Color currentColor = eColors[colorIndex]; @@ -189,7 +191,7 @@ namespace CalamityMod.Projectiles.Rogue c.velocity = (MathHelper.TwoPi * i / 12f).ToRotationVector2().RotatedBy(Projectile.rotation) * 5.5f * (i % 2 == 0 ? 0.8f : 1f); c.scale = 0.7f * (i % 2 == 0 ? 2.2f : 1.8f); c.noGravity = true; - c.color = i % 2 == 0 ? Color.Turquoise : Color.Orchid; + c.color = i % 2 == 0 ? c1 : c2; c.noLightEmittence = true; } @@ -304,12 +306,12 @@ namespace CalamityMod.Projectiles.Rogue dust2.scale = Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance); dust2.velocity = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5 * charge).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)) * finalHitMult; dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? Color.Turquoise : Color.Orchid; + dust2.color = Main.rand.NextBool() ? c1 : c2; } - Particle pulse = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.2f, Color.Turquoise * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.2f, c1 * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse); - Particle pulse2 = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.175f * finalHitMult, Color.Orchid * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse2 = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.175f * finalHitMult, c2 * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse2); Owner.Calamity().GeneralScreenShakePower = 3; @@ -357,7 +359,7 @@ namespace CalamityMod.Projectiles.Rogue dust2.scale = Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance); dust2.velocity = (launchDir * 5 * charge).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)) * finalHitMult; dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? Color.Turquoise : Color.Orchid; + dust2.color = Main.rand.NextBool() ? c1 : c2; } if (hasReachedFullCharge) @@ -365,9 +367,9 @@ namespace CalamityMod.Projectiles.Rogue SoundStyle soundExtra = new("CalamityMod/Sounds/Item/DoomsdayDeviceImpact"); SoundEngine.PlaySound(soundExtra with { Volume = 1f, Pitch = 0.35f + extraPitch, MaxInstances = 6 }, Projectile.Center); - Particle pulse = new CustomSpark(Projectile.Center, -launchDir * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.4f * finalHitMult, Color.Turquoise * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse = new CustomSpark(Projectile.Center, -launchDir * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.4f * finalHitMult, c1 * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse); - Particle pulse2 = new CustomSpark(Projectile.Center, -launchDir * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.35f * finalHitMult, Color.Orchid * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse2 = new CustomSpark(Projectile.Center, -launchDir * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.35f * finalHitMult, c2 * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse2); } SoundStyle sound = new("CalamityMod/Sounds/Item/DoomsdayDeviceImpact"); diff --git a/Projectiles/Rogue/DuststormCloud.cs b/Projectiles/Rogue/DuststormCloud.cs index 9c4201d233..6a920352e8 100644 --- a/Projectiles/Rogue/DuststormCloud.cs +++ b/Projectiles/Rogue/DuststormCloud.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - [PierceResistException(onlyForSingleHitbox: true)] public class DuststormCloud : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; diff --git a/Projectiles/Rogue/DuststormCloudHitbox.cs b/Projectiles/Rogue/DuststormCloudHitbox.cs index 9629e274f1..2284071282 100644 --- a/Projectiles/Rogue/DuststormCloudHitbox.cs +++ b/Projectiles/Rogue/DuststormCloudHitbox.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -9,6 +10,7 @@ using Terraria.Utilities; namespace CalamityMod.Projectiles.Rogue { + [PierceResistExceptionAttribute(true)] public class DuststormCloudHitbox : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; @@ -25,15 +27,15 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = DuststormInABottle.CloudLifetime; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.idStaticNPCHitCooldown = 12; } public override void AI() { if (Projectile.scale < (Projectile.ai[1] == 1 ? DuststormInABottle.MaxSizeStealth : DuststormInABottle.MaxSize)) { - Projectile.scale += (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowhRate : DuststormInABottle.GrowthRate); - Projectile.ExpandHitboxBy(1 + (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowhRate : DuststormInABottle.GrowthRate)); + Projectile.scale += Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowthRate : DuststormInABottle.GrowthRate; + Projectile.ExpandHitboxBy(1 + (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowthRate : DuststormInABottle.GrowthRate)); } } diff --git a/Projectiles/Rogue/DuststormInABottleProj.cs b/Projectiles/Rogue/DuststormInABottleProj.cs index 7a012612b4..61d51c1462 100644 --- a/Projectiles/Rogue/DuststormInABottleProj.cs +++ b/Projectiles/Rogue/DuststormInABottleProj.cs @@ -68,11 +68,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, stealth ? velocity * 1.2f : velocity, ModContent.ProjectileType(), 0, 0, Projectile.owner, stealth ? 1f : 0f, (float)Main.rand.Next(-45, 1)); } int hitbox = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner); - if (hitbox.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().stealthStrike) //Inherit stealth flag and less iframes - { + if (hitbox.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().stealthStrike) //Inherit stealth flag Main.projectile[hitbox].ai[1] = 1; - Main.projectile[hitbox].idStaticNPCHitCooldown = DuststormInABottle.StealthIframes; - } } } } diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index 1dea82d896..b300493f40 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -163,11 +163,12 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.velocity.Length() < storedStealthVel.Length()) Projectile.velocity += Utils.DirectionTo(Projectile.Center, Owner.Center) * 0.1f; Projectile.velocity *= 0.99f; - if (time == 180) // Reset iframes when it starts to come back + // CIT 26JUN2025: Removing its ability to deal damage again because it's overpowered + /*if (time == 180) { for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; - } + }*/ if (Projectile.timeLeft <= 240) { impaleDist = Vector2.One; // This is so the projectile stops dealing damage diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index 378c484662..382f3e0603 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -43,16 +43,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.StickyProjAI(4); if (Projectile.ai[0] == 1f) { - if (Projectile.timeLeft % 10 == 0) + if (Projectile.timeLeft % 40 == 0) { - if (Main.rand.NextBool(8)) + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.3f), ProjectileID.SpectreWrath, 1000f, 4f); + if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.4f), ProjectileID.SpectreWrath, 1000f, 4f); - if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) - { - ghost.DamageType = RogueDamageClass.Instance; - ghost.penetrate = 1; - } + ghost.DamageType = RogueDamageClass.Instance; + ghost.penetrate = 1; } } } @@ -64,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(12); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(9); public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index 9be29c003d..35b90af917 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -45,16 +45,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.StickyProjAI(4); if (Projectile.ai[0] == 1f) { - if (Projectile.timeLeft % 4 == 0) + if (Projectile.timeLeft % 20 == 0) { - if (Main.rand.NextBool(3)) + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.3f), ProjectileID.SpectreWrath, 1000f, 4f); + if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.2f), ProjectileID.SpectreWrath, 1000f, 4f); - if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) - { - ghost.DamageType = RogueDamageClass.Instance; - ghost.penetrate = 1; - } + ghost.DamageType = RogueDamageClass.Instance; + ghost.penetrate = 1; } } } @@ -66,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(9); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(6); public override void OnKill(int timeLeft) { @@ -74,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int j = 0; j <= 3; j++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index a405ddaa85..2f812635cf 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -44,17 +44,18 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Projectile.Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 751)); + Vector2 vel = Utils.DirectionTo(pos, Projectile.Center) * 30f; + vel.X += Main.rand.NextFloat(-4f, 4f); + int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); Main.projectile[shard].alpha = Projectile.alpha; } int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.DungeonWater); Main.dust[index2].noGravity = true; + + if (Projectile.ai[2] == 1f) + CalamityUtils.HomeInOnSelectedNPC(Projectile, CalamityUtils.ClosestNPCAt(Projectile.Center, 400f, false), false, 5f, 30f, 0.99f); } else { @@ -68,12 +69,10 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Main.npc[id].Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 751)); + Vector2 vel = Utils.DirectionTo(pos, Projectile.Center) * 30f; + vel.X += Main.rand.NextFloat(-4f, 4f); + int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); Main.projectile[shard].alpha = Projectile.alpha; } } @@ -121,7 +120,6 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); } public override bool? CanDamage() => Projectile.ai[0] == 0f ? null : false; diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index 33bc7eb8a3..09d88e9a77 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -44,23 +44,12 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Projectile.Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); + Vector2 vel = Utils.DirectionTo(pos, Projectile.Center) * 30f; + vel.X += Main.rand.NextFloat(-4f, 4f); + int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.6f), Projectile.knockBack, Projectile.owner, ai2: 1f); Main.projectile[flare].alpha = 150; } - if (Projectile.timeLeft % 10 == 0) - { - int snowflake = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0f, Projectile.velocity.Y * 0f, ProjectileID.NorthPoleSnowflake, (int)(Projectile.damage * 0.25), Projectile.knockBack, Projectile.owner, 0f, Main.rand.Next(3)); - if (snowflake.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[snowflake].DamageType = RogueDamageClass.Instance; - Main.projectile[snowflake].timeLeft = 300; - } - } int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.DungeonWater); Main.dust[index2].noGravity = true; @@ -77,12 +66,10 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Main.npc[id].Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 751)); + Vector2 vel = CalamityUtils.CalculatePredictiveAimToTarget(pos, Main.npc[id], 30f); + vel.X += Main.rand.NextFloat(-4f, 4f); + int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.6f), Projectile.knockBack, Projectile.owner, ai2: 1f); Main.projectile[flare].alpha = 150; } } @@ -130,7 +117,6 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); } public override bool? CanDamage() => Projectile.ai[0] == 0f ? null : false; diff --git a/Projectiles/Rogue/HeavenfallenEnergy.cs b/Projectiles/Rogue/HeavenfallenEnergy.cs index 74056c7f34..a9668c1d72 100644 --- a/Projectiles/Rogue/HeavenfallenEnergy.cs +++ b/Projectiles/Rogue/HeavenfallenEnergy.cs @@ -20,41 +20,31 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 8; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; + Projectile.tileCollide = false; + Projectile.timeLeft = 240; Projectile.DamageType = RogueDamageClass.Instance; } public override void AI() { - int constant = 14; int coolDust; Projectile.ai[0]++; if (Projectile.ai[0] % 2 == 0) { - if (Projectile.ai[0] % 4 == 0) - { - coolDust = Dust.NewDust(Projectile.position, Projectile.width - constant * 2, Projectile.height - constant * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); - } - else - { - coolDust = Dust.NewDust(Projectile.position, Projectile.width - constant * 2, Projectile.height - constant * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); - } + int dustType = Projectile.ai[0] % 4 == 0 ? ModContent.DustType() : ModContent.DustType(); + coolDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Alpha: 100, Scale: 1.5f); Main.dust[coolDust].noGravity = true; Main.dust[coolDust].velocity *= 0.1f; Main.dust[coolDust].velocity += Projectile.velocity * 0.5f; } float homingRange = raining ? 480f : 240f; - if (Projectile.ai[0] >= 15f || raining) CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, homingRange, 12f, 20f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override bool? CanDamage() => Projectile.ai[0] >= 15f || raining; } } diff --git a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs index aa6704c88a..caa3ce9873 100644 --- a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs +++ b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Projectile.Calamity().stealthStrike && Projectile.timeLeft % 20f == 4f) // every 5 frames - CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), Projectile.damage / 6, Projectile.knockBack * 0.5f, Projectile.owner); + if (Projectile.Calamity().stealthStrike && Projectile.timeLeft % 20f == 4f) + CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); if (Projectile.alpha > 0) { @@ -136,7 +136,6 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 240); public override void OnKill(int timeLeft) diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index bdedfa919b..e1ee953a4b 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -82,7 +82,6 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 150); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index 3ab30014a9..e079d036ad 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -90,19 +90,6 @@ namespace CalamityMod.Projectiles.Rogue int ice = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5), Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f, 1f); if (ice.WithinBounds(Main.maxProjectiles)) Main.projectile[ice].DamageType = RogueDamageClass.Instance; - - int buffType = ModContent.BuffType(); - float radius = 112f; // 7 blocks - - foreach (Player player in Main.ActivePlayers) - { - Player owner = Main.player[Projectile.owner]; - if ((owner.team != player.team || player.team == 0) && player.hostile && owner.hostile && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(Projectile.Center, player.Center) <= radius) - { - if (player.FindBuffIndex(buffType) == -1) - player.AddBuff(buffType, 60, false); - } - } } } } diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index ecc722a3bd..155ee6ef67 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -12,8 +12,7 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/InfernalKris"; - - public static int spinTime = 280; + private bool hasSpawnedCinders = false; public override void SetStaticDefaults() { @@ -35,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Projectile.timeLeft < spinTime) + if (Projectile.timeLeft < 280) { Projectile.rotation += 0.4f * Projectile.direction; @@ -56,59 +55,37 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - if (Projectile.timeLeft < spinTime) - { - modifiers.SourceDamage *= 1.75f; - } - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { int debuffTime = 60 * (Projectile.Calamity().stealthStrike ? Main.rand.Next(4, 8) : Main.rand.Next(3, 6)); target.AddBuff(BuffID.OnFire, debuffTime); if (Projectile.Calamity().stealthStrike) - { - int sparkCount = Main.rand.Next(3, 7); - for (int i = 0; i < sparkCount; i++) - { - int sparkScatter = 1; - Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter - 2, sparkScatter + 2)); - - sparkVelocity.Normalize(); - sparkVelocity *= 3; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - SoundEngine.PlaySound(SoundID.Item74, Projectile.position); - } + StealthEffect(); } - public override void OnHitPlayer(Player target, Player.HurtInfo info) { int debuffTime = 60 * (Projectile.Calamity().stealthStrike ? Main.rand.Next(4, 8) : Main.rand.Next(3, 6)); target.AddBuff(BuffID.OnFire, debuffTime); if (Projectile.Calamity().stealthStrike) - { - int sparkCount = Main.rand.Next(3, 7); - for (int i = 0; i < sparkCount; i++) - { - int sparkScatter = 1; - Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter - 2, sparkScatter + 2)); - - sparkVelocity.Normalize(); - sparkVelocity *= 3; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - SoundEngine.PlaySound(SoundID.Item74, Projectile.position); - } + StealthEffect(); } + private void StealthEffect() + { + hasSpawnedCinders = true; + int sparkCount = Main.rand.Next(4, 5 + 1); + for (int i = 0; i < sparkCount; i++) + { + Vector2 sparkVelocity = Main.rand.NextVector2Circular(1f, 3f); + sparkVelocity = sparkVelocity.SafeNormalize(Vector2.UnitY) * 3f; + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); + SoundEngine.PlaySound(SoundID.Item74, Projectile.position); + } + public override bool PreDraw(ref Color lightColor) { @@ -167,13 +144,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnKill(int timeLeft) { - if (Projectile.Calamity().stealthStrike) + if (Projectile.Calamity().stealthStrike && !hasSpawnedCinders) { - int sparkCount = Main.rand.Next(3, 7); + int sparkCount = Main.rand.Next(4, 5+1); for (int i = 0; i < sparkCount; i++) { - int sparkScatter = 1; - Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter, sparkScatter)); + Vector2 sparkVelocity = Main.rand.NextVector2Circular(1f, 3f); + sparkVelocity = sparkVelocity.SafeNormalize(Vector2.UnitY) * 3f; if (Projectile.ai[0] != 0) { @@ -184,14 +161,9 @@ namespace CalamityMod.Projectiles.Rogue sparkVelocity.Y *= -1; } - sparkVelocity.X += Projectile.ai[0]; - sparkVelocity.Y += Projectile.ai[1]; - sparkVelocity.Normalize(); - sparkVelocity *= 3; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); SoundEngine.PlaySound(SoundID.Item74, Projectile.position); } } diff --git a/Projectiles/Rogue/InfestedClawmerangProj.cs b/Projectiles/Rogue/InfestedClawmerangProj.cs index d7f2386bdb..e420a236a8 100644 --- a/Projectiles/Rogue/InfestedClawmerangProj.cs +++ b/Projectiles/Rogue/InfestedClawmerangProj.cs @@ -37,12 +37,8 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft % 15 == 0 && Projectile.owner == Main.myPlayer) { - Vector2 vector62 = Main.player[Projectile.owner].Center - Projectile.Center; - Vector2 vector63 = vector62 * -1f; - vector63.Normalize(); - vector63 *= (float)Main.rand.Next(45, 65) * 0.1f; - vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack * 0.2f, Projectile.owner, -10f, 0f); + Vector2 sporeVel = Utils.DirectionFrom(Projectile.Center, Main.player[Projectile.owner].Center).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(4.5f, 6.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sporeVel, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), 1f, Projectile.owner, -10f, 1f); } } } diff --git a/Projectiles/Rogue/InkBombProjectile.cs b/Projectiles/Rogue/InkBombProjectile.cs index 7f9f6b90cc..4163e97a2c 100644 --- a/Projectiles/Rogue/InkBombProjectile.cs +++ b/Projectiles/Rogue/InkBombProjectile.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public class InkBombProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; + public static readonly SoundStyle Explode = new("CalamityMod/Sounds/Custom/PlantyMushMine", 3); public override void SetDefaults() { Projectile.width = 14; @@ -49,10 +50,10 @@ namespace CalamityMod.Projectiles.Rogue private void CreateInk() { Player player = Main.player[Projectile.owner]; - SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - for (int i = 0; i < 20; i++) + SoundEngine.PlaySound(SoundID.NPCHit25, Projectile.Center); + for (int i = 0; i < 4; i++) { - int damage = (int)player.GetTotalDamage().ApplyTo(22); + int damage = (int)player.GetTotalDamage().ApplyTo(32); int inkID = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, 7, Projectile.owner, Main.rand.Next(3) + 1); Main.projectile[inkID].timeLeft += Main.rand.Next(-15, 15 + 1); diff --git a/Projectiles/Rogue/InkCloud.cs b/Projectiles/Rogue/InkCloud.cs index b45ad2b89a..7313d4b6e1 100644 --- a/Projectiles/Rogue/InkCloud.cs +++ b/Projectiles/Rogue/InkCloud.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = true; Projectile.ignoreWater = true; Projectile.timeLeft = 100; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 15; Projectile.DamageType = RogueDamageClass.Instance; } @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue { if (!target.friendly) { - target.AddBuff(BuffID.Confused, 300); + target.AddBuff(BuffID.Confused, 60); } } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Confused, 300); diff --git a/Projectiles/Rogue/LeonidCometSmall.cs b/Projectiles/Rogue/LeonidCometSmall.cs index 9bcf7cc54e..6835ca8f01 100644 --- a/Projectiles/Rogue/LeonidCometSmall.cs +++ b/Projectiles/Rogue/LeonidCometSmall.cs @@ -28,19 +28,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.alpha = 255; } - public override bool PreDraw(ref Color lightColor) - { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override void PostDraw(Color lightColor) - { - Texture2D tex = ModContent.Request("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow").Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); - } - public override void AI() { Projectile.alpha -= 25; @@ -55,15 +42,10 @@ namespace CalamityMod.Projectiles.Rogue }); if (Main.rand.NextBool()) { - int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); + int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.3f); Main.dust[index].noGravity = true; } - if (Main.rand.NextBool()) - { - int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); - Main.dust[index].noGravity = true; - } - int index1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.2f); + int index1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f)); Main.dust[index1].noGravity = true; Main.dust[index1].velocity *= 2f; Main.dust[index1].velocity += Projectile.velocity; @@ -84,11 +66,14 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation += Projectile.velocity.X * 0.1f; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnKill(int timeLeft) { if (Projectile.owner != Main.myPlayer) return; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 0f, Projectile.owner); Projectile.ai[1] = -1f; Projectile.position = Projectile.Center; Projectile.width = Projectile.height = 40; @@ -124,8 +109,16 @@ 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) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); + return false; + } + public override void PostDraw(Color lightColor) + { + Texture2D tex = ModContent.Request("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow").Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); + } } } diff --git a/Projectiles/Rogue/LeonidProgenitorBombshell.cs b/Projectiles/Rogue/LeonidProgenitorBombshell.cs index 507789ee06..606bf24ff4 100644 --- a/Projectiles/Rogue/LeonidProgenitorBombshell.cs +++ b/Projectiles/Rogue/LeonidProgenitorBombshell.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.netUpdate = true; } } - Projectile.velocity.Y += 0.2f; + Projectile.velocity.Y += 0.2f / (float)Projectile.MaxUpdates; } Projectile.rotation += Projectile.velocity.X * 0.1f; } @@ -76,45 +76,35 @@ namespace CalamityMod.Projectiles.Rogue { int flash = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, 1f); if (flash.WithinBounds(Main.maxProjectiles)) - { Main.projectile[flash].DamageType = RogueDamageClass.Instance; - } - - Vector2 pos = new Vector2(Projectile.Center.X + Projectile.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (Projectile.Center - pos) / 40f; - int dmg = Projectile.damage / 2; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, velocity, ModContent.ProjectileType(), dmg, Projectile.knockBack, Projectile.owner, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 240); - StealthStrikeEffect(); + SpawnExtraProjectiles(target); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 240); - StealthStrikeEffect(); + SpawnExtraProjectiles(target); } - private void StealthStrikeEffect() + private void SpawnExtraProjectiles(Entity target) { - if (!Projectile.Calamity().stealthStrike || Main.myPlayer != Projectile.owner) - return; - - Vector2 spinningpoint = new Vector2(0f, 6f); - float radian45 = MathHelper.ToRadians(45f); - int cometAmt = 5; - float cometSpread = -(radian45 * 2f) / (cometAmt - 1f); - for (int projIndex = 0; projIndex < cometAmt; ++projIndex) + Vector2 pos = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 meteorVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 20f, 3); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, meteorVel, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f, 0.5f + Main.rand.NextFloat() * 0.3f); + + if (Projectile.Calamity().stealthStrike) { - int index2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, spinningpoint.RotatedBy((double)radian45 + (double)cometSpread * (double)projIndex, new Vector2()), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, -1f); - Projectile proj = Main.projectile[index2]; - for (int index3 = 0; index3 < Projectile.localNPCImmunity.Length; ++index3) + for (int i = 0; i < 5; i++) { - proj.localNPCImmunity[index3] = Projectile.localNPCImmunity[index3]; + Vector2 cometPos = new Vector2(target.Center.X + Main.rand.Next(-100, 101), target.Center.Y - 150f - Main.rand.Next(30)); + Vector2 cometVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 18f, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), cometPos, cometVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, -1f); } } } diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index 2851230620..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) - { - Projectile tooth = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnPos, jawVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack / 12, Projectile.owner, 0, 0, Projectile.velocity.X > 0 ? 1 : -1); - tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 120; - tooth.extraUpdates = 0; - tooth.usesIDStaticNPCImmunity = true; - tooth.usesLocalNPCImmunity = false; - tooth.idStaticNPCHitCooldown = 5; - tooth.ai[1] = Main.rand.Next(1, 3 + 1); - 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 *= Projectile.ai[1] == 4 ? 0.6f : 0.5f; - else - 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 a3f9355246..3ed53a60cd 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue // Reduce damage of projectiles if more than the cap are active public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (!Projectile.CountsAsClass()) + if (Projectile.DamageType == DamageClass.Generic) { int cap = 10; float capDamageFactor = 0.05f; diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index 81f4212305..4bed2c6456 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue Lighting.AddLight(Projectile.Center, 0f, 0.25f, 0f); if (Main.rand.NextBool(5)) - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.JungleSpore, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ChlorophyteWeapon, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); if (Projectile.Calamity().stealthStrike) { @@ -39,8 +39,8 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft < 240) Projectile.Kill(); - Projectile.localAI[0] += Main.rand.Next(0, 3); - if (Projectile.localAI[0] >= 10f) + Projectile.localAI[0] += Main.rand.Next(1, 3); + if (Projectile.localAI[0] >= 20f) { Projectile.localAI[0] = 0f; Vector2 flowerSpawnPosition = Projectile.Center + Main.rand.NextVector2Square(-10f, 10f); @@ -58,7 +58,6 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Venom, 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 120); } } 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/PlaguedFuelPackCloud.cs b/Projectiles/Rogue/PlaguedFuelPackCloud.cs index 24e2dfa9d1..5c968220db 100644 --- a/Projectiles/Rogue/PlaguedFuelPackCloud.cs +++ b/Projectiles/Rogue/PlaguedFuelPackCloud.cs @@ -6,32 +6,42 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - [PierceResistException] public class PlaguedFuelPackCloud : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; + public int dir = 0; + public float intensity = 0; + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } public override void SetDefaults() { Projectile.width = 28; Projectile.height = 24; Projectile.friendly = true; Projectile.alpha = 0; - Projectile.penetrate = -1; - Projectile.tileCollide = true; + Projectile.penetrate = 1; + Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 120; + Projectile.timeLeft = 390; + Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = -1; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.ArmorPenetration = 5; + Projectile.ArmorPenetration = 10; } public override void AI() { if (Projectile.timeLeft < 50) Projectile.alpha += 5; - if (Projectile.timeLeft < 75) - Projectile.velocity *= 0.95f; + if (dir == 0) + { + Projectile.timeLeft -= Main.rand.Next(5, 20 + 1); + dir = Main.rand.NextBool() ? -1 : 1; + intensity = Main.rand.NextFloat(0.2f, 1.2f); + } if (Main.rand.NextBool(150)) { @@ -40,6 +50,11 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; } + + if (Projectile.timeLeft < 290) + CalamityUtils.HomeInOnSelectedNPC(Projectile, Projectile.Center.ClosestNPCAt(1000), true, 0.65f * intensity, 6, 0.98f, 0.995f, true); + else + Projectile.velocity = Projectile.velocity.RotatedBy(0.006f * dir * intensity) * Main.rand.NextFloat(0.985f, 1f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index 2942d3ed40..a935577557 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -55,20 +55,8 @@ namespace CalamityMod.Projectiles.Rogue // Heal the player and disappear when touching them. if (Projectile.Hitbox.Intersects(Owner.Hitbox)) { - if (!Owner.moonLeech && AbleToHealOwner) - { - int heal = Projectile.Calamity().stealthStrike ? 40 : 3; - - if (Main.LocalPlayer.lifeSteal <= 0f) - { - Projectile.Kill(); - return; - } - - Main.LocalPlayer.lifeSteal -= heal; - Owner.HealPlayer(heal); - } - + if (AbleToHealOwner) + Owner.DoLifestealDirect(null, Projectile.Calamity().stealthStrike ? 40 : 3, 0.4f); Projectile.Kill(); } } diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index 1433f615a4..6d50d7f4ce 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -54,7 +54,6 @@ namespace CalamityMod.Projectiles.Rogue { width = 20; height = 20; - return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); } @@ -219,8 +218,6 @@ namespace CalamityMod.Projectiles.Rogue } else { - //Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); } return false; diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index fa631e61cb..7193fa5ca1 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -131,14 +131,7 @@ namespace CalamityMod.Projectiles.Rogue SpawnOnStealthStrikeBullets(); // Give on-heal effects from stealth strikes. - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.005), 0.5f); } public override void OnHitPlayer(Player target, Player.HurtInfo info) @@ -150,16 +143,6 @@ namespace CalamityMod.Projectiles.Rogue // Spawn a bloom of bullets. SpawnOnStealthStrikeBullets(); - - // Give on-heal effects from stealth strikes. - int heal = (int)Math.Round(info.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); } internal float WidthFunction(float completionRatio) diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index 8ce4a2584a..60c026f0be 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -71,14 +71,8 @@ namespace CalamityMod.Projectiles.Rogue SoundEngine.PlaySound(WulfrumKnife.TileHitSound, Projectile.Center); } - if (target.life <= 0 && target.lifeMax > 5) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], 10, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, 0f); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (target.statLife <= 0) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], 10, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, 0f); + if (target.life <= 0) + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 10, 0f); } public override void OnKill(int timeLeft) 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/TalonSmallProj.cs b/Projectiles/Rogue/TalonSmallProj.cs index 017bdfe455..1694f4b37d 100644 --- a/Projectiles/Rogue/TalonSmallProj.cs +++ b/Projectiles/Rogue/TalonSmallProj.cs @@ -43,19 +43,18 @@ namespace CalamityMod.Projectiles.Rogue // spawn dust if (Main.rand.NextBool(5)) { - int dustType = Main.rand.NextBool() ? DustID.Chlorophyte : DustID.UnusedBrown; + int dustType = Main.rand.NextBool() ? DustID.Chlorophyte : DustID.Ash; Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, Scale: 0.9f); } - // freely spins instead of facing forwards - Projectile.rotation += 0.26f; + Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.ai[0]++; } private void ApplySineVelocity(Vector2 baseVelocity) { - float radians = Projectile.ai[1] * (float)Math.Sin(-MathHelper.PiOver2 + 0.25f * Projectile.ai[0]); + float radians = Projectile.ai[1] * (float)Math.Sin(-MathHelper.PiOver2 + 0.25f * Projectile.ai[0]) * 0.5f; Projectile.velocity = baseVelocity.RotatedBy(radians); } @@ -71,7 +70,9 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Color draw = Color.Lerp(lightColor, Color.White, 0.5f); + SpriteEffects sp = Projectile.ai[1] == -1 ? SpriteEffects.FlipVertically : SpriteEffects.None; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(draw), Projectile.rotation, tex.Size() / 2f, Projectile.scale, sp, 0); return false; } } diff --git a/Projectiles/Rogue/TotalMeltdown.cs b/Projectiles/Rogue/TotalMeltdown.cs index 48e2eb7e92..f439d9122b 100644 --- a/Projectiles/Rogue/TotalMeltdown.cs +++ b/Projectiles/Rogue/TotalMeltdown.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = -1; Projectile.timeLeft = Main.projFrames[Type] * 5; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 30; + Projectile.localNPCHitCooldown = -1; } public override void AI() diff --git a/Projectiles/Rogue/TotalityFlask.cs b/Projectiles/Rogue/TotalityFlask.cs index 545f479c5b..e4ca68525c 100644 --- a/Projectiles/Rogue/TotalityFlask.cs +++ b/Projectiles/Rogue/TotalityFlask.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Rogue Dust dust2 = Main.dust[index3]; dust2.velocity *= 3f; } - int tarAmt = Main.rand.Next(2, 4); + int tarAmt = Projectile.Calamity().stealthStrike ? 5 : Main.rand.Next(2, 3+1); for (int t = 0; t < tarAmt; t++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); diff --git a/Projectiles/Rogue/TotalityTar.cs b/Projectiles/Rogue/TotalityTar.cs index 98d51d5ec5..c9b92c8d76 100644 --- a/Projectiles/Rogue/TotalityTar.cs +++ b/Projectiles/Rogue/TotalityTar.cs @@ -79,23 +79,16 @@ namespace CalamityMod.Projectiles.Rogue { SoundEngine.PlaySound(SoundID.Item74, Projectile.position); Vector2 vector2 = new Vector2(20f, 20f); - for (int index = 0; index < 3; ++index) + for (int i = 0; i < 3; ++i) Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.SpookyWood, 0.0f, 0.0f, 0, Color.Red, 1f); - for (int index1 = 0; index1 < 5; ++index1) + for (int j = 0; j < 5; ++j) { - int index2 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Smoke, 0.0f, 0.0f, 100, new Color(), 1.5f); - Dust dust = Main.dust[index2]; - dust.velocity *= 1.4f; - } - for (int index1 = 0; index1 < 10; ++index1) - { - int index2 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Torch, 0.0f, 0.0f, 100, new Color(), 2.5f); - Dust dust1 = Main.dust[index2]; - dust1.noGravity = true; - dust1.velocity *= 5f; - int index3 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Torch, 0.0f, 0.0f, 100, new Color(), 1.5f); - Dust dust2 = Main.dust[index3]; - dust2.velocity *= 3f; + Dust smoke = Dust.NewDustDirect(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Smoke, 0.0f, 0.0f, 100, new Color(), 1.5f); + smoke.velocity *= 1.4f; + + Dust fire = Dust.NewDustDirect(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Torch, 0.0f, 0.0f, 100, new Color(), 2.5f); + fire.noGravity = true; + fire.velocity *= 5f; } int fireAmt = Main.rand.Next(2, 4); if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 9db3525406..f285f7f0ae 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -145,7 +145,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.Y -= acceleration; } - // Delete the projectile if it touches its owner. if (Main.myPlayer == Projectile.owner) if (Projectile.Hitbox.Intersects(owner.Hitbox)) @@ -198,8 +197,6 @@ namespace CalamityMod.Projectiles.Rogue { OnHitEffects(target); target.AddBuff(BuffID.Frostburn2, 120); - if (Projectile.Calamity().stealthStrike) - target.AddBuff(ModContent.BuffType(), 45); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Rogue/WhitewaterProj.cs b/Projectiles/Rogue/WhitewaterProj.cs index cd84b2652d..35c966e664 100644 --- a/Projectiles/Rogue/WhitewaterProj.cs +++ b/Projectiles/Rogue/WhitewaterProj.cs @@ -164,7 +164,6 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.Hitbox.Intersects(Owner.Hitbox)) { - Projectile.Kill(); if (Projectile.Calamity().stealthStrike) { foreach (Projectile p in Main.ActiveProjectiles) @@ -175,8 +174,9 @@ namespace CalamityMod.Projectiles.Rogue p.timeLeft = 30; } } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), Projectile.knockBack, Projectile.owner, 0f, 0f); } + Projectile.Kill(); } } } diff --git a/Projectiles/Rogue/WhitewaterSpear.cs b/Projectiles/Rogue/WhitewaterSpear.cs index c16a59f091..c0967afa4f 100644 --- a/Projectiles/Rogue/WhitewaterSpear.cs +++ b/Projectiles/Rogue/WhitewaterSpear.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.extraUpdates = 5; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; + Projectile.localNPCHitCooldown = 20 * Projectile.MaxUpdates; } public override void AI() 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/AmphibiansGuitarHoldout.cs b/Projectiles/Summon/AmphibiansGuitarHoldout.cs index 966171311f..0b2a688865 100644 --- a/Projectiles/Summon/AmphibiansGuitarHoldout.cs +++ b/Projectiles/Summon/AmphibiansGuitarHoldout.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -23,6 +24,7 @@ namespace CalamityMod.Projectiles.Summon private static readonly int MinionType = ModContent.ProjectileType(); + public override void SetStaticDefaults() => ProjectileID.Sets.MinionTargettingFeature[Type] = true; public override void SetDefaults() { Projectile.width = Projectile.height = 50; diff --git a/Projectiles/Summon/AmphibiansGuitarMinion.cs b/Projectiles/Summon/AmphibiansGuitarMinion.cs index ddfab3cd17..5f026779bb 100644 --- a/Projectiles/Summon/AmphibiansGuitarMinion.cs +++ b/Projectiles/Summon/AmphibiansGuitarMinion.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Summon SoundStyle spawnSound = new("CalamityMod/Sounds/Item/AmphibiansGuitarSummon"); SoundEngine.PlaySound(spawnSound with { Volume = 0.8f, Pitch = (GuitarSprite == 2 || GuitarSprite == 5) ? -0.15f : 0f }, Projectile.Center); - ShootTimer = GuitarSprite * 10f; + ShootTimer = GuitarSprite * 12f; _hasSpawned = true; } @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon if (Target != null) { bool bigShot = ShootCount % 3 == 0; - if (ShootTimer > 80f && Main.myPlayer == Projectile.owner) + if (ShootTimer > 96f && Main.myPlayer == Projectile.owner) { for (int i = 0; i < (bigShot ? 3 : 1); i++) { @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.NewProjectile( Projectile.GetSource_FromThis(), Projectile.Center, - CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, 18f * (1f - Math.Abs(rot))).RotatedBy(rot), + CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, (bigShot ? 36f : 25f) * (1f - Math.Abs(rot))).RotatedBy(rot), ProjectileType(), Projectile.damage, Projectile.knockBack, @@ -140,8 +140,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/AmphibiansGuitarProjectile.cs b/Projectiles/Summon/AmphibiansGuitarProjectile.cs index 5782e66785..535762ab1d 100644 --- a/Projectiles/Summon/AmphibiansGuitarProjectile.cs +++ b/Projectiles/Summon/AmphibiansGuitarProjectile.cs @@ -33,21 +33,20 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = 54; Projectile.height = 44; Projectile.timeLeft = 150; - Projectile.localNPCHitCooldown = 20; Projectile.friendly = true; Projectile.tileCollide = false; + Projectile.penetrate = 1; Projectile.usesLocalNPCImmunity = true; - Projectile.penetrate = -1; - Projectile.extraUpdates = 0; + Projectile.localNPCHitCooldown = 20; } public override void AI() { if (time == 0) { - if (IsHatNote) - Projectile.penetrate = 1; if (Projectile.ai[2] == 5) - Projectile.extraUpdates = 1; + { + Projectile.penetrate = 3; + } } Projectile.scale = 1.6f * Utils.GetLerpValue(-5, 20, time, true); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index e0063dc6e0..3bef24a545 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 8; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -239,6 +240,8 @@ namespace CalamityMod.Projectiles.Summon } + public override bool MinionContactDamage() => HitCooldown == 0; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (Main.rand.NextBool(3)) @@ -253,14 +256,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; HitCooldown = 20; } - - public override bool? CanHitNPC(NPC target) - { - if (HitCooldown == 0) - { - return null; - } - return false; - } } } diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index f060849af8..3377e232ea 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -70,6 +71,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.ChargingMinionAI(1200f, 1500f, 2200f, 150f, 0, 24f, 15f, 4f, new Vector2(0f, -60f), 12f, 12f, false, false, 1); } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index 795b62514b..c5a3c69c48 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -209,6 +210,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index 64de6fe834..d9743cab03 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -40,6 +40,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -150,8 +151,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index c3b33c47d2..10fdd37bb7 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -9,12 +9,13 @@ namespace CalamityMod.Projectiles.Summon public class BabyBloodCrawler : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public static int bloodCooldown = 0; + public int bloodCooldown = 0; public float dust = 0f; public override void SetStaticDefaults() { Main.projFrames[Type] = 11; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 33 * Projectile.MaxUpdates; + Projectile.localNPCHitCooldown = 30 * Projectile.MaxUpdates; } public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) @@ -53,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; @@ -96,23 +84,20 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(target.Center); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(target.Center); - - private void OnHitEffects(Vector2 targetPos) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(target); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(target); + private void OnHitEffects(Entity target) { if (bloodCooldown == 0) { - bloodCooldown = 17; - int projAmt = 2; - var source = Projectile.GetSource_FromThis(); - for (int n = 0; n < projAmt; n++) - { - CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 400f, 700f, 29f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * Main.rand.NextFloat(0.7f, 1f), Projectile.owner); - } + bloodCooldown = 15; + Vector2 spawnPos = target.Center + Vector2.UnitX * Main.rand.NextFloat(-100f, 100f) - Vector2.UnitY * Main.rand.NextFloat(400f, 700f); + Vector2 velocity = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(spawnPos, target, 25f, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner); } } } diff --git a/Projectiles/Summon/BelladonnaSpirit.cs b/Projectiles/Summon/BelladonnaSpirit.cs index 5d99e1cd20..d4cd8ae282 100644 --- a/Projectiles/Summon/BelladonnaSpirit.cs +++ b/Projectiles/Summon/BelladonnaSpirit.cs @@ -106,8 +106,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/BlackDragonHead.cs b/Projectiles/Summon/BlackDragonHead.cs index 3bca4cd7c6..875ad6599a 100644 --- a/Projectiles/Summon/BlackDragonHead.cs +++ b/Projectiles/Summon/BlackDragonHead.cs @@ -216,6 +216,8 @@ namespace CalamityMod.Projectiles.Summon } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.ShadowFlame, 300); } } diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index a3b25021a1..93d42c501c 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -299,9 +300,6 @@ namespace CalamityMod.Projectiles.Summon } } - //Does no contact damage - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/BloodSpit.cs b/Projectiles/Summon/BloodSpit.cs index 89167493d4..d3784b56ab 100644 --- a/Projectiles/Summon/BloodSpit.cs +++ b/Projectiles/Summon/BloodSpit.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 6; Projectile.DamageType = DamageClass.Summon; - Projectile.Calamity().BloodstoneOrbValue = 20; //Bloodstone Orb lifesteal. May want to go back to regular lifesteal. + Projectile.Calamity().BloodstoneOrbValue = 12; //Bloodstone Orb lifesteal. May want to go back to regular lifesteal. } public override void AI() 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/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index d3399e3df5..5c72c4c722 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.extraUpdates = 3; Projectile.timeLeft = 50; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 9; + Projectile.idStaticNPCHitCooldown = 12; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs index 4e5fda6383..69c063bd29 100644 --- a/Projectiles/Summon/BrimstoneLaserSummon.cs +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -16,26 +16,24 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - Projectile.width = Projectile.height = 2; + Projectile.width = Projectile.height = 10; Projectile.aiStyle = ProjAIStyleID.Arrow; + AIType = ProjectileID.CursedBullet; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.alpha = 120; Projectile.timeLeft = 300; - AIType = ProjectileID.DeathLaser; + Projectile.extraUpdates = 2; Projectile.DamageType = DamageClass.Summon; } public override void AI() { Lighting.AddLight(Projectile.Center, Projectile.Opacity * 0.5f, Projectile.Opacity * 0.05f, Projectile.Opacity * 0.05f); - Projectile.velocity.X *= 1.05f; - Projectile.velocity.Y *= 1.05f; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override Color? GetAlpha(Color lightColor) => new Color(250, 50, 50, Projectile.alpha); diff --git a/Projectiles/Summon/CalamarisLamentMinion.cs b/Projectiles/Summon/CalamarisLamentMinion.cs index dd9d517abe..057b2ccb67 100644 --- a/Projectiles/Summon/CalamarisLamentMinion.cs +++ b/Projectiles/Summon/CalamarisLamentMinion.cs @@ -54,13 +54,13 @@ namespace CalamityMod.Projectiles.Summon } else { - if (Main.rand.NextBool(600)) + if (Main.rand.NextBool(800)) { SoundStyle glubNoise = Main.rand.NextBool() ? SoundID.Zombie35 : SoundID.Zombie34; SoundStyle trollBirdChirpingSound = SoundID.Zombie16; - // 1/200th chance to do a bird chirping sound. - SoundEngine.PlaySound(Main.rand.NextBool(200) ? trollBirdChirpingSound : glubNoise, Projectile.Center); + // 1/2000th chance to do a bird chirping sound. + SoundEngine.PlaySound(Main.rand.NextBool(2000) ? trollBirdChirpingSound : glubNoise, Projectile.Center); } } diff --git a/Projectiles/Summon/CalamarisLamentProjectile.cs b/Projectiles/Summon/CalamarisLamentProjectile.cs index 56f317b73b..c4ad77518b 100644 --- a/Projectiles/Summon/CalamarisLamentProjectile.cs +++ b/Projectiles/Summon/CalamarisLamentProjectile.cs @@ -38,7 +38,10 @@ namespace CalamityMod.Projectiles.Summon Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; } - + public override bool? CanHitNPC(NPC target) + { + return target.CanBeChasedBy() ? null : false; + } public override void AI() { if (TargetShot is not null && TargetShot.active) diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index a7c0bfb1ec..f1c755a738 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -210,25 +210,23 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[1] > 0f) { - Projectile.ai[1] += (float)Main.rand.Next(1, 4); + Projectile.ai[1] += Main.rand.Next(2, 3+1); } - if (Projectile.ai[1] > 110f) + if (Projectile.ai[1] > 100f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; } if (Projectile.ai[0] == 0f) { - float projSpeed = 8f; + float projSpeed = 10f; int projType = ModContent.ProjectileType(); if (foundTarget && Projectile.ai[1] == 0f) { Projectile.ai[1] += 1f; if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.Center, Projectile.width, Projectile.height, targetVec, 0, 0)) { - Vector2 velocity = targetVec - Projectile.Center; - velocity.Normalize(); - velocity *= projSpeed; + Vector2 velocity = Utils.DirectionTo(Projectile.Center, targetVec) * projSpeed; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projType, Projectile.damage, Projectile.knockBack, Projectile.owner); Projectile.netUpdate = true; } @@ -245,7 +243,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index dabd888069..b67690cdcc 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -239,7 +239,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 1766bdf8be..956f049214 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.idStaticNPCHitCooldown = 8; Projectile.DamageType = DamageClass.Summon; } + public override bool MinionContactDamage() => Projectile.ai[0] == 2f; public override void AI() { 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/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index ca75b21aa9..501472f410 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -285,7 +286,5 @@ namespace CalamityMod.Projectiles.Summon } public override bool OnTileCollide(Vector2 oldVelocity) => false; - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/CelestialAxeMinion.cs b/Projectiles/Summon/CelestialAxeMinion.cs index 888c97d688..932f8ec4fb 100644 --- a/Projectiles/Summon/CelestialAxeMinion.cs +++ b/Projectiles/Summon/CelestialAxeMinion.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -75,6 +76,9 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } + + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 60); diff --git a/Projectiles/Summon/CinderBlossom.cs b/Projectiles/Summon/CinderBlossom.cs index d594e5ff50..d6125c9863 100644 --- a/Projectiles/Summon/CinderBlossom.cs +++ b/Projectiles/Summon/CinderBlossom.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -89,7 +90,5 @@ namespace CalamityMod.Projectiles.Summon DelayBetweenShooting++; } } - - public override bool? CanDamage() => false; } } 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/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs index 06d676e565..9fd7296ef8 100644 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ b/Projectiles/Summon/CorroslimeMinion.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -80,6 +81,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index bc06a90b67..14049b2ad4 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -221,7 +221,5 @@ namespace CalamityMod.Projectiles.Summon { return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 255); } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index 747eb5e5c6..d99e8910ec 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 3; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -307,8 +308,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index a3f6adb628..1d7269474d 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -148,8 +148,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0); return false; } - - // The lamps themselves do not do damage, but they do store damage for the sake of shooting projectiles. - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/CrimslimeMinion.cs index 2ce626218e..934db01829 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/CrimslimeMinion.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -80,6 +81,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index dfcfa3f201..5a47080b5d 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 18; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -297,7 +298,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 0; } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index 98dadc21e2..4aedb83069 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -208,6 +209,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 1cb53d08e3..4322dbb52a 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -303,7 +303,9 @@ namespace CalamityMod.Projectiles.Summon } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override bool? CanDamage() => attackCooldown == 0 ? null : false; + + public override bool? CanDamage() => (attackCooldown == 0 ? base.CanDamage() : false); + public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index 6ef2b94958..9cdbf33a3e 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.NeedsUUID[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; @@ -169,7 +170,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(pupilTexture, pupilDrawPosition, null, Projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, SpriteEffects.None); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs index f26f66f14a..183b6108fc 100644 --- a/Projectiles/Summon/DormantBrimseekerBab.cs +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -26,12 +26,10 @@ namespace CalamityMod.Projectiles.Summon } public override void SetStaticDefaults() { - Main.projFrames[Type] = 8; - + Main.projPet[Type] = true; ProjectileID.Sets.TrailCacheLength[Type] = 7; ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.MinionSacrificable[Type] = true; } @@ -153,6 +151,9 @@ namespace CalamityMod.Projectiles.Summon } Lighting.AddLight(Projectile.Center, Color.Red.ToVector3()); } + + public override bool MinionContactDamage() => true; + public override void PostDraw(Color lightColor) { if ((Projectile.ai[0] > 0f && Projectile.ai[0] <= MaxChargeTime && Projectile.velocity.Length() >= 8f) || SeekingTarget) 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/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index bab1116e24..487ec89ec1 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -351,12 +351,12 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); } + public override bool MinionContactDamage() => AttackMode == 2; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(ModContent.BuffType(), 180); } - - public override bool? CanDamage() => AttackMode == 2; } } diff --git a/Projectiles/Summon/EndoHydraHead.cs b/Projectiles/Summon/EndoHydraHead.cs index cb231e8ac5..968be80d0a 100644 --- a/Projectiles/Summon/EndoHydraHead.cs +++ b/Projectiles/Summon/EndoHydraHead.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 5; + Main.projPet[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 0; ProjectileID.Sets.TrailCacheLength[Type] = 20; ProjectileID.Sets.MinionSacrificable[Type] = true; @@ -241,6 +242,5 @@ namespace CalamityMod.Projectiles.Summon 0); return false; } - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs index ffeccfa56a..d5e9b86981 100644 --- a/Projectiles/Summon/EyeOfNightSummon.cs +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public const int ShootRate = 60; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -117,7 +118,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.velocity = (destination - Projectile.Center).SafeNormalize(Vector2.Zero) * flySpeed; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/FieryDraconid.cs b/Projectiles/Summon/FieryDraconid.cs index f93412f81f..995ee2a810 100644 --- a/Projectiles/Summon/FieryDraconid.cs +++ b/Projectiles/Summon/FieryDraconid.cs @@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Summon modifiers.FinalDamage *= YharonsKindleStaff.ReboundRamDamageFactor; } - public override bool? CanDamage() => Projectile.localAI[0] > 1f; + public override bool MinionContactDamage() => Projectile.localAI[0] > 1f; public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Summon/FlarebatMinion.cs b/Projectiles/Summon/FlarebatMinion.cs index 66e1a5b87b..5231d03c3b 100644 --- a/Projectiles/Summon/FlarebatMinion.cs +++ b/Projectiles/Summon/FlarebatMinion.cs @@ -76,6 +76,14 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[0]++; } + // Teleport to the owner if abnormally far away + if (!Projectile.WithinRange(Owner.Center, 2000f)) + { + Projectile.position = Owner.Center; + Projectile.velocity *= 0.3f; + Projectile.netUpdate = true; + } + CurrentBehavior.Invoke(); Projectile.rotation = Projectile.rotation.AngleTowards(MathHelper.ToRadians(Projectile.velocity.X * 3f), 0.2f); Projectile.spriteDirection = MathF.Sign(Projectile.velocity.X); @@ -118,14 +126,14 @@ namespace CalamityMod.Projectiles.Summon // The first stage is redirecting towards the target. if (!AttackState.HasFlag(AttackBehaviorFlags.HasDashed) && Vector2.Dot(Projectile.DirectionTo(Target.Center), Projectile.velocity.SafeNormalize(-Vector2.UnitY)) < 0.96f) { - Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(Target.Center).ToRotation(), 0.08f).ToRotationVector2() * - Utils.Remap(Projectile.DistanceSQ(Target.Center), 6400f, 0f, 12f, 0f); + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(Target.Center).ToRotation(), 0.095f).ToRotationVector2() * + Utils.Remap(Projectile.DistanceSQ(Target.Center), 6400f, 0f, 14f, 0f); } // When it's whithin a distnce and it hasn't dashed yet, it'll dash. else if (!AttackState.HasFlag(AttackBehaviorFlags.HasDashed) && Projectile.DistanceSQ(Target.Center) < 57600f) { - Projectile.velocity = Projectile.DirectionTo(Target.Center) * 15f; + Projectile.velocity = Projectile.DirectionTo(Target.Center) * 19f; AttackState |= AttackBehaviorFlags.HasDashed; Projectile.netUpdate = true; @@ -162,8 +170,8 @@ namespace CalamityMod.Projectiles.Summon // When it has arrived to it at a distance, reset the state and start over. if (AttackState.HasFlag(AttackBehaviorFlags.IsReturningToOwner)) { - Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(IdlePosition).ToRotation(), 0.08f).ToRotationVector2() * - Utils.Remap(Projectile.DistanceSQ(IdlePosition), 6400f, 0f, 12f, 0f); + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(IdlePosition).ToRotation(), 0.095f).ToRotationVector2() * + Utils.Remap(Projectile.DistanceSQ(IdlePosition), 6400f, 0f, 14f, 0f); if (Projectile.DistanceSQ(IdlePosition) < 6400f) { diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index 3125b8f324..4de9b04216 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -125,6 +125,8 @@ namespace CalamityMod.Projectiles.Summon #endregion + public override bool MinionContactDamage() => true; + public override void OnSpawn(IEntitySource source) => IFrames = 30; // Prevent immediate death on tile collision, and slow down on tile collision. diff --git a/Projectiles/Summon/FrostBlossom.cs b/Projectiles/Summon/FrostBlossom.cs index c430427aad..9174f55597 100644 --- a/Projectiles/Summon/FrostBlossom.cs +++ b/Projectiles/Summon/FrostBlossom.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -88,7 +89,5 @@ namespace CalamityMod.Projectiles.Summon } } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/GammaHead.cs b/Projectiles/Summon/GammaHead.cs index c769643882..a521a54858 100644 --- a/Projectiles/Summon/GammaHead.cs +++ b/Projectiles/Summon/GammaHead.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -264,7 +265,5 @@ namespace CalamityMod.Projectiles.Summon return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/GastricBelcher.cs b/Projectiles/Summon/GastricBelcher.cs index 12856293d4..c4523cdeee 100644 --- a/Projectiles/Summon/GastricBelcher.cs +++ b/Projectiles/Summon/GastricBelcher.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -162,7 +163,7 @@ namespace CalamityMod.Projectiles.Summon //If farther than 200 pixels, move toward it if (targetDist > 200f) { - float speedMult = (targetDist > 400f) ? 12f : (targetDist > 250) ? 6f : 3f; + float speedMult = (targetDist > 400f) ? 16f : (targetDist > 250) ? 9f : 5f; vecToTarget *= speedMult; Projectile.velocity = (Projectile.velocity * 40f + vecToTarget) / 41f; } @@ -242,7 +243,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[1] += Main.rand.Next(1, 4); } //Set the minion to be ready for attack - if (Projectile.ai[1] > 90f) + if (Projectile.ai[1] > 100f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; @@ -264,25 +265,23 @@ namespace CalamityMod.Projectiles.Summon //Increment the attack counter Projectile.ai[1]++; - int projType = ModContent.ProjectileType(); - //Calculate the general velocity Vector2 velocity = targetVec - Projectile.Center; velocity.Normalize(); //Add some inaccuracy for the vomit projectiles - float vomitSpeedMult = 16f; + float vomitSpeedMult = 20f; Vector2 vomitVel = velocity * vomitSpeedMult; vomitVel.Y += Main.rand.NextFloat(-30f, 30f) * 0.05f; vomitVel.X += Main.rand.NextFloat(-30f, 30f) * 0.05f; //Fire the vomit projectile - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vomitVel, projType, Projectile.damage, Projectile.knockBack, Projectile.owner, Main.rand.Next(3), 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vomitVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, Main.rand.Next(3), 0f); - //Fire 5 bubbles for every three attacks + //Fire 3 bubbles for every three attacks if (bubbleCounter++ % 3 == 2) { - for (int projCount = 0; projCount < 5; projCount++) + for (int projCount = 0; projCount < 3; projCount++) { //Add a shotgun spread to the bubbles float bubbleSpeedMult = 14f; @@ -298,9 +297,6 @@ namespace CalamityMod.Projectiles.Summon } } - //This minion does no contact damage - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/GastricBelcherVomit.cs b/Projectiles/Summon/GastricBelcherVomit.cs index f5c7e0265a..164a628baa 100644 --- a/Projectiles/Summon/GastricBelcherVomit.cs +++ b/Projectiles/Summon/GastricBelcherVomit.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.width = Projectile.height = 18; Projectile.timeLeft = 300; - Projectile.penetrate = 3; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.penetrate = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/GhostFire.cs b/Projectiles/Summon/GhostFire.cs index d4f5d8136a..5517dc5ad6 100644 --- a/Projectiles/Summon/GhostFire.cs +++ b/Projectiles/Summon/GhostFire.cs @@ -36,7 +36,10 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } public override bool? CanDamage() => ableToHit ? (bool?)null : false; - + public override bool? CanHitNPC(NPC target) + { + return target.CanBeChasedBy() ? null : false; + } public override void AI() { Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Summon/HauntedDishes.cs b/Projectiles/Summon/HauntedDishes.cs index c37e9eca65..ece47484a5 100644 --- a/Projectiles/Summon/HauntedDishes.cs +++ b/Projectiles/Summon/HauntedDishes.cs @@ -15,9 +15,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 19; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 19; } public override void SetDefaults() @@ -566,8 +567,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) { fallThrough = false; diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index c40b5a5741..444d3c756a 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 9; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -359,6 +360,8 @@ namespace CalamityMod.Projectiles.Summon return true; } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/HerringAI.cs b/Projectiles/Summon/HerringAI.cs index 1c5e8e6087..54ae7836db 100644 --- a/Projectiles/Summon/HerringAI.cs +++ b/Projectiles/Summon/HerringAI.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -94,6 +95,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index 204cf095bf..83cce4898f 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -93,12 +93,10 @@ namespace CalamityMod.Projectiles.Summon rememberTarget = Collision.CanHit(Projectile.Center, 0, 0, npc.position, npc.width, npc.height); if (rememberTarget && Projectile.owner == Main.myPlayer) { - Vector2 speed = npc.Center - Projectile.Center; - speed.Normalize(); - speed *= 8f; + Vector2 iceSpeed = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, npc, 12f * (Utils.GetLerpValue(0f, 1000f, Vector2.Distance(Projectile.Center, npc.Center)) + 1)); if (Projectile.ai[1] >= 300f) - speed = speed.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-5, 6))) * 1.5f + npc.velocity / 2f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, speed + npc.velocity / 2f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + iceSpeed = iceSpeed.RotatedByRandom(MathHelper.Pi * 0.025f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, iceSpeed, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } } } @@ -132,7 +130,6 @@ namespace CalamityMod.Projectiles.Summon if (possibleTarget > 0) { - //Main.NewText("new target acquired"); Projectile.ai[0] = possibleTarget; Projectile.ai[1] = 0f; Projectile.netUpdate = true; diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index 4bff9cf79d..cb17cbe72a 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -1,107 +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() { - 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 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++) @@ -113,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/LiliesOfFinalityAriane.cs b/Projectiles/Summon/LiliesOfFinalityAriane.cs index 7139fe46db..ae5957be13 100644 --- a/Projectiles/Summon/LiliesOfFinalityAriane.cs +++ b/Projectiles/Summon/LiliesOfFinalityAriane.cs @@ -150,8 +150,6 @@ namespace CalamityMod.Projectiles.Summon return true; } - public override bool? CanDamage() => false; - #endregion #region AI diff --git a/Projectiles/Summon/LiliesOfFinalityElster.cs b/Projectiles/Summon/LiliesOfFinalityElster.cs index 3d52276011..5e67a36e07 100644 --- a/Projectiles/Summon/LiliesOfFinalityElster.cs +++ b/Projectiles/Summon/LiliesOfFinalityElster.cs @@ -146,8 +146,6 @@ namespace CalamityMod.Projectiles.Summon return true; } - public override bool? CanDamage() => false; - #endregion #region AI diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index c809587298..502494bb28 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.TrailCacheLength[Type] = 4; ProjectileID.Sets.TrailingMode[Type] = 0; } @@ -39,8 +41,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } - public override bool? CanDamage() => false; - public override void AI() { Lighting.AddLight(Projectile.Center, Color.SkyBlue.ToVector3()); diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index fd1ef345c5..8bf960074c 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnKill(int timeLeft) // When the projectile hits an enemy, it'll make a dust impact effect. { SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - for (int dustIndex = 0; dustIndex < 36; dustIndex++) + for (int dustIndex = 0; dustIndex < 18; dustIndex++) { Dust.NewDust(Projectile.Center, Projectile.width, 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/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index a86a9b90d6..90f0b0cbae 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -229,7 +230,5 @@ namespace CalamityMod.Projectiles.Summon { return new Color(100, 250, 250, Projectile.alpha); } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 62400663b8..46df273110 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -245,7 +246,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/PlaguebringerMK2.cs b/Projectiles/Summon/PlaguebringerMK2.cs index 45bb6d1396..01e795d795 100644 --- a/Projectiles/Summon/PlaguebringerMK2.cs +++ b/Projectiles/Summon/PlaguebringerMK2.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() @@ -128,7 +129,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 0; } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/PowerfulRaven.cs b/Projectiles/Summon/PowerfulRaven.cs index 379971a921..6efe8f8276 100644 --- a/Projectiles/Summon/PowerfulRaven.cs +++ b/Projectiles/Summon/PowerfulRaven.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 5; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -148,5 +149,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.direction = Projectile.spriteDirection = (Projectile.velocity.X > 0).ToDirectionInt(); } + + public override bool MinionContactDamage() => true; } } diff --git a/Projectiles/Summon/PuffWarrior.cs b/Projectiles/Summon/PuffWarrior.cs index 91dc1aa0a2..887fc8d6bd 100644 --- a/Projectiles/Summon/PuffWarrior.cs +++ b/Projectiles/Summon/PuffWarrior.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 10; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -199,6 +200,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (EnemyFailureCooldown > 0) diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index 790c60d81a..b7a03a55bc 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -87,6 +88,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.ChargingMinionAI(1200f, 1500f, 2400f, 150f, 0, 25f, 20f, 9f, new Vector2(0f, -60f), 30f, 15f, true, true); } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Summon/SageNeedle.cs b/Projectiles/Summon/SageNeedle.cs index 0efecc2a3b..b17ad2b12e 100644 --- a/Projectiles/Summon/SageNeedle.cs +++ b/Projectiles/Summon/SageNeedle.cs @@ -41,14 +41,14 @@ namespace CalamityMod.Projectiles.Summon // A slightly-smoothened curve that's a little less potent than a linear curve. // Has the potential to eventually surpass a linear curve, but this is infeasible, only happening // at around 344 allocated slots. - float averageDamageMultiplier = (float)(Math.Pow(totalSageSpirits, 0.73D) + Math.Pow(totalSageSpirits, 1.1D)) * 0.5f; + float averageDamageMultiplier = (float)(Math.Pow(totalSageSpirits, 0.9D) + Math.Pow(totalSageSpirits, 1.13D)) * 0.5f; - // 1 slot provides 25 DoT. - // 2 slots provide 48 DoT. - // 3 slots provide 70 DoT. - // 4 slots provide 92 DoT. - // 5 slots provide 114 DoT. - int sagePoisonDamage = (int)(50 * averageDamageMultiplier); + // 1 slot provides 25 DoT. + // 2 slots provide 50 DoT. + // 3 slots provide 76 DoT. + // [...] + // 9 slots provide 240 DoT. + int sagePoisonDamage = (int)(SagePoison.debuffData.EnemyLostRegen * averageDamageMultiplier); target.AddBuff(ModContent.BuffType(), 300); target.Calamity().sagePoisonDamage = sagePoisonDamage; } diff --git a/Projectiles/Summon/SageSpirit.cs b/Projectiles/Summon/SageSpirit.cs index c7925c58ac..c621a77e78 100644 --- a/Projectiles/Summon/SageSpirit.cs +++ b/Projectiles/Summon/SageSpirit.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -191,8 +192,5 @@ namespace CalamityMod.Projectiles.Summon } } } - - // The spirit itself should not do direct damage. - public override bool? CanDamage() => false; } } 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/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 4fcc69068f..d9f2fb1c4b 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -81,12 +82,12 @@ namespace CalamityMod.Projectiles.Summon { if (CheckForSpawning == false) { - int dustAmount = 75; - for (int dustIndex = 0; dustIndex < dustAmount; dustIndex++) + int dustAmount = 25; + for (int d = 0; d < dustAmount; d++) { - float angle = MathHelper.TwoPi / dustAmount * dustIndex; + float angle = MathHelper.TwoPi / dustAmount * d; Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(5f, 6.5f); - Dust spawnDust = Dust.NewDustPerfect(Projectile.Center, 85, velocity); + Dust.NewDustPerfect(Projectile.Center, DustID.UnusedBrown, velocity); } CheckForSpawning = true; } @@ -165,8 +166,6 @@ namespace CalamityMod.Projectiles.Summon TimerForShooting++; } - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/SarosAura.cs b/Projectiles/Summon/SarosAura.cs index e626a5ea77..c9721af9e7 100644 --- a/Projectiles/Summon/SarosAura.cs +++ b/Projectiles/Summon/SarosAura.cs @@ -128,8 +128,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/SeashineSwordProj.cs b/Projectiles/Summon/SeashineSwordProj.cs index 61917656be..d8e21def52 100644 --- a/Projectiles/Summon/SeashineSwordProj.cs +++ b/Projectiles/Summon/SeashineSwordProj.cs @@ -316,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? CanDamage() => (isAttacking && attackTimer > bladeValue && Projectile.ai[0] != 0) ? null : false; + public override bool? CanDamage() => isAttacking && attackTimer > bladeValue && Projectile.ai[0] != 0; } } diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs index 19acb71cf0..c3dbaf6c1c 100644 --- a/Projectiles/Summon/SeekerSummonProj.cs +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 5; + Main.projPet[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; } @@ -159,5 +160,7 @@ namespace CalamityMod.Projectiles.Summon else if (Projectile.velocity.Length() < 28f) Projectile.velocity = Projectile.SafeDirectionTo(target.Center) * 29f; } + + public override bool MinionContactDamage() => true; } } diff --git a/Projectiles/Summon/SepulcherMinion.cs b/Projectiles/Summon/SepulcherMinion.cs index 61ce1510ae..88a2cc9289 100644 --- a/Projectiles/Summon/SepulcherMinion.cs +++ b/Projectiles/Summon/SepulcherMinion.cs @@ -693,6 +693,8 @@ namespace CalamityMod.Projectiles.Summon #endregion + public override bool MinionContactDamage() => true; + public override bool? CanHitNPC(NPC target) { if (target.type == ModContent.NPCType()) diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index c49d18530f..be18d29396 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -424,7 +424,7 @@ namespace CalamityMod.Projectiles.Summon return null; } - public override bool? CanDamage() => Projectile.ai[0] == 0f; + public override bool MinionContactDamage() => Projectile.ai[0] == 0f; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index 8078ce92df..32bc089bd1 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -120,8 +120,6 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index 533f5934b4..1d93cc03e1 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -138,5 +138,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 0; } } + + public override bool MinionContactDamage() => true; } } diff --git a/Projectiles/Summon/SmallSkeletonMinion.cs b/Projectiles/Summon/SmallSkeletonMinion.cs index 2cc5640838..d5be045715 100644 --- a/Projectiles/Summon/SmallSkeletonMinion.cs +++ b/Projectiles/Summon/SmallSkeletonMinion.cs @@ -15,9 +15,10 @@ namespace CalamityMod.Projectiles.Summon public int Variant; public override void SetStaticDefaults() { + Main.projFrames[Type] = 7; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -171,6 +172,9 @@ namespace CalamityMod.Projectiles.Summon } return true; } + + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Rectangle frame = new Rectangle(Variant * Projectile.width, Projectile.frame * Projectile.height, Projectile.width, Projectile.height); diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index 890f7bbf8c..47b224fc2b 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -128,7 +129,5 @@ namespace CalamityMod.Projectiles.Summon } public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 3ca4ff1c0f..b3c3595cc5 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -129,7 +130,5 @@ namespace CalamityMod.Projectiles.Summon } public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/StellarTorusSummon.cs b/Projectiles/Summon/StellarTorusSummon.cs index 0be79f013e..8a178d4edc 100644 --- a/Projectiles/Summon/StellarTorusSummon.cs +++ b/Projectiles/Summon/StellarTorusSummon.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.DrawScreenCheckFluff[Type] = 12000; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; @@ -272,7 +273,5 @@ namespace CalamityMod.Projectiles.Summon return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index dfa4c71d3b..5c67d408c2 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 10; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -557,7 +558,5 @@ namespace CalamityMod.Projectiles.Summon Main.gore[index].velocity *= 0.1f; } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/TacticalPlagueJet.cs b/Projectiles/Summon/TacticalPlagueJet.cs index 0fad924ff2..854d66152b 100644 --- a/Projectiles/Summon/TacticalPlagueJet.cs +++ b/Projectiles/Summon/TacticalPlagueJet.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 3; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -59,8 +60,6 @@ namespace CalamityMod.Projectiles.Summon FalseGun.DamageType = DamageClass.Summon; } - public override bool? CanDamage() => false; - public override void AI() { Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Summon/TundraFlameBlossom.cs b/Projectiles/Summon/TundraFlameBlossom.cs index 8d7d4333ea..cfd486db17 100644 --- a/Projectiles/Summon/TundraFlameBlossom.cs +++ b/Projectiles/Summon/TundraFlameBlossom.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -109,8 +110,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; } - public override bool? CanDamage() => false; - #endregion } } 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/Umbrella/MagicHat.cs b/Projectiles/Summon/Umbrella/MagicHat.cs index 367a495d61..c75ea5de51 100644 --- a/Projectiles/Summon/Umbrella/MagicHat.cs +++ b/Projectiles/Summon/Umbrella/MagicHat.cs @@ -116,9 +116,6 @@ namespace CalamityMod.Projectiles.Summon.Umbrella // Glowmask effect public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - // No contact damage - public override bool? CanDamage() => false; - // Draw over players public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) => overPlayers.Add(index); 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 d17ed5e292..8c6d8b632a 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 3; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -39,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]; @@ -56,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++) { @@ -115,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; @@ -146,25 +137,19 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.owner == Main.myPlayer) { if (eaterCooldown > 0) - eaterCooldown -= Main.rand.Next(1, 3); + eaterCooldown--; if (eaterCooldown <= 0) { - int projNumber = Main.rand.Next(1, 3); - for (int index2 = 0; index2 < projNumber; index2++) - { - float xVector = (float)Main.rand.Next(-35, 36) * 0.02f; - float yVector = (float)Main.rand.Next(-35, 36) * 0.02f; - xVector *= 10f; - yVector *= 10f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, xVector, yVector, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25f), Projectile.knockBack, Projectile.owner); - } - eaterCooldown = 80; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(7f, 7f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + eaterCooldown = Projectile.localNPCHitCooldown; } } } } + public override bool MinionContactDamage() => true; + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Player player = Main.player[Projectile.owner]; @@ -209,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; @@ -222,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/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs index d8180d7698..ce229a590f 100644 --- a/Projectiles/Summon/ViridVanguardBlade.cs +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -57,6 +57,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 2; ProjectileID.Sets.TrailCacheLength[Type] = 45; @@ -91,6 +93,8 @@ namespace CalamityMod.Projectiles.Summon ChargeStartingPosition = reader.ReadVector2(); } + public override bool MinionContactDamage() => true; + public override void AI() { // Decide whether the minion should still exist. diff --git a/Projectiles/Summon/VoidConcentrationAura.cs b/Projectiles/Summon/VoidConcentrationAura.cs index 91487ce95c..1d9f07ff49 100644 --- a/Projectiles/Summon/VoidConcentrationAura.cs +++ b/Projectiles/Summon/VoidConcentrationAura.cs @@ -91,5 +91,7 @@ namespace CalamityMod.Projectiles.Summon return; timer++; } + + public override bool MinionContactDamage() => true; } } 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/Summon/WhiteDragonHead.cs b/Projectiles/Summon/WhiteDragonHead.cs index 421192a221..6a02f6f326 100644 --- a/Projectiles/Summon/WhiteDragonHead.cs +++ b/Projectiles/Summon/WhiteDragonHead.cs @@ -214,6 +214,8 @@ namespace CalamityMod.Projectiles.Summon return false; } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 300); } } diff --git a/Projectiles/Summon/WitherBlossom.cs b/Projectiles/Summon/WitherBlossom.cs index 833562f02a..fdb893d419 100644 --- a/Projectiles/Summon/WitherBlossom.cs +++ b/Projectiles/Summon/WitherBlossom.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -59,7 +60,5 @@ namespace CalamityMod.Projectiles.Summon } } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index cc8d4f7eee..eb1096612e 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -99,6 +99,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 12; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -118,6 +119,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; Initialized = 0f; + BuffModeBuffer = 15; } //Returns the npc if targetable, returns null if not @@ -164,15 +166,37 @@ namespace CalamityMod.Projectiles.Summon if (Owner.Calamity().mouseRight && Owner.HeldItem.type == ModContent.ItemType()) { - if (BuffModeBuffer > 0) + if (Owner.itemTime == Owner.itemTimeMax) + { + if (BuffModeBuffer == 15) + BuffModeBuffer--; + if (BuffModeBuffer == -15) + BuffModeBuffer++; + } + if (BuffModeBuffer < 15 && BuffModeBuffer >= 0) { BuffModeBuffer--; - Projectile.netUpdate = true; + if (BuffModeBuffer == 0) + BuffModeBuffer = -15; } + if (BuffModeBuffer > -15 && BuffModeBuffer <= 0) + { + BuffModeBuffer++; + if (BuffModeBuffer == 0) + BuffModeBuffer = 15; + } + Projectile.netUpdate = true; + } + + else if (BuffModeBuffer > 0 && BuffModeBuffer < 15) + { + BuffModeBuffer++; + } + else if (BuffModeBuffer < 0 && BuffModeBuffer > -15) + { + BuffModeBuffer--; } - else if (BuffModeBuffer < 15) - BuffModeBuffer = 15; bool buffMode = BuffModeBuffer <= 0; @@ -368,8 +392,7 @@ namespace CalamityMod.Projectiles.Summon { ShootTimer = ShootDelay; - // 1/3 chance to directly recharge the Rover Drive shield by 1 point - if (Main.rand.NextBool(3) && modPlayer.roverDrive && modPlayer.RoverDriveShieldDurability < RoverDrive.ShieldDurabilityMax) + if (modPlayer.roverDrive && modPlayer.RoverDriveShieldDurability < RoverDrive.ShieldDurabilityMax) { CalamityPlayer buffedCalPlayer = playerToBuff.Calamity(); buffedCalPlayer.RoverDriveShieldDurability++; @@ -508,8 +531,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override void SendExtraAI(BinaryWriter writer) { writer.Write(BuffModeBuffer); diff --git a/Projectiles/Turret/IceShot.cs b/Projectiles/Turret/IceShot.cs index bef1dc5cb2..8f970f9d8e 100644 --- a/Projectiles/Turret/IceShot.cs +++ b/Projectiles/Turret/IceShot.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Turret } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); target.AddBuff(BuffID.Frostburn, 180); if (Projectile.hostile && Main.netMode == NetmodeID.MultiplayerClient) //hostile version pierces through players in multiplayer return; 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/BlazingStarThatDoesNotHeal.cs b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs index c4e2de0393..3082837b88 100644 --- a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs +++ b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs @@ -101,6 +101,8 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60 * 5); + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); } } diff --git a/Projectiles/Typeless/BloomStoneFlower.cs b/Projectiles/Typeless/BloomStoneFlower.cs index 596a08d25f..80e590b0d6 100644 --- a/Projectiles/Typeless/BloomStoneFlower.cs +++ b/Projectiles/Typeless/BloomStoneFlower.cs @@ -1,6 +1,9 @@ -using CalamityMod.Dusts; +using System; +using System.Collections.Generic; +using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -15,57 +18,86 @@ namespace CalamityMod.Projectiles.Typeless public ref float HookIndex => ref Projectile.ai[0]; public ref float FlowerPart => ref Projectile.ai[1]; + + public ref float timer => ref Projectile.ai[2]; + public float fadeTime = 0; + public bool fadeOut = false; + public int maxTime = 5; public override void SetDefaults() { Projectile.width = Projectile.height = 30; - Projectile.scale = 1.2f; + Projectile.scale = 1f; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 300; + Projectile.timeLeft = 150; } public override void AI() { + if (timer == 0) + Projectile.rotation = Main.rand.NextFloat(0, MathHelper.TwoPi); switch (FlowerPart) { case 0: Projectile hook = Main.projectile[(int)HookIndex]; if (!(hook.active && hook.aiStyle == ProjAIStyleID.Hook && hook.ai[0] == 2f)) { - Projectile.Kill(); - return; + fadeOut = true; } + float sine = (float)Math.Sin(timer * 0.01f); + Projectile.rotation += fadeTime * sine * 0.005f; + if (Projectile.scale > 1) + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1, 0.15f); - Projectile.timeLeft = 5; - if (Vector2.DistanceSquared(Projectile.Center, Main.player[Projectile.owner].Center) < 1024f) + Projectile.timeLeft++; + if (!fadeOut && Vector2.DistanceSquared(Projectile.Center, Main.player[Projectile.owner].Center) < 4096f) { SoundEngine.PlaySound(SoundID.Item60, Projectile.Center); if (Main.myPlayer == Projectile.owner) { - for (int i = 0; i < 5; i++) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(4f, 4f), Type, 0, 0f, Projectile.owner, 0f, 1f); + int dusts = 6; + int dir = Main.rand.NextBool() ? -1 : 1; + for (int i = 0; i < dusts; i++) + { + Projectile pollen = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (MathHelper.TwoPi / dusts * i).ToRotationVector2() * 3f, Type, 0, 0f, Projectile.owner, 0f, 1f); + pollen.localAI[0] = dir; + } + } - Projectile.Kill(); + fadeOut = true; + Projectile.scale = 2.5f; } + if ((fadeOut && Projectile.scale <= 1.05f) || (!fadeOut && fadeTime < maxTime)) + fadeTime += (fadeOut ? -0.2f : 1); + + if (fadeTime < 0 && fadeOut) + Projectile.Kill(); break; case 1: + if (timer == 0) + { + Projectile.scale = 1.8f; + Projectile.extraUpdates = 1; + } if (Projectile.width < 90) Projectile.ExpandHitboxBy(90); - Projectile.velocity *= 0.98f; - + Projectile.velocity = Projectile.velocity.RotatedBy(0.04f * Projectile.localAI[0]) * 1.001f; + Color mistColor = Color.Lerp(Color.HotPink, Color.Gold, Utils.GetLerpValue(100, 0, Projectile.timeLeft, true)); // Visual effect - if (Projectile.timeLeft % 10 == 0) + if (Projectile.timeLeft % 4 == 0) { - MediumMistParticle pollenCloud = new(Projectile.Center, Main.rand.NextVector2Circular(1f, 1f), Color.Yellow, Color.Gold, 3f, 100f); + MediumMistParticle pollenCloud = new(Projectile.Center, Main.rand.NextVector2Circular(1f, 1f), mistColor, mistColor, 3f * Projectile.scale, 100f); GeneralParticleHandler.SpawnParticle(pollenCloud); } if (Projectile.timeLeft % 4 == 0) { - Dust pollenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), newColor: Color.Gold, Scale: 0.6f); + Dust pollenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), newColor: mistColor, Scale: 0.6f * Projectile.scale); pollenDust.noLightEmittence = true; pollenDust.noGravity = true; } + if (Projectile.scale > 0.7f) + Projectile.scale -= 0.025f; // Check for buffing Player owner = Main.player[Projectile.owner]; @@ -75,12 +107,44 @@ namespace CalamityMod.Projectiles.Typeless continue; if (Projectile.Hitbox.Intersects(p.Hitbox)) - p.Calamity().bloomStoneDR = 360; + p.Calamity().bloomStoneBuffedHealRateTimer = 360; } + fadeTime++; break; } + timer++; } - public override bool PreDraw(ref Color lightColor) => FlowerPart == 0f; + public override bool PreDraw(ref Color lightColor) + { + if (FlowerPart == 0f) + { + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/BigHeart").Value; + Texture2D tex = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + int parts = 5; + float rot = 0; + float scaleFade = (float)Math.Pow(Utils.GetLerpValue(0, maxTime, fadeTime, true), 2); + for (int b = 0; b < 3; b++) + { + Color drawColor = Color.Lerp(Color.HotPink, Color.Plum, b * 0.3f) with { A = 0 }; + float scaleMult = (1 - 0.15f * b) * scaleFade; + for (int i = 0; i < parts; i++) + { + Vector2 vel = (MathHelper.TwoPi * i / parts).ToRotationVector2(); + Main.EntitySpriteDraw(tex2, Projectile.Center - Main.screenPosition + vel.RotatedBy(Projectile.rotation * (float)Math.Pow(1.5f - scaleMult, 2) + rot) * 35 * scaleMult, null, drawColor * 0.3f, Projectile.rotation * (float)Math.Pow(1.5f - scaleMult, 2) + vel.ToRotation() + MathHelper.PiOver2 + rot, tex2.Size() / 2f, new Vector2(0.9f, 1.5f) * Projectile.scale * 0.15f * scaleMult, SpriteEffects.None, 0); + } + rot += MathHelper.PiOver4 * 0.5f; + } + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.Gold with { A = 0 }, Projectile.rotation, tex.Size() / 2f, Projectile.scale * 0.45f * scaleFade, SpriteEffects.None, 0); + + return false; + } + else return false; + } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + overPlayers.Add(index); + } } } diff --git a/Projectiles/Typeless/BlunderBoosterAura.cs b/Projectiles/Typeless/BlunderBoosterAura.cs index 440c655f07..a083ecbb2e 100644 --- a/Projectiles/Typeless/BlunderBoosterAura.cs +++ b/Projectiles/Typeless/BlunderBoosterAura.cs @@ -66,23 +66,9 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - - if (target.knockBackResist <= 0f) - return; - - // 12AUG2023: Ozzatron: TML was giving NaN knockback, probably due to 0 base knockback. Do not use hit.Knockback - if (CalamityGlobalNPC.ShouldAffectNPC(target)) - { - float knockbackMultiplier = MathHelper.Clamp(1f - target.knockBackResist, 0f, 1f); - Vector2 trueKnockback = target.Center - Projectile.Center; - trueKnockback.Normalize(); - target.velocity = trueKnockback * knockbackMultiplier; - } - } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + // CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (target.Center.X > Projectile.Center.X).ToDirectionInt(); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Typeless/CryonicShield.cs b/Projectiles/Typeless/CryonicShield.cs index e3e6320565..c07289dd98 100644 --- a/Projectiles/Typeless/CryonicShield.cs +++ b/Projectiles/Typeless/CryonicShield.cs @@ -57,36 +57,20 @@ 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]; CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.CryoStoneVanity) - { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); - } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Size.Length() * 0.5f, targetHitbox); diff --git a/Projectiles/Typeless/FlameLickedBarrage.cs b/Projectiles/Typeless/FlameLickedBarrage.cs index f94d416372..0169f45ec6 100644 --- a/Projectiles/Typeless/FlameLickedBarrage.cs +++ b/Projectiles/Typeless/FlameLickedBarrage.cs @@ -57,7 +57,9 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 90); + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); } public override void OnHitPlayer(Player target, Player.HurtInfo info) diff --git a/Projectiles/Typeless/FlameLickedHellblast.cs b/Projectiles/Typeless/FlameLickedHellblast.cs index 944ca206b1..3e2e579ae4 100644 --- a/Projectiles/Typeless/FlameLickedHellblast.cs +++ b/Projectiles/Typeless/FlameLickedHellblast.cs @@ -89,7 +89,9 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 90); + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Typeless/FlashBolt.cs b/Projectiles/Typeless/FlashBolt.cs index 3f86de4862..dedd6b3d94 100644 --- a/Projectiles/Typeless/FlashBolt.cs +++ b/Projectiles/Typeless/FlashBolt.cs @@ -1,5 +1,9 @@ -using CalamityMod.Particles; +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -12,9 +16,16 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public int time = 0; - public float colorValue = 0; - public float sizeMult = 1; + public int dir = 0; + bool setAltPlace = false; + public Vector2 altPlace; + public Player Owner => Main.player[Projectile.owner]; public bool invalidTarget => (Projectile.ai[0] < 0f || Projectile.ai[0] > 199f); + public bool simplify => Projectile.ai[1] > 0f; + public override void SetStaticDefaults() + { + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; + } public override void SetDefaults() { Projectile.width = 60; @@ -24,22 +35,20 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ignoreWater = true; Projectile.DamageType = AverageDamageClass.Instance; Projectile.penetrate = 1; // Survives through its first hit by "cheating" and incrementing its own pierce counter - Projectile.extraUpdates = 75; - Projectile.timeLeft = 200; + Projectile.extraUpdates = 0; + Projectile.timeLeft = 2; } - public override void AI() { - Player Owner = Main.player[Projectile.owner]; + // If the target is dead, remove them as a target and hit anything + NPC target = (invalidTarget ? null : Main.npc[(int)Projectile.ai[0]]); + if (target == null || !target.active || target.life <= 0) + Projectile.ai[0] = -1; + // Visibility/Sound toggle on acc visibility bool visible = Owner.Calamity().arcFlashRingVisual; - colorValue = MathHelper.Lerp(colorValue, 50, 0.025f); - Color usedColor = Color.Lerp(Color.Cyan, Color.Orchid, Utils.GetLerpValue(0, 50, colorValue)); - - if (time == 0) + if (time == 0 && Projectile.ai[0] != -1 && !simplify) { - colorValue += Main.rand.Next(0, 20); - sizeMult = 1; if (visible) { SoundStyle fire = new("CalamityMod/Sounds/Item/ArcFlash"); @@ -47,71 +56,91 @@ namespace CalamityMod.Projectiles.Typeless } } - // If the target is dead, remove them as a target and hit anything - NPC target = (invalidTarget ? null : Main.npc[(int)Projectile.ai[0]]); - if (target == null || !target.active || target.life <= 0) - Projectile.ai[0] = -1; - - float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); - - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (targetDist < 1400f) - { - Vector2 pos = Projectile.Center - Projectile.velocity * 15; - if (Projectile.timeLeft % 4 == 0) - { - Particle spark2 = new BoltParticle(pos, -Projectile.velocity * 0.05f, false, 30, 0.6f * sizeMult, usedColor * (visible ? 1 : 0.25f), new Vector2(1.8f, 0.8f), true, true, false, 0.3f); - GeneralParticleHandler.SpawnParticle(spark2); - } - if (Main.rand.NextBool(35)) - { - Particle spark2 = new BoltParticle(pos, Projectile.velocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 1.9f), false, 23, Main.rand.NextFloat(0.2f, 0.25f) * sizeMult, usedColor * (visible ? 1 : 0.3f), new Vector2(1.8f, 0.8f), true, true, false, 0.3f); - GeneralParticleHandler.SpawnParticle(spark2); - } - if (Main.rand.NextBool(10) && visible) - { - Particle spark2 = new CustomSpark(pos, Projectile.velocity * Main.rand.NextFloat(-0.4f, 0.4f), "CalamityMod/Particles/DrainLineBloom", false, 80, Main.rand.NextFloat(1.2f, 1.3f) * sizeMult, usedColor * (visible ? 1 : 0.3f), new Vector2(1, 4), true, true); - GeneralParticleHandler.SpawnParticle(spark2); - } - if (time % 5 == 0 && visible) - { - Dust dust = Dust.NewDustPerfect(pos, 278, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(0.45f, 0.6f)); - dust.noGravity = true; - dust.color = usedColor; - } - } - if (Projectile.numHits > 0) - { - sizeMult *= 0.97f; - } time++; } + public override bool PreDraw(ref Color lightColor) + { + if (!setAltPlace) + { + NPC target = (invalidTarget ? null : Main.npc[(int)Projectile.ai[0]]); + if (target == null || !target.active || target.life <= 0) + Projectile.ai[0] = -1; + if (target != null && Projectile.ai[0] != -1) + { + float size = (Math.Min(target.width, target.height) * 0.35f) + 10; + altPlace = Projectile.Center + Main.rand.NextVector2Circular(size, size); + } + setAltPlace = true; + } + + if (simplify || !Owner.Calamity().arcFlashRingVisual) + return false; + + Texture2D tex = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + if (dir == 0) + dir = Main.rand.NextBool() ? -1 : 1; + + int distance = (int)(600 + (altPlace.Y - Owner.Center.Y)); + int travelAmount = 10; + Vector2 currentPos = altPlace; + Vector2 lastPos = currentPos; + bool zap = false; // Swapping the direction of the bolt + Color drawColor = Color.White; + float lifeLerp = (Projectile.numHits == 0 ? 1 : (float)Math.Pow(Utils.GetLerpValue(-5, 15, Projectile.timeLeft, true), 3)); + int angleSwapTimer = 0; + int angleSwapMax = 7; + for (int i = 0; i < distance; i += travelAmount) + { + float angleLerp = Math.Min(Utils.GetLerpValue(angleSwapMax, 0, angleSwapTimer, true), Utils.GetLerpValue(0, angleSwapMax, angleSwapTimer, true)); + float endLerp = Utils.GetLerpValue(0, distance, i, true); + drawColor = Color.Lerp(Color.Cyan, Color.Orchid, endLerp); + Main.EntitySpriteDraw(tex, currentPos - Main.screenPosition, null, drawColor with { A = 0 }, lastPos.DirectionTo(currentPos).ToRotation() + MathHelper.PiOver2, new Vector2(tex.Width / 2, tex.Height / 2), new Vector2((2.5f - 1.5f * angleLerp) * lifeLerp * Math.Max(endLerp, 0.25f), 1 + 2f * angleLerp) * 0.2f, SpriteEffects.None); + lastPos = currentPos; + currentPos -= new Vector2(travelAmount * 1.5f * endLerp * dir * (zap ? -1 : 1) * lifeLerp, travelAmount); + angleSwapTimer++; + if (angleSwapTimer >= angleSwapMax) { zap = !zap; angleSwapTimer = 0; } + } + return false; + } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - // Stops the projectile from deleting itself, while maintaining the masquerade - Projectile.penetrate++; - - //colorValue = Main.rand.Next(0, 10); target.AddBuff(BuffID.Electrified, 180); - Projectile.timeLeft = 25; - Player Owner = Main.player[Projectile.owner]; - if (Owner.Calamity().arcFlashRingVisual && Projectile.numHits == 0) + if (!simplify) { - Vector2 pos = target.Center; - for (int i = 0; i < 10; i++) + // Stops the projectile from deleting itself, while maintaining the masquerade + Projectile.penetrate++; + + Projectile.timeLeft = 15; + if (Projectile.numHits == 0) { - Particle spark2 = new BoltParticle(pos, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1.9f), true, 13, Main.rand.NextFloat(0.2f, 0.3f) * sizeMult, Main.rand.NextBool(5) ? Color.Cyan : Color.Orchid, new Vector2(1.8f, 0.8f), true, true, false, 0.8f); - GeneralParticleHandler.SpawnParticle(spark2); - Dust dust = Dust.NewDustPerfect(pos, 278, new Vector2(14, 14).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(0.8f, 0.9f)); - dust.noGravity = false; - dust.color = Main.rand.NextBool(5) ? Color.Cyan : Color.Orchid; + if (!setAltPlace) + { + if (target != null && Projectile.ai[0] != -1) + { + float size = (Math.Min(target.width, target.height) * 0.35f) + 10; + altPlace = Projectile.Center + Main.rand.NextVector2Circular(size, size); + } + setAltPlace = true; + } + Vector2 pos = altPlace; + if (Owner.Calamity().arcFlashRingVisual) + { + for (int i = 0; i < 10; i++) + { + Dust dust = Dust.NewDustPerfect(pos, ModContent.DustType(), new Vector2(18, 18).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(1.3f, 1.5f) * 3); + dust.noGravity = true; + dust.color = Main.rand.NextBool(3) ? Color.Cyan : Color.Orchid; + dust.fadeIn = 7.5f; + } + Particle orb = new CustomPulse(pos, Vector2.Zero, Color.Orchid, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.68f, 0.5f, 14); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new CustomPulse(pos, Vector2.Zero, Color.White * 0.8f, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.225f, 0.2f, 14); + GeneralParticleHandler.SpawnParticle(orb2); + } + Particle pulse2 = new CustomPulse(pos, Vector2.Zero, Color.Cyan * (Owner.Calamity().arcFlashRingVisual ? 1 : 0.6f), "CalamityMod/Particles/BloomRing", new Vector2(1, 1), 0, 0.3f, 0.95f, 10); + GeneralParticleHandler.SpawnParticle(pulse2); } - Particle pulse2 = new CustomPulse(pos, Vector2.Zero, Color.Orchid, "CalamityMod/Particles/HighResFoggyCircleHardEdge", new Vector2(1, 1), 0, 0f, 0.0715f, 10); - GeneralParticleHandler.SpawnParticle(pulse2); - Particle orb = new CustomPulse(pos, Vector2.Zero, Color.Orchid, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.78f, 0.5f, 14); - GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new CustomPulse(pos, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.325f, 0.2f, 14); - GeneralParticleHandler.SpawnParticle(orb2); } } public override bool? CanHitNPC(NPC target) @@ -120,7 +149,7 @@ namespace CalamityMod.Projectiles.Typeless return null; return false; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.numHits > 0 ? false : CalamityUtils.CircularHitboxCollision(Projectile.Center, 60 * sizeMult, targetHitbox); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.numHits > 0 ? false : base.Colliding(projHitbox, targetHitbox); public override bool? CanCutTiles() => false; } } diff --git a/Projectiles/Typeless/FungalClumpMinion.cs b/Projectiles/Typeless/FungalClumpMinion.cs index 5094d26e31..977f810951 100644 --- a/Projectiles/Typeless/FungalClumpMinion.cs +++ b/Projectiles/Typeless/FungalClumpMinion.cs @@ -231,20 +231,7 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if (Main.player[Projectile.owner].moonLeech) - return; - - int heal = (int)Math.Round(damageDone * 0.25); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 1, 2f); public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Typeless/HydrothermalSmoke.cs b/Projectiles/Typeless/HydrothermalSmoke.cs index 7d0236bda1..1fda4b4a77 100644 --- a/Projectiles/Typeless/HydrothermalSmoke.cs +++ b/Projectiles/Typeless/HydrothermalSmoke.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +11,7 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() { Projectile.width = 20; @@ -23,21 +25,13 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + if (Projectile.timeLeft == 6) Projectile.Center = Main.player[Projectile.owner].Center; - int randomDust = Main.rand.Next(4); - if (randomDust == 3) + if (Main.rand.NextBool(6)) { - randomDust = 16; - } - else - { - randomDust = 127; - } - if (Main.rand.NextBool(4)) - { - int fieryDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f); + int fieryDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100, default, 0.7f); if (Main.rand.NextBool(4)) { Main.dust[fieryDust].scale *= 0.35f; @@ -45,11 +39,13 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[fieryDust].velocity *= 0f; } - Vector2 goreVec = Projectile.position; - if (Main.rand.NextBool(8) && !Main.dedServ) + + if (Main.rand.NextBool(9) && !Main.dedServ) { - int smoke = Gore.NewGore(Projectile.GetSource_FromAI(), goreVec, default, Main.rand.Next(375, 378), 0.75f); - Main.gore[smoke].behindTiles = true; + float upwardVariation = Main.rand.NextFloat(-4.5f, -8f); + MediumMistParticle mist = new MediumMistParticle(Projectile.position, -Projectile.velocity + new Vector2(0.5f, upwardVariation), // This velocity makes it slowly float upward + Main.rand.NextBool(3) ? Color.LightSteelBlue : Color.SteelBlue, Color.LightSlateGray, Main.rand.NextFloat(0.4f, 0.65f), 130); + GeneralParticleHandler.SpawnParticle(mist); } } diff --git a/Projectiles/Typeless/JewelSpike.cs b/Projectiles/Typeless/JewelSpike.cs index a2de1dd804..aec3719911 100644 --- a/Projectiles/Typeless/JewelSpike.cs +++ b/Projectiles/Typeless/JewelSpike.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Typeless { if (Projectile.owner == Main.myPlayer) { - for (int index = 0; index < 3; ++index) + for (int index = 0; index < 2; ++index) { float SpeedX = -Projectile.velocity.X * Main.rand.NextFloat(0.4f, 0.7f) + Main.rand.NextFloat(-8f, 8f); float SpeedY = -Projectile.velocity.Y * Main.rand.NextFloat(0.4f, 0.7f) + Main.rand.NextFloat(-8f, 8f); diff --git a/Projectiles/Typeless/MagnusBeam.cs b/Projectiles/Typeless/MagnusBeam.cs index 3cb564ae69..627f636a66 100644 --- a/Projectiles/Typeless/MagnusBeam.cs +++ b/Projectiles/Typeless/MagnusBeam.cs @@ -117,15 +117,7 @@ namespace CalamityMod.Projectiles.Typeless Player player = Main.player[Projectile.owner]; player.statMana += 25; player.ManaEffect(25); - - int heal = (int)Math.Round(hit.Damage * 0.1); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), (int)Math.Round(hit.Damage * 0.1), 0.75f); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index 6a575b5809..2d922d6811 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -175,24 +175,7 @@ namespace CalamityMod.Projectiles.Typeless modifiers.SetCrit(); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if (Projectile.owner == Main.myPlayer && Owner.lifeSteal > 0f && !Owner.moonLeech && target.lifeMax > 5) - { - int healAmount = 10 * damageDone / Projectile.damage; //should always be around max, less if enemy has defense/DR - if (healAmount > BalancingConstants.LifeStealCap) - healAmount = BalancingConstants.LifeStealCap; - - if (healAmount > 0) - { - Owner.lifeSteal -= healAmount; - if (Owner.Calamity().omegaBlueAbyssalMadness) // Always crits during Abyssal Madness, this makes it have same lifesteal delay - Owner.lifeSteal += healAmount / 2; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ProjectileID.SpiritHeal, 0, 0f, Projectile.owner, Projectile.owner, healAmount); - } - } - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Owner.DoLifestealDirect(target, 10 * hit.Damage / Projectile.damage, 0.5f); public override bool PreDraw(ref Color lightColor) { 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/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..181ab8790b --- /dev/null +++ b/Projectiles/Typeless/VictideBarrier.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Armor.Victide; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.CalamityUtils; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideBarrier : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public static readonly SoundStyle ExplosionSound = new("CalamityMod/Sounds/Custom/BubblyBurst"); + + public static float ExplosionLifetime = 24f; + public static float MaxScale = 6f; + + public static float DashSpeed = 24f; // 24 tiles + public static float DashLifetime = 16f; + public static int DashSlamIFrames = 12; + private List NPCsHitBySlam = new List() { -1 }; + + public ref float ExplodeTimer => ref Projectile.ai[0]; + public ref float DashTimer => ref Projectile.ai[1]; + public ref float HealTimer => ref Projectile.ai[2]; + public Player Owner => Main.player[Projectile.owner]; + + public static Asset Shine; + public static Asset Explosion; + public override void Load() + { + Shine = ModContent.Request("CalamityMod/Particles/SemiCircularSmearSwipe"); + Explosion = ModContent.Request("CalamityMod/Particles/SoftRoundExplosion"); + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = (int)ExplosionLifetime; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Projectile.rotation = MathHelper.ToRadians(Main.GlobalTimeWrappedHourly * 36f); + + if (ExplodeTimer > 0f) + { + float scaleLevel = PiecewiseAnimation(ExplodeTimer / ExplosionLifetime, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) }); + Projectile.scale = MathHelper.Lerp(1f, MaxScale, scaleLevel); + Projectile.Opacity = MathF.Sin(MathHelper.PiOver2 + MathHelper.PiOver2 * ExplodeTimer / ExplosionLifetime); + + if (ExplodeTimer == 1f) + { + SoundEngine.PlaySound(ExplosionSound, Projectile.Center); + + for (int i = 0; i < 5; i++) + { + Vector2 velocity = (MathHelper.TwoPi * i / 5f).ToRotationVector2() * Main.rand.NextFloat(10f, 12f) * (i % 2 == 0 ? 0.88f : 1f); + Particle bub = new VelChangingSpark(Projectile.Center, velocity.RotatedByRandom(MathHelper.Pi / 10f), Vector2.UnitY * -6f, "CalamityMod/Particles/BloomRing", Main.rand.Next(36, 42 + 1), Main.rand.NextFloat(0.1f, 0.25f), Main.rand.NextBool(3) ? Color.HotPink : Color.Turquoise, Vector2.One, shrinkSpeed: 0.08f); + GeneralParticleHandler.SpawnParticle(bub); + } + } + + if (ExplodeTimer == 6f) + { + for (int i = 0; i < 8; i++) + { + Vector2 smokeVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(2.5f, 5.5f); + float smokeScale = Main.rand.NextFloat(1.6f, 2f); + Particle smoke = new HeavySmokeParticle(Projectile.Center, smokeVelocity, Color.PaleTurquoise, 18, smokeScale, 0.25f, Main.rand.NextFloat(-0.1f, 0.1f), true); + GeneralParticleHandler.SpawnParticle(smoke); + } + } + + ExplodeTimer++; + } + else if (DashTimer > 0f) + { + Owner.mount?.Dismount(Owner); + Owner.RemoveAllGrapplingHooks(); + + Owner.velocity = Projectile.velocity; + Owner.ChangeDir(Math.Sign(Projectile.velocity.X) <= 0 ? -1 : 1); + + // Move the player to the projectile, allowing them to bypass platforms (but not tiles) + Owner.Center = Projectile.Center; + + // Custom ram effect, similar to the one used in CalamityPlayerDashEffects + Rectangle hitArea = new Rectangle((int)(Owner.position.X + Owner.velocity.X * 0.5 - 4f), (int)(Owner.position.Y + Owner.velocity.Y * 0.5 - 4), Owner.width + 8, Owner.height + 8); + foreach (NPC n in Main.ActiveNPCs) + { + // Ignore critters with the Guide to Critter Companionship + if (Owner.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type]) + continue; + + if (!n.dontTakeDamage && !n.friendly && !NPCsHitBySlam.Contains(n.whoAmI)) + { + if (hitArea.Intersects(n.getRect()) && (n.noTileCollide || Owner.CanHit(n))) + { + Projectile.NewProjectile(Owner.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Owner.whoAmI, n.whoAmI); + Owner.GiveImmuneTimeForCollisionAttack(DashSlamIFrames); + NPCsHitBySlam.Add(n.whoAmI); + } + } + } + + // Dash trail effects + Color trailColor = Color.Lerp(Color.Cyan, Color.RoyalBlue, DashTimer / DashLifetime); + if (DashTimer % 2f == 1f) + { + Particle trail = new CustomSpark(Projectile.Center - Projectile.velocity * 2f, Projectile.velocity * 0.5f, "CalamityMod/Particles/ForwardSmear", false, 12, 0.2f, trailColor, new Vector2(1f, Main.rand.NextFloat(1.2f, 1.35f)), fadeIn: true, extraRotation: MathHelper.ToRadians(180f)); + GeneralParticleHandler.SpawnParticle(trail); + } + for (int direction = -1; direction <= 1; direction += 2) + { + Vector2 sidePos = Projectile.Center - Projectile.velocity * 2f + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver2 * direction) * Utils.Remap(DashTimer, 1f, DashLifetime, 48f, 24f); + Particle sideTrail = new CustomSpark(sidePos, Projectile.velocity * 0.5f, "CalamityMod/Particles/BloomCircle", false, 18, 0.3f, trailColor * 0.6f, new Vector2(1f, 2.5f), shrinkSpeed: 0.2f); + GeneralParticleHandler.SpawnParticle(sideTrail); + } + + DashTimer++; + } + else + { + // If the barrier set isn't on, unceremoniously disappear + if (!Owner.Calamity().victideBarrierSet || Owner.dead || !Owner.active) + { + Projectile.Kill(); + Owner.Calamity().victideBarrierHeal = 0; + return; + } + // Set to dash if cooldown is detected and also create an explosion in its place + if (Owner.HasCooldown(WardingWave.ID)) + { + DashTimer++; + Projectile.damage = (int)Owner.GetBestClassDamage().ApplyTo(VictideHeadBarrier.BarrierDamage); + Owner.Calamity().victideBarrierHeal = 0; + if (Projectile.owner == Main.myPlayer) + { + // Set dash velocity + Projectile.velocity = Owner.SafeDirectionTo(Main.MouseWorld) * DashSpeed; + Projectile.tileCollide = true; + + // Spawn explosion + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.MountedCenter, Vector2.Zero, Type, Projectile.damage, VictideHeadBarrier.BarrierExplosionKB, Projectile.owner, 1f); + } + } + + if (Owner.Calamity().victideBarrierHeal > 0) + { + HealTimer++; + if (HealTimer % 10f == 9f) + { + Owner.Calamity().victideBarrierHeal--; + Owner.HealPlayer(1); + } + } + else + HealTimer = 0f; + + Lighting.AddLight(Owner.MountedCenter, Color.White.ToVector3() * 0.5f); + Projectile.Center = Owner.MountedCenter; + Projectile.timeLeft = (int)DashLifetime; + } + } + + public override void OnKill(int timeLeft) + { + if (DashTimer > 0f) + Owner.velocity *= 0.5f; + } + + // Explosion collision only (dash has a custom ram logic check effect) + public override bool? CanDamage() => ExplodeTimer > 0f ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 20f * Projectile.scale, targetHitbox); + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + modifiers.SourceDamage *= Utils.Remap(Projectile.numHits, 0, 10, 1f, 0.1f, true); + } + + public override bool PreDraw(ref Color lightColor) + { + if (DashTimer > 0f) + return false; + + Texture2D explosionTex = Explosion.Value; + Color barrierColor = Main.hslToRgb(0.6f + 0.1f * MathF.Sin(Main.GlobalTimeWrappedHourly * 2f), 1f, 0.5f); + + if (ExplodeTimer > 0f) + { + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Vector2 explosionPos = Projectile.Center - Main.screenPosition; + Main.EntitySpriteDraw(explosionTex, explosionPos, null, barrierColor * Projectile.Opacity, Projectile.rotation, explosionTex.Size() * 0.5f, 0.02f * Projectile.scale, SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + return false; + } + + Vector2 drawPos = Owner.Center + Vector2.UnitY * Owner.gfxOffY - Main.screenPosition; + Texture2D circleBase = TextureAssets.Projectile[Type].Value; + Color contrastingColor = Main.hslToRgb(0.6f + 0.1f * MathF.Cos(Main.GlobalTimeWrappedHourly * 2f), 1f, 0.5f); + + // Silly solution to making a clean circle over the player + Main.spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseOpacity(0.5f); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseColor(barrierColor); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseSecondaryColor(Color.Transparent); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseSaturation(0f); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].Apply(); + + Main.EntitySpriteDraw(circleBase, drawPos, null, Color.White, 0f, circleBase.Size() * 0.5f, 80f, SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + + // Give it additional texture + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Main.EntitySpriteDraw(explosionTex, drawPos, null, contrastingColor * 0.3f, Projectile.rotation, explosionTex.Size() * 0.5f, 0.04f, SpriteEffects.None); + Texture2D shineTex = Shine.Value; + Main.EntitySpriteDraw(shineTex, drawPos, null, Color.HotPink * 0.5f, MathHelper.ToRadians(36f), shineTex.Size() * 0.5f, 0.45f, SpriteEffects.None); + Main.EntitySpriteDraw(shineTex, drawPos, null, Color.Orange * 0.3f, MathHelper.ToRadians(216f), shineTex.Size() * 0.5f, 0.55f, SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + return false; + } + } +} diff --git a/Projectiles/Typeless/VictideBobber.cs b/Projectiles/Typeless/VictideBobber.cs new file mode 100644 index 0000000000..8c9c4113de --- /dev/null +++ b/Projectiles/Typeless/VictideBobber.cs @@ -0,0 +1,179 @@ +using System; +using CalamityMod.Items; +using CalamityMod.Items.SummonItems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideBobber : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/Summon/CnidarianJellyfishOnTheString"; + + public Player Owner => Main.player[Projectile.owner]; + public ref float ParentProjectile => ref Projectile.ai[2]; + public Projectile Parent => Main.projectile[(int)ParentProjectile]; + + public int stuckTimer; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.aiStyle = ProjAIStyleID.Bobber; + Projectile.bobber = true; + } + + public override bool PreAI() + { + // Snap if the snail is shelled, or just nowhere to be found + if (!Parent.active || Owner.ActiveItem().fishingPole <= 0 || Parent == null || Parent.frame < 6) + { + Projectile.Kill(); + return false; + } + return true; + } + + public override void AI() + { + // Automatic reeling + if (Projectile.ai[0] == 0f && Projectile.ai[1] < 0f && Main.rand.NextBool(40)) + { + Projectile.ai[0] = 1f; + Projectile.localAI[0] = 1f; + + // Consume bait as needed + int baitType = Owner.GetFishingConditions().BaitItemType; + int baitSlot = GetBaitSlot(Owner, baitType); + if (baitSlot != -1) + { + Item currentBait = Owner.inventory[baitSlot]; + bool consume = false; + + if (baitType == ItemID.TruffleWorm) + consume = true; + else if (baitType == ItemID.GoldWorm) + consume = Main.rand.NextBool(20); + else + { + float chanceMult = MathF.Max(1f, 1f + currentBait.bait / 6f); + if (Owner.accTackleBox) + chanceMult += 1f; + if (Main.rand.NextFloat() * chanceMult < 1f) + consume = true; + + // Junk (or Quest fish) default to no bait consumption + if (Projectile.localAI[1] > 0f) + { + Item dummyCatch = new Item(); + dummyCatch.SetDefaults((int)Projectile.localAI[1]); + if (dummyCatch.rare < 0) + consume = false; + } + } + if (CombinedHooks.CanConsumeBait(Owner, currentBait).GetValueOrDefault(consume)) + { + if (currentBait.type == ItemID.LadyBug || currentBait.type == ItemID.GoldLadyBug) + NPC.LadyBugKilled(Owner.Center, currentBait.type == ItemID.GoldLadyBug); + + currentBait.stack--; + if (currentBait.stack <= 0) + currentBait.SetDefaults(); + } + } + + // Summon Duke Fishron as this code otherwise only runs on player rod usage + if (baitType == ItemID.TruffleWorm) + { + Projectile.ai[0] = 2f; + CalamityUtils.SpawnBossUsingItem(Owner, NPCID.DukeFishron); + } + // Line snapping behaviour + else if (!Owner.accFishingLine && Main.rand.NextBool(7)) + Projectile.ai[0] = 2f; + // Return back items + else if (Projectile.localAI[1] > 0f) + { + Projectile.ai[1] = Projectile.localAI[1]; + Projectile.localAI[1] = 0f; + } + // Spawn enemies + else if (Projectile.localAI[1] < 0f) + { + int spawnType = (int)(-Projectile.localAI[1]); + Point spawnPos = new Point((int)Projectile.position.X, (int)Projectile.position.Y); + if (spawnType == NPCID.BloodNautilus) + spawnPos.Y += 64; + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendData(MessageID.FishOutNPC, -1, -1, null, spawnPos.X / 16, spawnPos.Y / 16, spawnType); + else + { + Projectile.ai[0] = 2f; + NPC.NewNPC(new EntitySource_FishedOut(Owner), spawnPos.X, spawnPos.Y, spawnType); + + if (spawnType == NPCID.TownSlimeRed) + NPC.unlockedSlimeRedSpawn = true; + WorldGen.CheckAchievement_RealEstateAndTownSlimes(); + } + } + } + + // Anti-stuck auto reelback + if (Projectile.ai[0] == 0f && Projectile.localAI[1] == 0f && Projectile.velocity.Length() <= 0.2f) + { + stuckTimer++; + if (stuckTimer > 60) + Projectile.ai[0] = 1f; + } + } + + public static int GetBaitSlot(Player owner, int baitType) + { + // Ignore Bloodworm as the Old Duke summon method already manually consumes it + if (baitType == ModContent.ItemType()) + return -1; + + // Check ammo slots first + for (int i = 54; i < Main.InventorySlotsTotal; i++) + { + if (owner.inventory[i].type == baitType) + return i; + } + for (int j = 0; j < 54; j++) + { + if (owner.inventory[j].type == baitType) + return j; + } + return -1; + } + + // Anchor the bobber to the parent projectile, since the default is bound to the player + // Yes. This method is obsolete. No, there is no other way and I won't make another IL edit to remedy this fact. - Iris + public override void ModifyFishingLine(ref Vector2 lineOriginOffset, ref Color lineColor) + { + lineColor = Color.Cyan; + if (Parent.active) + { + Vector2 originalPos = Owner.MountedCenter + Vector2.UnitY * (Owner.gfxOffY - (Owner.gravDir == -1 ? 12f : 0f)); + lineOriginOffset = Parent.Center - originalPos + Vector2.UnitY * 13f; + + // How this is a thing is beyond me + lineOriginOffset.X -= 2f; + if (Owner.direction < 0) + lineOriginOffset.X += (Owner.MountedCenter.X - Parent.Center.X) * 2f; + } + } + + public override bool PreDrawExtras() + { + Lighting.AddLight(Projectile.Center, 0f, 0.2f, 0.2f); + return true; + } + } +} diff --git a/Projectiles/Typeless/VictideSeaSnail.cs b/Projectiles/Typeless/VictideSeaSnail.cs new file mode 100644 index 0000000000..94282c071c --- /dev/null +++ b/Projectiles/Typeless/VictideSeaSnail.cs @@ -0,0 +1,264 @@ +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideSeaSnail : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public ref float DustTimer => ref Projectile.localAI[0]; + public ref float CollisionTimer => ref Projectile.ai[0]; + public ref float PlayerStandStillTimer => ref Projectile.ai[1]; + public ref float PlayerFishingTimer => ref Projectile.ai[2]; + + public const int FrameTime = 6; // Switches frame every 6 frames (10 FPS) + public const int PeekCooldown = 150; + + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + + // Extra requirements so you don't break the bobber, or snail, or how would you fish underwater?? + public bool StandingStill => Owner.velocity.Length() == 0 && !Owner.pulley && !Owner.mount.Active && !Collision.DrownCollision(Owner.position, Owner.width, Owner.height, Owner.gravDir); + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } + + public override void SetDefaults() + { + Projectile.width = 38; + Projectile.height = 34; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + } + + public override void AI() + { + if (!ModdedOwner.victideSnailSet) + { + for (int d = 0; d < 25; d++) + { + Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); + dust.velocity *= 2f; + dust.scale *= 1.15f; + } + Projectile.active = false; + return; + } + + if (Owner.dead) + ModdedOwner.victideSnail = false; + + if (ModdedOwner.victideSnail) + Projectile.timeLeft = 2; + + //Create a burst of dust as it gets created, teleported, or popped out + DustTimer++; + if (DustTimer <= 3) + { + for (int d = 0; d < 25; d++) + { + Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); + dust.velocity *= 2f; + dust.scale *= 1.15f; + } + } + + // Small amount of light + Lighting.AddLight(Projectile.Center, 0.5f, 0.25f, 0.5f); + + if (StandingStill) + { + PlayerStandStillTimer++; + if (PlayerStandStillTimer >= PeekCooldown) + { + // Pop out the shell when ready. This give a slight velocity boost outwards + if (PlayerStandStillTimer == PeekCooldown) + { + DustTimer = 0f; + Projectile.velocity = new Vector2(Main.rand.NextFloat(2f, 3.6f) * Owner.direction, Main.rand.NextFloat(-4f, 0f)); + } + + // Fall down into position + Projectile.velocity *= 0.98f; + Projectile.velocity.X *= 0.9f; + Projectile.velocity.Y = Math.Min(Projectile.velocity.Y + 0.1f, 14f); + Projectile.tileCollide = true; + + bool? collide = CollidingWithLiquidOrPlatform(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); + if (collide.HasValue) + { + CollisionTimer++; + // Bobs up and down if collided with liquids + Projectile.velocity.Y = collide.Value ? MathF.Sin(CollisionTimer * 0.05f) * 0.25f : 0f; + } + + Projectile.rotation = Projectile.rotation.AngleTowards(0, MathHelper.PiOver4 * 0.14f); + + if (CollisionTimer > 0f) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= FrameTime) + { + Projectile.frameCounter = 0; + Projectile.frame = Math.Min(6, Projectile.frame + 1); + } + } + } + else // keep this guy spinnin' + Projectile.rotation += MathHelper.PiOver4 * 0.2f; + } + else + { + // Slowly puts its head back into shell + if (Projectile.frame > 0) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= FrameTime) + { + Projectile.frameCounter = 0; + Projectile.frame--; + } + + if (Projectile.frame == 0) + { + CollisionTimer = 0f; + PlayerStandStillTimer = 0f; + PlayerFishingTimer = 0f; + } + } + // Return to resting position once shelled again + else + { + Projectile.velocity = Vector2.Zero; + Projectile.tileCollide = false; + + Vector2 desiredPosition = Owner.Center + Vector2.UnitY * (Owner.gfxOffY - 60f) * Owner.gravDir; + //Round the result so it doesn't jitter. + desiredPosition = new Vector2((int)desiredPosition.X, (int)desiredPosition.Y); + Projectile.Center = Projectile.Center.MoveTowards(desiredPosition, 7f + Owner.velocity.Length()); + Projectile.rotation += MathHelper.PiOver4 * 0.2f; + } + } + + // Teleport and reset everything if too far away (this range is deliberately very short) + if (Vector2.Distance(Projectile.Center, Owner.Center) > 240f) + { + Projectile.Center = Owner.Center + Vector2.UnitY * (Owner.gfxOffY - 60f) * Owner.gravDir; + DustTimer = 0f; + CollisionTimer = 0f; + PlayerStandStillTimer = 0f; + PlayerFishingTimer = 0f; + Projectile.frame = 0; + return; + } + + // Only does fishing stuff when it's fully popped out + if (Projectile.frame == 6) + { + // Give the player a grace period upon any input with the fishing rod + // This means you can't just AFK with the fishing rod held + if (Owner.itemAnimation > 0 && Owner.ActiveItem().fishingPole > 0) + PlayerFishingTimer = 600f; + else + PlayerFishingTimer = Math.Max(PlayerFishingTimer -1f, 0f); + + // Automatically casts bobbers one at a time + // This casts the same way the pole does to prevent position variance + int bobberType = ModContent.ProjectileType(); + if (Owner.ownedProjectileCounts[bobberType] < 1 && Owner.ActiveItem().fishingPole > 0 && Projectile.owner == Main.myPlayer && PlayerFishingTimer > 0f) + { + SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); + + Vector2 velocity = Owner.SafeDirectionTo(Main.MouseWorld) * Owner.ActiveItem().shootSpeed; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, bobberType, 0, 0f, Projectile.owner, ai2: Projectile.whoAmI); + } + } + } + + public static bool? CollidingWithLiquidOrPlatform(Vector2 Position, Vector2 Velocity, int Width, int Height) + { + Rectangle Hitbox = new Rectangle((int)Position.X, (int)Position.Y, Width, Height); + Rectangle ProjectedHitbox = new Rectangle((int)(Position.X + Velocity.X), (int)(Position.Y + Velocity.Y), Width, Height); + + int xMin = Utils.Clamp((int)(Position.X / 16f) - 1, 0, Main.maxTilesX - 1); + int xMax = Utils.Clamp((int)((Position.X + (float)Width) / 16f) + 2, 0, Main.maxTilesX - 1); + int yMin = Utils.Clamp((int)(Position.Y / 16f) - 1, 0, Main.maxTilesY - 1); + int yMax = Utils.Clamp((int)((Position.Y + (float)Height) / 16f) + 2, 0, Main.maxTilesY - 1); + for (int i = xMin; i < xMax; i++) + { + for (int j = yMin; j < yMax; j++) + { + Tile tile = Main.tile[i, j]; + if (tile == null) + return null; + + if (tile.HasTile && (Main.tileSolid[tile.TileType] || Main.tileSolidTop[tile.TileType])) + { + Rectangle Target = new Rectangle(i * 16, j * 16 , 16, 16); + if (Hitbox.Intersects(Target) || ProjectedHitbox.Intersects(Target)) + return false; + } + if (tile.LiquidAmount > 0 && !tile.HasTile) + { + float LiquidDepth = (256 - tile.LiquidAmount) / 16f; + Rectangle Target = new Rectangle(i * 16, j * 16 + (int)LiquidDepth, 16, 16 - (int)LiquidDepth); + if (Hitbox.Intersects(Target)) + return true; + } + } + } + return null; + } + + public override bool? CanDamage() => false; + + public override void OnKill(int timeLeft) + { + for (int d = 0; d < 45; d++) + { + Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); + dust.velocity *= 2f; + dust.scale *= 1.15f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + // Touches the ground + if (oldVelocity.Y >= 0) + CollisionTimer = 1f; + return false; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + bool CanPeekOut = PlayerStandStillTimer >= PeekCooldown || Projectile.frame > 0; + Vector2 origin = !CanPeekOut ? new Vector2(15, 23) : frame.Size() * 0.5f; + + // Look at the player's direction + SpriteEffects flip = Owner.direction < 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.EntitySpriteDraw(tex, Projectile.Center + Vector2.UnitY * 2f - Main.screenPosition, frame, lightColor, Projectile.rotation, origin, Projectile.scale, flip); + + // Fisbing Rod,,. + if (Owner.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + Texture2D rod = Terraria.GameContent.TextureAssets.Item[ModContent.ItemType()].Value; + Main.EntitySpriteDraw(rod, Projectile.Center - Main.screenPosition + Vector2.UnitX * Owner.direction * 30f, null, lightColor, 0f, rod.Size() * 0.5f, Projectile.scale, flip); + } + return false; + } + } +} diff --git a/Projectiles/Summon/VictideSeaSnail.png b/Projectiles/Typeless/VictideSeaSnail.png similarity index 100% rename from Projectiles/Summon/VictideSeaSnail.png rename to Projectiles/Typeless/VictideSeaSnail.png diff --git a/Projectiles/Typeless/VictideSpirit.cs b/Projectiles/Typeless/VictideSpirit.cs new file mode 100644 index 0000000000..3b6ea32a18 --- /dev/null +++ b/Projectiles/Typeless/VictideSpirit.cs @@ -0,0 +1,319 @@ +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Armor.Victide; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideSpirit : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + + public static Asset GlowTexture; + + public ref float SubmergedTimer => ref Projectile.ai[0]; + public ref float DustCounter => ref Projectile.ai[1]; + + public override void Load() => GlowTexture = ModContent.Request("CalamityMod/Particles/BloomCircle"); + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 42; + Projectile.friendly = true; + Projectile.tileCollide = false; + } + + public override void OnSpawn(IEntitySource source) + { + Projectile.rotation = MathHelper.PiOver2; + for (int i = 0; i < Projectile.oldPos.Length; i++) + Projectile.oldRot[i] = MathHelper.PiOver2; + + for (int i = 0; i < 3; i++) + { + Color squareColor = Color.Lerp(Color.Cyan, Color.RoyalBlue, i * 0.5f) * 0.6f; + float squareScale = 0.6f + i * 0.2f; + float squareRot = (i % 2 == 0 ? MathHelper.PiOver4 : 0f); + Particle square = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/GlowSquareParticleThick", false, 18, squareScale, squareColor, Vector2.One, true, true, squareRot, true, glowOpacity: 0.5f, glowCenterScale: squareScale * 1.15f); + GeneralParticleHandler.SpawnParticle(square); + } + } + + public override void AI() + { + if (Main.myPlayer == Projectile.owner) + { + // Validate existence + bool hasCD = Owner.Calamity().cooldowns.TryGetValue(BubblyBurrow.ID, out CooldownInstance cd); + if (!hasCD) + { + Owner.AddCooldown(BubblyBurrow.ID, VictideHeadBurrow.BurrowCooldown); + Projectile.Kill(); + return; + } + else if (!Owner.Calamity().victideBurrowSet) + { + cd.timeLeft = VictideHeadBurrow.BurrowCooldown; + Projectile.Kill(); + return; + } + else if (cd.timeLeft <= VictideHeadBurrow.BurrowCooldown) + { + Projectile.Kill(); + return; + } + // Shimmer interaction (Immediately ends if Chromatic Cloak isn't active) + else if (Owner.shimmering) + { + cd.timeLeft = VictideHeadBurrow.BurrowCooldown; + Projectile.Kill(); + return; + } + Projectile.timeLeft = cd.timeLeft - VictideHeadBurrow.BurrowCooldown; + + #region Movement and Controls + float MaxSpeed = Collision.DrownCollision(Projectile.Center - Vector2.One, 2, 2, Owner.gravDir) ? VictideHeadBurrow.SubmergedBurrowSpeed : VictideHeadBurrow.BaseBurrowSpeed; + // Controlling both opposite movement keys brings you to a near immediate stop (faster deceleration than just releasing both buttons) + // Turnaround acceleration is also twice as fast to aid smoothness of movement + if (Owner.controlLeft && Owner.controlRight) + Projectile.velocity.X *= 0.7f; + else if (Owner.controlLeft) + { + if (Projectile.velocity.X < -MaxSpeed) + { + Projectile.velocity.X = MathHelper.Lerp(Projectile.velocity.X, MaxSpeed, 0.05f); + if (Projectile.velocity.X > -MaxSpeed - 0.01f) + Projectile.velocity.X = -MaxSpeed; + } + else if (Projectile.velocity.X > 0f) + Projectile.velocity.X -= VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.X = MathF.Max(Projectile.velocity.X - VictideHeadBurrow.BaseAcceleration, -MaxSpeed); + } + else if (Owner.controlRight) + { + if (Projectile.velocity.X > MaxSpeed) + { + Projectile.velocity.X = MathHelper.Lerp(Projectile.velocity.X, MaxSpeed, 0.05f); + if (Projectile.velocity.X < MaxSpeed + 0.01f) + Projectile.velocity.X = MaxSpeed; + } + else if (Projectile.velocity.X < 0f) + Projectile.velocity.X += VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.X = MathF.Min(Projectile.velocity.X + VictideHeadBurrow.BaseAcceleration, MaxSpeed); + } + else + Projectile.velocity.X *= 0.92f; + + if ((Owner.controlUp || Owner.controlJump) && Owner.controlDown) + Projectile.velocity.Y *= 0.7f; + else if (Owner.controlUp || Owner.controlJump) + { + if (Projectile.velocity.Y < -MaxSpeed) + { + Projectile.velocity.Y = MathHelper.Lerp(Projectile.velocity.Y, MaxSpeed, 0.05f); + if (Projectile.velocity.Y > -MaxSpeed - 0.01f) + Projectile.velocity.Y = -MaxSpeed; + } + else if (Projectile.velocity.Y > 0f) + Projectile.velocity.Y -= VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.Y = MathF.Max(Projectile.velocity.Y - VictideHeadBurrow.BaseAcceleration, -MaxSpeed); + } + else if (Owner.controlDown) + { + if (Projectile.velocity.Y > MaxSpeed) + { + Projectile.velocity.Y = MathHelper.Lerp(Projectile.velocity.Y, MaxSpeed, 0.05f); + if (Projectile.velocity.Y < MaxSpeed + 0.01f) + Projectile.velocity.Y = MaxSpeed; + } + else if (Projectile.velocity.Y < 0f) + Projectile.velocity.Y += VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.Y = MathF.Min(Projectile.velocity.Y + VictideHeadBurrow.BaseAcceleration, MaxSpeed); + } + else + Projectile.velocity.Y *= 0.92f; + + // Rotation is less sudden so that the visuals are smoother -- velocity is not affected so that it also plays natural + float idealRotation = (Projectile.velocity.Length() == 0f ? MathHelper.PiOver2 : Projectile.velocity.ToRotation()); + if (MathF.Abs(idealRotation - Projectile.rotation) < MathHelper.ToRadians(1f) || MathF.Abs(idealRotation - Projectile.rotation) > MathHelper.ToRadians(90f)) + Projectile.rotation = idealRotation; + else + Projectile.rotation = MathHelper.Lerp(Projectile.rotation, idealRotation, 0.25f); + #endregion + + #region Player Manipulation + // Actively remove mounts and hooks from the player + Owner.mount?.Dismount(Owner); + Owner.RemoveAllGrapplingHooks(); + + // Give immunity frames and kill suffocation + Owner.suffocateDelay = 0; + Owner.immune = true; + Owner.immuneNoBlink = true; + Owner.immuneTime = 4; + for (int k = 0; k < Owner.hurtCooldowns.Length; k++) + { + // Excluded explicitly-anti cheesed bosses + if (k == ImmunityCooldownID.Bosses) + continue; + + Owner.hurtCooldowns[k] = Owner.immuneTime; + } + + Owner.velocity = Projectile.velocity; + if (Owner.velocity.Y == 0f) + Owner.velocity.Y += 0.00001f; // Prevent sprint particles from appearing + Owner.ChangeDir((Projectile.velocity.X > 0).ToDirectionInt()); + Projectile.direction = Owner.direction; + + // Move the player to the projectile, allowing them to bypass all tiles + Owner.Center = Projectile.Center; + #endregion + } + + #region Visual and Sound Effects + if (Collision.DrownCollision(Projectile.Center - Vector2.One, 2, 2, Owner.gravDir)) + SubmergedTimer++; + else + SubmergedTimer = 0f; + + Color BubblyBlue = new Color(97, 200, 255); + Vector2 headPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitY) * 8f; + Lighting.AddLight(headPosition, BubblyBlue.ToVector3() * Projectile.Opacity * (0.5f + 0.3f * Utils.GetLerpValue(0f, 60f, SubmergedTimer, true))); + + if (SubmergedTimer == 1f) + { + Particle ring = new DirectionalPulseRing(headPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * 0.4f, BubblyBlue, new Vector2(0.5f, 1f), Projectile.rotation, 0.95f, 0f, 30); + GeneralParticleHandler.SpawnParticle(ring); + } + + float lifetimeRatio = Projectile.timeLeft / (float)VictideHeadBurrow.BurrowCooldown; + if (Projectile.soundDelay <= 0) + { + Projectile.soundDelay = Main.rand.Next(20, 36) + (int)(lifetimeRatio * 30); + SoundEngine.PlaySound(Main.rand.NextBool() ? SoundID.ShimmerWeak1 : SoundID.ShimmerWeak2, Projectile.Center); + } + + if ((Main.rand.NextBool(4) || Projectile.velocity.Length() > 0.25f) && SubmergedTimer == 0f) + { + Particle foam = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.7f, "CalamityMod/Particles/WaterFoam", false, 9, 0.25f, Color.DeepSkyBlue, Vector2.One, extraRotation: Main.rand.NextFloat(0, MathHelper.TwoPi), shrinkSpeed: 1f); + GeneralParticleHandler.SpawnParticle(foam); + } + + DustCounter += Utils.Remap(Projectile.velocity.Length(), 0f, VictideHeadBurrow.BaseBurrowSpeed, 1f, 3f, true); + if (DustCounter >= 15f) + { + DustCounter = 0f; + for (int i = 0; i < 2; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), Projectile.rotation.ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(-4.8f, -6f)); + dust.noGravity = false; + dust.scale = Main.rand.NextFloat(0.65f, 0.8f); + dust.color = Color.White; + dust.noLightEmittence = true; + } + } + #endregion + } + + public float JetstreamWidthFunction(float completionRatio) => Utils.GetLerpValue(1f, 0.8f, completionRatio, true) * 3f; + public float SpiritWidthFunction(float completionRatio) => MathF.Min(MathHelper.SmoothStep(64f, 8f, completionRatio), Utils.GetLerpValue(0f, 0.15f, completionRatio, true) * 60f); + + public Color InnerJetstreamColorFunction(float completionRatio) => Color.Lerp(Color.CornflowerBlue, new Color(169, 100, 237), MathF.Pow(completionRatio, 2.5f)) * Utils.GetLerpValue(1f, 0.6f, completionRatio, true) * 0.5f; + public Color OuterJetstreamColorFunction(float completionRatio) => Color.Lerp(Color.CornflowerBlue, new Color(100, 237, 237), MathF.Pow(completionRatio, 2.5f)) * Utils.GetLerpValue(1f, 0.6f, completionRatio, true) * 0.2f; + public Color SpiritColorFunction(float completionRatio) => Color.Lerp(Color.Lerp(Color.White, Color.Cyan, 0.4f + completionRatio), Color.RoyalBlue, completionRatio) * Utils.GetLerpValue(0.8f, 0.54f, completionRatio, true); + + public override bool PreDraw(ref Color lightColor) + { + // Jetstream trails + for (int direction = -1; direction <= 1; direction += 2) + { + List trailPositionsInner = new List(); + List trailPositionsOuter = new List(); + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + float mergeFactor = Utils.Remap(i, 0f, 8f, 0f, 1f, true); + + Vector2 trailPosInner = Projectile.Center - Projectile.oldRot[i].ToRotationVector2() * i * 8f; + float spreadLengthInner = 20f * MathF.Sin(Main.GlobalTimeWrappedHourly * 5f); + Vector2 sinOffsetInner = (Vector2.UnitY * direction * MathF.Sin(i * MathHelper.Pi * 0.125f) * spreadLengthInner * mergeFactor).RotatedBy(Projectile.oldRot[i]); + trailPositionsInner.Add(trailPosInner + sinOffsetInner); + + Vector2 trailPosOuter = Projectile.Center - Projectile.oldRot[i].ToRotationVector2() * i * 12f; + float spreadLengthOuter = 32f * MathF.Sin(Main.GlobalTimeWrappedHourly * 2f); + Vector2 sinOffsetOuter = (Vector2.UnitY * direction * (6f + MathF.Sin(i * MathHelper.Pi * 0.035f) * spreadLengthOuter * mergeFactor)).RotatedBy(Projectile.oldRot[i]); + trailPositionsOuter.Add(trailPosOuter + sinOffsetOuter); + } + + PrimitiveRenderer.RenderTrail(trailPositionsInner, new(JetstreamWidthFunction, InnerJetstreamColorFunction), 20); + PrimitiveRenderer.RenderTrail(trailPositionsOuter, new(JetstreamWidthFunction, OuterJetstreamColorFunction), 20); + } + + // Oops all trails? + List spiritBodyPositions = new List(); + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + // 3 segments ahead so that it's a little offset forward + Vector2 spiritPos = Projectile.Center - Projectile.oldRot[i].ToRotationVector2() * (i - 3) * 8f; + spiritBodyPositions.Add(spiritPos); + } + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); + PrimitiveRenderer.RenderTrail(spiritBodyPositions, new(SpiritWidthFunction, SpiritColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 60); + + // Glow pulses when the ability is about to run out + if (Projectile.timeLeft < 180) + { + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Texture2D glow = GlowTexture.Value; + Vector2 drawPos = Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; + Color glowColor = new Color(255, 170, 204) * (0.2f * MathF.Sin(Projectile.timeLeft * MathHelper.Pi * 0.25f) + Utils.Remap(Projectile.timeLeft, 180f, 0f, 0.2f, 0.6f, true)); + Main.EntitySpriteDraw(glow, drawPos, null, glowColor, Projectile.rotation, glow.Size() * 0.5f, new Vector2(0.6f, 0.5f), SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + } + return false; + } + + public override bool? CanDamage() => false; + + public override void OnKill(int timeLeft) + { + Owner.velocity *= 0.8f; + Owner.fullRotation = 0f; + + SoundEngine.PlaySound(SoundID.Drown, Projectile.Center); + for (int i = 0; i < 3; i++) + { + Color squareColor = Color.Lerp(Color.Cyan, new Color(255, 170, 204), i * 0.5f) * 0.6f; + float squareScale = 0.6f + i * 0.2f; + float squareRot = (i % 2 == 0 ? MathHelper.PiOver4 : 0f); + Particle square = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/GlowSquareParticleThick", false, 18, squareScale, squareColor, Vector2.One, true, true, squareRot, true, glowOpacity: 0.5f, glowCenterScale: squareScale * 1.15f); + GeneralParticleHandler.SpawnParticle(square); + } + } + } +} diff --git a/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/Typeless/WulfrumHook.cs b/Projectiles/Typeless/WulfrumHook.cs index 448039accf..325ba40a75 100644 --- a/Projectiles/Typeless/WulfrumHook.cs +++ b/Projectiles/Typeless/WulfrumHook.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Typeless Tile tile = Main.tile[tilePos]; - if (!tile.HasUnactuatedTile || !tile.CanTileBeLatchedOnTo(EquippedHook == ItemID.SquirrelHook) || Owner.IsBlacklistedForGrappling(tilePos)) + if (!tile.HasUnactuatedTile || !tile.CanTileBeLatchedOnTo(EquippedHook == ItemID.SquirrelHook && Projectile.Distance(Owner.Center) > 96) || Owner.IsBlacklistedForGrappling(tilePos)) continue; if (Main.myPlayer != Owner.whoAmI) continue; @@ -172,9 +172,15 @@ namespace CalamityMod.Projectiles.Typeless public void OnGrapple(Vector2 grapplePos, int x, int y) { WulfrumPackPlayer mp = Owner.GetModPlayer(); - //Clear previous grapple - if (mp.Grapple > -1 && Main.projectile[mp.Grapple].active && Main.projectile[mp.Grapple].ModProjectile is WulfrumHook hook && hook.State == WulfrumHook.HookState.Grappling) - Main.projectile[mp.Grapple].Kill(); + //Clear all grapples + Owner.ClearGrapplingBlacklist(); + Owner.grappling[0] = -1; + Owner.grapCount = 0; + for (int i = 0; i < 1000; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Owner.whoAmI && Main.projectile[i].aiStyle == 7 && !(Main.projectile[i].whoAmI == Projectile.whoAmI)) + Main.projectile[i].Kill(); + } //Hook onto the tile Projectile.velocity = Vector2.Zero; @@ -190,7 +196,6 @@ namespace CalamityMod.Projectiles.Typeless { Owner.grappling[Owner.grapCount] = Projectile.whoAmI; Owner.grapCount++; - //Owner.velocity = Vector2.Zero; } if (EquippedHook == ItemID.QueenSlimeHook) Owner.DoQueenSlimeHookTeleport(grapplePos + new Vector2(-(Owner.Center - Projectile.Center).Length() * 0.75f, 0).RotatedBy(Projectile.DirectionTo(Owner.Center).ToRotation())); diff --git a/Projectiles/Typeless/XykWings.cs b/Projectiles/Typeless/XykWings.cs index 191990362d..a602acf9bd 100644 --- a/Projectiles/Typeless/XykWings.cs +++ b/Projectiles/Typeless/XykWings.cs @@ -52,6 +52,9 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + if (!BreakApart) + lastDir = Owner.direction; + float intendedScale = 0.85f; float spawnAnimTime = 12 + wingNum; if (time == 0) @@ -266,9 +269,6 @@ namespace CalamityMod.Projectiles.Typeless } public override bool PreDraw(ref Color lightColor) { - if (!BreakApart) - lastDir = Owner.direction; - float topWingNum = (checkActiveWings() - 1); float width = 1; float height = 1; diff --git a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs index b79ed81667..16c95c9c77 100644 --- a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides private static float EnemyDistanceDetection { get => Target is null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection; } - private const int FireRate = 75; + private const int FireRate = 60; private const float ProjectileVelocity = 20f; private static NPC Target { get; set; } @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides shootTimer += Main.rand.NextBool(20) ? 2 : 1; if (shootTimer >= FireRate && proj.owner == Main.myPlayer) { - Vector2 toTargetDirection = CalamityUtils.CalculatePredictiveAimToTarget(proj.Center, Target, ProjectileVelocity); + Vector2 toTargetDirection = Utils.DirectionTo(proj.Center, Target.Center) * ProjectileVelocity; Projectile fireball = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), proj.Center, 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/BurnishedAuric.cs b/Rarities/BurnishedAuric.cs index f6f1d78c8e..fd88890cf7 100644 --- a/Rarities/BurnishedAuric.cs +++ b/Rarities/BurnishedAuric.cs @@ -118,13 +118,14 @@ namespace CalamityMod.Rarities Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); } - public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch { -2 => ModContent.RarityType(), -1 => ModContent.RarityType(), 1 => ModContent.RarityType(), 2 => ModContent.RarityType(), _ => Type, - }; + };*/ } } diff --git a/Rarities/CalamityRed.cs b/Rarities/CalamityRed.cs index 19bb2986e1..d952117f9a 100644 --- a/Rarities/CalamityRed.cs +++ b/Rarities/CalamityRed.cs @@ -126,11 +126,12 @@ namespace CalamityMod.Rarities Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); } - public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch { -2 => ModContent.RarityType(), -1 => ModContent.RarityType(), _ => Type, - }; + };*/ } } 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/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 9227f5866d..a30636dfdc 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -104,13 +104,15 @@ namespace CalamityMod.Rarities { Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); } - public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch { -2 => ModContent.RarityType(), -1 => ModContent.RarityType(), 1 => ModContent.RarityType(), 2 => ModContent.RarityType(), _ => Type, - }; + };*/ } } 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 c9689876c6..70fb82de7f 100644 --- a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs +++ b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs @@ -1,6 +1,7 @@ using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,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 || Main.getGoodWorld; + return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode; } } } 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/BulletHellEnd.ogg b/Sounds/Custom/CalamitasClone/BulletHellEnd.ogg index 08b4e36553..99e29dd7d2 100644 Binary files a/Sounds/Custom/CalamitasClone/BulletHellEnd.ogg and b/Sounds/Custom/CalamitasClone/BulletHellEnd.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 3f54027802..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/GFB/SevenTrebleClefSouls.ogg b/Sounds/Custom/GFB/SevenTrebleClefSouls.ogg new file mode 100644 index 0000000000..000d511566 Binary files /dev/null and b/Sounds/Custom/GFB/SevenTrebleClefSouls.ogg 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/LunicShot1.ogg b/Sounds/Item/LunicShot1.ogg index c7166fea88..ecd913e659 100644 Binary files a/Sounds/Item/LunicShot1.ogg and b/Sounds/Item/LunicShot1.ogg differ diff --git a/Sounds/Item/LunicShot2.ogg b/Sounds/Item/LunicShot2.ogg index bcea333ff4..26df1ef8e2 100644 Binary files a/Sounds/Item/LunicShot2.ogg and b/Sounds/Item/LunicShot2.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/MittFail.ogg b/Sounds/Item/MittFail.ogg new file mode 100644 index 0000000000..b7f210727f Binary files /dev/null and b/Sounds/Item/MittFail.ogg differ diff --git a/Sounds/Item/MittHit.ogg b/Sounds/Item/MittHit.ogg new file mode 100644 index 0000000000..0faac84a5e Binary files /dev/null and b/Sounds/Item/MittHit.ogg differ diff --git a/Sounds/Item/MittReadyPalm.ogg b/Sounds/Item/MittReadyPalm.ogg new file mode 100644 index 0000000000..c786f75f8f Binary files /dev/null and b/Sounds/Item/MittReadyPalm.ogg differ diff --git a/Sounds/Item/MittThrust.ogg b/Sounds/Item/MittThrust.ogg new file mode 100644 index 0000000000..342b6df3a9 Binary files /dev/null and b/Sounds/Item/MittThrust.ogg differ diff --git a/Sounds/Item/MittWelding/Weld1.ogg b/Sounds/Item/MittWelding/Weld1.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld1.ogg differ diff --git a/Sounds/Item/MittWelding/Weld2.ogg b/Sounds/Item/MittWelding/Weld2.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld2.ogg differ diff --git a/Sounds/Item/MittWelding/Weld3.ogg b/Sounds/Item/MittWelding/Weld3.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld3.ogg differ diff --git a/Sounds/Item/MittWelding/Weld4.ogg b/Sounds/Item/MittWelding/Weld4.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld4.ogg differ diff --git a/Sounds/Item/MittWelding/Weld5.ogg b/Sounds/Item/MittWelding/Weld5.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld5.ogg 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/VulcanRampDown.ogg b/Sounds/Item/VulcanRampDown.ogg new file mode 100644 index 0000000000..3463218167 Binary files /dev/null and b/Sounds/Item/VulcanRampDown.ogg differ diff --git a/Sounds/Item/VulcanRampUp.ogg b/Sounds/Item/VulcanRampUp.ogg new file mode 100644 index 0000000000..63a160b201 Binary files /dev/null and b/Sounds/Item/VulcanRampUp.ogg differ diff --git a/Sounds/Item/VulcanShot.ogg b/Sounds/Item/VulcanShot.ogg new file mode 100644 index 0000000000..11c7584d26 Binary files /dev/null and b/Sounds/Item/VulcanShot.ogg differ 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..972abe6ce5 --- /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()); + + /// + /// 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()); + + /// + /// 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..072afb2b7f --- /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 Carapace.
+ /// 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 71971a7bf2..258a4fbd64 100644 --- a/Systems/Collections/DonatorsNameList.cs +++ b/Systems/Collections/DonatorsNameList.cs @@ -517,7 +517,6 @@ namespace CalamityMod.Systems.Collections "Nanaki", "Natalie", "Nathan", - "Nathaniel", "Navigator", "Ne'er Dowell", "NEBULA", @@ -616,6 +615,7 @@ namespace CalamityMod.Systems.Collections "Scribbles", "Scrumlet", "Seanツ", + "Sevenfold", // previously "Woah" "Shadoku", "SharZz", "Shaun", @@ -668,6 +668,7 @@ namespace CalamityMod.Systems.Collections "That Katsafaros", "The Buildmonger", "The Davester", + "The Evolution", // previously "Nathaniel" "The Goliath", "The Illustrious Sqouinchuousor", "The Infinity", @@ -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 9bce514ec6..0000000000 --- a/Systems/Collections/MagicGunIDList.cs +++ /dev/null @@ -1,64 +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(), - 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 21c182ddfa..0000000000 --- a/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs +++ /dev/null @@ -1,30 +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, - NPCType(), - NPCID.PrimeCannon, - NPCID.PrimeLaser, - NPCID.PrimeSaw, - NPCID.PrimeVice - ]; - } - - public override void Unload() => List = null; - - public static bool Includes(int npcType) => List.Contains(npcType); - } -} diff --git a/Systems/Collections/NPCIDs/SlimeGodIDList.cs b/Systems/Collections/NPCIDs/SlimeGodIDList.cs 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 8527fc2b5e..0000000000 --- a/Systems/Collections/NPCs/BossHPScalingList.cs +++ /dev/null @@ -1,154 +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(), - 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 97646e5f90..0000000000 --- a/Systems/Collections/NPCs/BossRushHPChangeDict.cs +++ /dev/null @@ -1,130 +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 }, - { NPCType(), 12000 }, - - { NPCID.EaterofWorldsHead, 10000 }, // 30 seconds + immunity timer at start - { NPCID.EaterofWorldsBody, 10000 }, - { NPCID.EaterofWorldsTail, 10000 }, - - { NPCID.BrainofCthulhu, 100000 }, // 30 seconds with creepers - { NPCID.Creeper, 10000 }, - - { NPCID.QueenBee, 315000 }, // 30 seconds - { NPCID.Bee, 3000 }, - { NPCID.BeeSmall, 2000 }, - { NPCID.BigHornetHoney, 10000 }, - { NPCID.HornetHoney, 7500 }, - { NPCID.LittleHornetHoney, 5000 }, - - { NPCID.Deerclops, 315000 }, // 30 seconds - - { NPCID.SkeletronHead, 150000 }, // 30 seconds - { NPCID.SkeletronHand, 60000 }, - - { NPCID.WallofFlesh, 450000 }, // 30 seconds - { NPCID.WallofFleshEye, 450000 }, - { NPCID.TheHungry, 10000 }, - { NPCID.TheHungryII, 5000 }, - { NPCID.LeechHead, 5000 }, - { NPCID.LeechBody, 5000 }, - { NPCID.LeechTail, 5000 }, - - // Tier 2 - { NPCID.QueenSlimeBoss, 200000 }, // 30 seconds - { NPCID.QueenSlimeMinionBlue, 6000 }, - { NPCID.QueenSlimeMinionPink, 6000 }, - { NPCID.QueenSlimeMinionPurple, 5000 }, - - { NPCID.Spazmatism, 150000 }, // 30 seconds - { NPCID.Retinazer, 125000 }, - { NPCType(), 137500 }, - - { NPCID.TheDestroyer, 600000 }, // 30 seconds + immunity timer at start - { NPCID.TheDestroyerBody, 600000 }, - { NPCID.TheDestroyerTail, 600000 }, - { NPCID.Probe, 10000 }, - - { NPCID.SkeletronPrime, 160000 }, // 30 seconds - { NPCType(), 160000 }, - { NPCID.PrimeVice, 54000 }, - { NPCID.PrimeCannon, 45000 }, - { NPCID.PrimeSaw, 45000 }, - { NPCID.PrimeLaser, 38000 }, - - { NPCID.Plantera, 160000 }, // 30 seconds - { NPCID.PlanterasTentacle, 5000 }, - { NPCType(), 5000 }, - - // Tier 3 - { NPCID.Golem, 50000 }, // 30 seconds - { NPCID.GolemHead, 30000 }, - { NPCID.GolemHeadFree, 30000 }, - { NPCID.GolemFistLeft, 25000 }, - { NPCID.GolemFistRight, 25000 }, - - { NPCID.HallowBoss, 200000 }, // 30 seconds - - { NPCID.DukeFishron, 290000 }, // 30 seconds - - { NPCID.CultistBoss, 220000 }, // 30 seconds - { NPCID.CultistDragonHead, 60000 }, - { NPCID.CultistDragonBody1, 60000 }, - { NPCID.CultistDragonBody2, 60000 }, - { NPCID.CultistDragonBody3, 60000 }, - { NPCID.CultistDragonBody4, 60000 }, - { NPCID.CultistDragonTail, 60000 }, - { NPCID.AncientCultistSquidhead, 50000 }, - - { NPCID.MoonLordCore, 160000 }, // 1 minute - { NPCID.MoonLordHand, 45000 }, - { NPCID.MoonLordHead, 60000 }, - { NPCID.MoonLordLeechBlob, 800 } - - // 9.5 minutes in total for vanilla Boss Rush bosses - }; - } - - public override void Unload() - { - Dict?.Clear(); - Dict = null; - } - - public static bool TryGet(int npcType, out int newHP) - { - return Dict.TryGetValue(npcType, out newHP); - } - } -} diff --git a/Systems/Collections/NPCs/BossTypeDict.cs b/Systems/Collections/NPCs/BossTypeDict.cs 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 f6f625b1d2..0000000000 --- a/Systems/Collections/NPCs/EnemyImmunitiesList.cs +++ /dev/null @@ -1,190 +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, - NPCType(), - NPCID.EaterofWorldsHead, - NPCID.EaterofWorldsBody, - NPCID.EaterofWorldsTail, - NPCID.BrainofCthulhu, - NPCID.Creeper, - NPCID.QueenBee, - NPCID.Deerclops, - NPCID.SkeletronHead, - NPCID.SkeletronHand, - NPCID.WallofFlesh, - NPCID.WallofFleshEye, - NPCID.PirateShipCannon, - NPCID.QueenSlimeBoss, - NPCID.Probe, - NPCID.Retinazer, - NPCID.Spazmatism, - NPCType(), - NPCID.SkeletronPrime, - NPCType(), - NPCID.PrimeCannon, - NPCID.PrimeSaw, - NPCID.PrimeLaser, - NPCID.PrimeVice, - NPCID.Plantera, - NPCID.PlanterasTentacle, - NPCType(), - NPCID.Everscream, - NPCID.SantaNK1, - NPCID.IceQueen, - NPCID.MourningWood, - NPCID.Pumpking, - NPCID.Mothron, - NPCID.Golem, - NPCID.GolemHead, - NPCID.GolemHeadFree, - NPCID.GolemFistRight, - NPCID.GolemFistLeft, - NPCID.MartianSaucerCore, - NPCID.MartianSaucerCannon, - NPCID.MartianSaucerTurret, - NPCID.DukeFishron, - NPCID.Sharkron, - NPCID.Sharkron2, - NPCID.HallowBoss, - NPCID.CultistBoss, - NPCID.CultistDragonHead, - NPCID.CultistDragonBody1, - NPCID.CultistDragonBody2, - NPCID.CultistDragonBody3, - NPCID.CultistDragonBody4, - NPCID.CultistDragonTail, - NPCID.AncientCultistSquidhead, - NPCID.MoonLordHead, - NPCID.MoonLordHand, - NPCID.MoonLordCore, - NPCID.MoonLordFreeEye, - NPCID.DD2WyvernT1, - NPCID.DD2WyvernT2, - NPCID.DD2WyvernT3, - NPCID.DD2DarkMageT1, - NPCID.DD2DarkMageT3, - NPCID.DD2SkeletonT1, - NPCID.DD2SkeletonT3, - NPCID.DD2WitherBeastT2, - NPCID.DD2WitherBeastT3, - NPCID.DD2DrakinT2, - NPCID.DD2DrakinT3, - NPCID.DD2KoboldWalkerT2, - NPCID.DD2KoboldWalkerT3, - NPCID.DD2KoboldFlyerT2, - NPCID.DD2KoboldFlyerT3, - NPCID.DD2OgreT2, - NPCID.DD2OgreT3, - NPCID.DD2Betsy, - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - ]; - } - - public override void Unload() => List = null; - - /// - /// A shorthand method to check if an NPC is in this list. - /// - public static bool Includes(int npcType) => List.Contains(npcType); - } -} diff --git a/Systems/Collections/NPCs/FrostMoonBuffList.cs b/Systems/Collections/NPCs/FrostMoonBuffList.cs 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 5992a004e2..0000000000 --- a/Systems/Collections/ProjectileDestroyExceptionsList.cs +++ /dev/null @@ -1,149 +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(), - - // 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 b6495ebf96..0000000000 --- a/Systems/Collections/SharedStaticIFramesIDSet.cs +++ /dev/null @@ -1,126 +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: Harp notes - ProjectileID.QuarterNote, - ProjectileID.EighthNote, - ProjectileID.TiedEighthNote - ], - - [ // Set 4: The North Pole - ProjectileID.NorthPoleWeapon, - ProjectileID.NorthPoleSpear, - ProjectileID.NorthPoleSnowflake, - ], - - [ // Set 5: All spore gas clouds - ProjectileID.SporeTrap, - ProjectileID.SporeTrap2, - ProjectileID.SporeGas, - ProjectileID.SporeGas2, - ProjectileID.SporeGas3 - ], - - [ // Set 6: Astral Staff - ModContent.ProjectileType(), - ModContent.ProjectileType() - ], - - [ // Set 7: 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/Mechanic/DifficultyModeSystem.cs b/Systems/Mechanic/DifficultyModeSystem.cs index 106dd9bdef..98906a763f 100644 --- a/Systems/Mechanic/DifficultyModeSystem.cs +++ b/Systems/Mechanic/DifficultyModeSystem.cs @@ -1,18 +1,17 @@ using System; using System.Collections.Generic; using System.Linq; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using CalamityMod.Events; +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.Graphics; +using Terraria.GameContent.Creative; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -24,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 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; } @@ -46,13 +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) - ModeIndicatorUI.SwitchToDifficulty(NoDifficulty.Instance); - 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 { @@ -101,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) { @@ -133,35 +237,43 @@ 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 string ActivationTextKey; - public string DeactivationTextKey; - - 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. /// public virtual bool RequiresDifficulty(DifficultyMode mode) => false; - public virtual int FavoredDifficultyAtTier(int tier) => 0; + public virtual int[] FavoredDifficultyAtTier(int tier) => [0]; } public class NoDifficulty : DifficultyMode @@ -169,37 +281,120 @@ namespace CalamityMod.Systems public override bool Enabled { get => true; - set { } - } - - private Asset _texture; - public override Asset Texture - { - get + set { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_None"); - - return _texture; + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Normal : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } } } - public NoDifficulty() + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic"); + + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Off"); + + public override SoundStyle ActivationSound => _activationSound ??= SoundID.MenuTick with { Volume = 1f }; + + 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 { - DifficultyScale = 0; - Name = CalamityUtils.GetText("UI.NoDifficulty"); - ShortDescription = CalamityUtils.GetText("UI.NoDifficultyInfo"); - - ActivationTextKey = string.Empty; - DeactivationTextKey = string.Empty; - - ActivationSound = SoundID.MenuTick with { Volume = 1f }; - - ChatTextColor = Color.White; - Instance = this; + get => Main.getGoodWorld ? Main.masterMode : Main.expertMode; + set + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Expert : GameModeID.Normal; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } + } } - public static NoDifficulty Instance { get; private set; } = null; + 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 override LocalizedText FTWName => Language.GetText("UI.Master"); + + public override Color FTWTextColor => new Color(28, 255, 170); // World display: Main.hcColor + } + + public class MasterDifficulty : DifficultyMode + { + public override bool Enabled + { + get => Main.getGoodWorld ? CalamityWorld.LegendaryMode : Main.masterMode; + set + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } + } + } + + 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 override LocalizedText FTWName => Language.GetText("UI.Legendary"); + + public override Color FTWTextColor => Main.legendaryModeColor; + } public class RevengeanceDifficulty : DifficultyMode @@ -207,98 +402,112 @@ 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; } } + 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 { get { string rageKey = "[c/FFCE85:" + CalamityKeybinds.RageHotKey.TooltipHotkeyString() + "]"; string adrenKey = "[c/79DFBF:" + CalamityKeybinds.AdrenalineHotKey.TooltipHotkeyString() + "]"; - return CalamityUtils.GetText("UI.RevengeanceExpandedInfo").WithFormatArgs(rageKey, adrenKey); + return GetText("UI.RevengeanceExpandedInfo").WithFormatArgs(rageKey, adrenKey); } } - public RevengeanceDifficulty() - { - DifficultyScale = 0.25f; - Name = CalamityUtils.GetText("UI.Revengeance"); - ShortDescription = CalamityUtils.GetText("UI.RevengeanceShortInfo"); + public override LocalizedText FTWName => GetText("UI.Death"); - ActivationTextKey = "Mods.CalamityMod.UI.RevengeanceActivate"; - DeactivationTextKey = "Mods.CalamityMod.UI.RevengeanceDeactivate"; - - ActivationSound = SoundID.Item119; - - ChatTextColor = Color.Crimson; - 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; } } - public override LocalizedText ExpandedDescription => CalamityUtils.GetText("UI.DeathExpandedInfo"); + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death"); - public DeathDifficulty() - { - DifficultyScale = 0.5f; - Name = CalamityUtils.GetText("UI.Death"); - ShortDescription = CalamityUtils.GetText("UI.DeathShortInfo"); + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off"); - ActivationTextKey = "Mods.CalamityMod.UI.DeathActivate"; - DeactivationTextKey = "Mods.CalamityMod.UI.DeathDeactivate"; + public override SoundStyle ActivationSound => _activationSound ??= DemonshadeHelm.ActivationSound; - ActivationSound = DemonshadeHelm.ActivationSound; + public override int BackBoneGameModeID => GameModeID.Master; - ChatTextColor = Color.MediumOrchid; - Instance = this; - } + public override float DifficultyScale => 0.5f; - public override int FavoredDifficultyAtTier(int tier) + 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 override LocalizedText FTWName => GetText("UI.Malice"); + + public override Color FTWTextColor => new Color(240, 128, 128); + + public override int[] FavoredDifficultyAtTier(int tier) { DifficultyMode[] tierList = DifficultyModeSystem.DifficultyTiers[tier]; + List difficulties = new List(); + for (int i = 0; i < tierList.Length; i++) { - if (tierList[i].Name == CalamityUtils.GetText("UI.Revengeance")) - return i; + if (tierList[i] is MasterDifficulty || tierList[i] is RevengeanceDifficulty) + difficulties.Add(i); } - return 0; + if (difficulties.Count <= 0) + difficulties.Add(0); + + return difficulties.ToArray(); } - public static DeathDifficulty Instance { get; private set; } = null; } } diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 64d9163eba..5a830c84ac 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; @@ -35,10 +37,10 @@ namespace CalamityMod.Systems #endregion #region Recipe Group Definitions - public static int HardmodeAnvil, HardmodeForge, AnyLargeGem, AnyFood; + public static int HardmodeAnvil, HardmodeForge, AnyFood; public static int AnyCopperOre, AnySilverOre, AnyGoldOre, AnyEvilOre, AnyCobaltOre, AnyMythrilOre, AnyAdamantiteOre; public static int AnyCopperBar, AnySilverBar, AnyGoldBar, AnyEvilBar, AnyCobaltBar, AnyMythrilBar, AnyAdamantiteBar; - public static int AnyEvilPowder, Boss2Material, CursedFlameIchor, AnyEvilWater, AnyEvilFlask; + public static int Boss2Material, CursedFlameIchor, AnyEvilWater; public static int AnyStoneBlock, AnySnowBlock, AnyIceBlock, AnySiltBlock, AnyEvilBlock, AnyGoodBlock; public static int AnyWoodenSword, AnyHallowedHelmet, AnyHallowedPlatemail, AnyHallowedGreaves, AnyGoldCrown, LunarPickaxe, LunarHamaxe; public static int AnyManaFlower, AnyQuiver, AnyTombstone, AnyWings; @@ -87,19 +89,6 @@ namespace CalamityMod.Systems }); HardmodeForge = RecipeGroup.RegisterGroup("HardmodeForge", group); - // Large Gems (PvP tokens) - group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.AnyLargeGem"), new int[] - { - ItemID.LargeAmber, - ItemID.LargeAmethyst, - ItemID.LargeDiamond, - ItemID.LargeEmerald, - ItemID.LargeRuby, - ItemID.LargeSapphire, - ItemID.LargeTopaz - }); - AnyLargeGem = RecipeGroup.RegisterGroup("AnyLargeGem", group); - // Food AnyFood = RecipeGroup.RegisterGroup("AnyFood", GetFoodItems()); } @@ -214,16 +203,8 @@ namespace CalamityMod.Systems private static void AddEvilBiomeItemRecipeGroups() { - // Vile and Vicious Powder - RecipeGroup group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.AnyEvilPowder"), new int[] - { - ItemID.VilePowder, - ItemID.ViciousPowder - }); - AnyEvilPowder = RecipeGroup.RegisterGroup("AnyEvilPowder", group); - // Shadow Scale and Tissue Sample - group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.Boss2Material"), new int[] + RecipeGroup group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.Boss2Material"), new int[] { ItemID.ShadowScale, ItemID.TissueSample @@ -245,14 +226,6 @@ namespace CalamityMod.Systems ItemID.BloodWater }); AnyEvilWater = RecipeGroup.RegisterGroup("AnyEvilWater", group); - - // Flask of Cursed Flames and Flask of Ichor - group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.AnyEvilFlask"), new int[] - { - ItemID.FlaskofCursedFlames, - ItemID.FlaskofIchor - }); - AnyEvilFlask = RecipeGroup.RegisterGroup("AnyEvilFlask", group); } private static void AddBiomeBlockRecipeGroups() @@ -841,84 +814,6 @@ namespace CalamityMod.Systems // Berserker's Glove recipe change now that it doesn't provide melee speed { Vanilla(ItemID.BerserkerGlove), ReplaceIngredient(ItemID.PowerGlove, ItemID.TitanGlove) }, - - // Standardize the costs of all PHM ore armors to 10/16/14 head/chest/legs - { Vanilla(ItemID.CopperHelmet), ChangeIngredientStack(ItemID.CopperBar, 10) }, - { Vanilla(ItemID.CopperChainmail), ChangeIngredientStack(ItemID.CopperBar, 16) }, - { Vanilla(ItemID.CopperGreaves), ChangeIngredientStack(ItemID.CopperBar, 14) }, - { Vanilla(ItemID.TinHelmet), ChangeIngredientStack(ItemID.TinBar, 10) }, - { Vanilla(ItemID.TinChainmail), ChangeIngredientStack(ItemID.TinBar, 16) }, - { Vanilla(ItemID.TinGreaves), ChangeIngredientStack(ItemID.TinBar, 14) }, - { Vanilla(ItemID.IronHelmet), ChangeIngredientStack(ItemID.IronBar, 10) }, - { Vanilla(ItemID.IronChainmail), ChangeIngredientStack(ItemID.IronBar, 16) }, - { Vanilla(ItemID.IronGreaves), ChangeIngredientStack(ItemID.IronBar, 14) }, - { Vanilla(ItemID.LeadHelmet), ChangeIngredientStack(ItemID.LeadBar, 10) }, - { Vanilla(ItemID.LeadChainmail), ChangeIngredientStack(ItemID.LeadBar, 16) }, - { Vanilla(ItemID.LeadGreaves), ChangeIngredientStack(ItemID.LeadBar, 14) }, - { Vanilla(ItemID.SilverHelmet), ChangeIngredientStack(ItemID.SilverBar, 10) }, - { Vanilla(ItemID.SilverChainmail), ChangeIngredientStack(ItemID.SilverBar, 16) }, - { Vanilla(ItemID.SilverGreaves), ChangeIngredientStack(ItemID.SilverBar, 14) }, - { Vanilla(ItemID.TungstenHelmet), ChangeIngredientStack(ItemID.TungstenBar, 10) }, - { Vanilla(ItemID.TungstenChainmail), ChangeIngredientStack(ItemID.TungstenBar, 16) }, - { Vanilla(ItemID.TungstenGreaves), ChangeIngredientStack(ItemID.TungstenBar, 14) }, - { Vanilla(ItemID.GoldHelmet), ChangeIngredientStack(ItemID.GoldBar, 10) }, - { Vanilla(ItemID.GoldChainmail), ChangeIngredientStack(ItemID.GoldBar, 16) }, - { Vanilla(ItemID.GoldGreaves), ChangeIngredientStack(ItemID.GoldBar, 14) }, - { Vanilla(ItemID.PlatinumHelmet), ChangeIngredientStack(ItemID.PlatinumBar, 10) }, - { Vanilla(ItemID.PlatinumChainmail), ChangeIngredientStack(ItemID.PlatinumBar, 16) }, - { Vanilla(ItemID.PlatinumGreaves), ChangeIngredientStack(ItemID.PlatinumBar, 14) }, - - // Standardize the costs of all HM ore items to the following: - // 10 BARS : Melee Helm, Ranged Helm, Magic Helm, Pickaxe, Drill, Waraxe, Chainsaw, Sword, Spear, Repeater - // 20 BARS : Breastplate - // 15 BARS : Leggings - { VanillaEach( - ItemID.CobaltHelmet, ItemID.CobaltMask, ItemID.CobaltHat, ItemID.CobaltPickaxe, ItemID.CobaltDrill, ItemID.CobaltWaraxe, ItemID.CobaltChainsaw, - ItemID.CobaltSword, ItemID.CobaltNaginata, ItemID.CobaltRepeater), - ChangeIngredientStack(ItemID.CobaltBar, 10) - }, - { Vanilla(ItemID.CobaltBreastplate), ChangeIngredientStack(ItemID.CobaltBar, 20) }, - { Vanilla(ItemID.CobaltLeggings), ChangeIngredientStack(ItemID.CobaltBar, 15) }, - - { VanillaEach( - ItemID.PalladiumHelmet, ItemID.PalladiumMask, ItemID.PalladiumHeadgear, ItemID.PalladiumPickaxe, ItemID.PalladiumDrill, ItemID.PalladiumWaraxe, ItemID.PalladiumChainsaw, - ItemID.PalladiumSword, ItemID.PalladiumPike, ItemID.PalladiumRepeater), - ChangeIngredientStack(ItemID.PalladiumBar, 10) - }, - { Vanilla(ItemID.PalladiumBreastplate), ChangeIngredientStack(ItemID.PalladiumBar, 20) }, - { Vanilla(ItemID.PalladiumLeggings), ChangeIngredientStack(ItemID.PalladiumBar, 15) }, - - { VanillaEach( - ItemID.MythrilHelmet, ItemID.MythrilHat, ItemID.MythrilHood, ItemID.MythrilPickaxe, ItemID.MythrilDrill, ItemID.MythrilWaraxe, ItemID.MythrilChainsaw, - ItemID.MythrilSword, ItemID.MythrilHalberd, ItemID.MythrilRepeater), - ChangeIngredientStack(ItemID.MythrilBar, 10) - }, - { Vanilla(ItemID.MythrilChainmail), ChangeIngredientStack(ItemID.MythrilBar, 20) }, - { Vanilla(ItemID.MythrilGreaves), ChangeIngredientStack(ItemID.MythrilBar, 15) }, - - { VanillaEach( - ItemID.OrichalcumHelmet, ItemID.OrichalcumMask, ItemID.OrichalcumHeadgear, ItemID.OrichalcumPickaxe, ItemID.OrichalcumDrill, ItemID.OrichalcumWaraxe, ItemID.OrichalcumChainsaw, - ItemID.OrichalcumSword, ItemID.OrichalcumHalberd, ItemID.OrichalcumRepeater), - ChangeIngredientStack(ItemID.OrichalcumBar, 10) - }, - { Vanilla(ItemID.OrichalcumBreastplate), ChangeIngredientStack(ItemID.OrichalcumBar, 20) }, - { Vanilla(ItemID.OrichalcumLeggings), ChangeIngredientStack(ItemID.OrichalcumBar, 15) }, - - { VanillaEach( - ItemID.AdamantiteHelmet, ItemID.AdamantiteMask, ItemID.AdamantiteHeadgear, ItemID.AdamantitePickaxe, ItemID.AdamantiteDrill, ItemID.AdamantiteWaraxe, ItemID.AdamantiteChainsaw, - ItemID.AdamantiteSword, ItemID.AdamantiteGlaive, ItemID.AdamantiteRepeater), - ChangeIngredientStack(ItemID.AdamantiteBar, 10) - }, - { Vanilla(ItemID.AdamantiteBreastplate), ChangeIngredientStack(ItemID.AdamantiteBar, 20) }, - { Vanilla(ItemID.AdamantiteLeggings), ChangeIngredientStack(ItemID.AdamantiteBar, 15) }, - - { VanillaEach( - ItemID.TitaniumHelmet, ItemID.TitaniumMask, ItemID.TitaniumHeadgear, ItemID.TitaniumPickaxe, ItemID.TitaniumDrill, ItemID.TitaniumWaraxe, ItemID.TitaniumChainsaw, - ItemID.TitaniumSword, ItemID.TitaniumTrident, ItemID.TitaniumRepeater), - ChangeIngredientStack(ItemID.TitaniumBar, 10) - }, - { Vanilla(ItemID.TitaniumBreastplate), ChangeIngredientStack(ItemID.TitaniumBar, 20) }, - { Vanilla(ItemID.TitaniumLeggings), ChangeIngredientStack(ItemID.TitaniumBar, 15) }, }; // Apply all recipe changes. @@ -1063,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; @@ -1376,55 +1263,11 @@ namespace CalamityMod.Systems r.DisableDecraft(); #endregion - #region New Recipes r = Recipe.Create(ItemID.Bacon); r.AddIngredient(); r.AddTile(TileID.Hellforge); r.Register(); r.DisableDecraft(); - - r = Recipe.Create(ItemID.ApplePie); - r.AddIngredient(ItemID.Apple, 3); - r.AddTile(TileID.Hellforge); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.BananaSplit); - r.AddIngredient(ItemID.Banana); - r.AddIngredient(ItemID.IceBlock); - r.AddIngredient(ItemID.MilkCarton); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.BBQRibs); - r.AddIngredient(ItemID.FleshBlock, 6); - r.AddIngredient(ItemID.Bone, 6); - r.AddTile(TileID.Hellforge); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.MilkCarton); - r.AddIngredient(ItemID.BottledWater); - r.AddIngredient(ItemID.Bone, 2); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.Milkshake); - r.AddIngredient(ItemID.IceBlock); - r.AddIngredient(ItemID.MilkCarton); - r.AddTile(TileID.IceMachine); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.Nachos); - r.AddIngredient(ItemID.PotatoChips); - r.AddIngredient(ItemID.MilkCarton); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); - #endregion } #endregion @@ -1759,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 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 cee684049a..4b21d53067 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -305,7 +305,7 @@ namespace CalamityMod.Tiles // Drop Evil Smasher on every 12 alter smashed if (WorldGen.altarCount > 1 && WorldGen.altarCount % 12 == 0) - DropItem(i, j, ItemType(), quantity: 1, asStack: true); + DropItem(i, j, ItemType(), quantity: 1, asStack: true, prefix: true); } // Drop Golden Bombs at a 0.33% chance from Pots @@ -356,7 +356,7 @@ namespace CalamityMod.Tiles } } - private static void DropItem(int i, int j, int itemType, int quantity, bool asStack, Vector2 spreadMinMax = default) + private static void DropItem(int i, int j, int itemType, int quantity, bool asStack, Vector2 spreadMinMax = default, bool prefix = false) { // Multiplayer Client should not spawn item themselves if (Main.netMode == NetmodeID.MultiplayerClient) @@ -366,14 +366,14 @@ namespace CalamityMod.Tiles if (asStack) { Vector2 spawnOffset = Main.rand.NextVector2Unit(spreadMinMax.X, spreadMinMax.Y); - Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: quantity); + Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: quantity, prefixGiven: prefix ? -1 : 0); } else { for (int k = 0; k < quantity; k += 1) { Vector2 spawnOffset = Main.rand.NextVector2Unit(spreadMinMax.X, spreadMinMax.Y); - Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: 1); + Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: 1, prefixGiven: prefix ? -1 : 0); } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs b/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs index bf857ae736..c2a908ef42 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 89; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 9f / 255f * brightness, 195f / 255f * brightness, 0f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs b/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs index 3da6bb123f..0aafeea281 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 173; @@ -82,10 +83,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 182f / 255f * brightness, 28f / 255f * brightness, 232f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs b/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs index 68899755d7..83a7fd5560 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 6; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i, j), 252f / 255f * brightness, 184f / 255f * brightness, 29f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs b/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs index 823fa54776..0d70137c2b 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 60; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), (255f / 255f) * brightness, (104f / 255f) * brightness, (104f / 255f) * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs b/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs index 557f857324..dbc8e13c6b 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 187; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 105f / 255f * brightness, 195f / 255f * brightness, 193f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs b/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs index 076122c0d9..c553f25054 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 247; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 9f / 255f * brightness, 158f / 255f * brightness, 238f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedLablight.cs b/Tiles/DraedonStructures/CagedLights/AgedLablight.cs index 8c154b9031..72248f3566 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedLablight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedLablight.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 299; @@ -79,11 +80,6 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 255f / 510f; } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { if (Main.tile[i, j].IsTileActuallyInvisible()) diff --git a/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs b/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs index 76f5061edd..2bfbf801fa 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 89; @@ -91,9 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs b/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs index 702af106f2..88623b86cc 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 173; @@ -90,10 +91,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs b/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs index 7514c37cf2..99622541fb 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 6; @@ -92,9 +93,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights } } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs b/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs index f330d1371d..43dc265ece 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs @@ -10,6 +10,7 @@ using Terraria.Enums; using Terraria.ObjectData; using Terraria.Audio; using CalamityMod.Sounds; +using CalamityMod.Items.Pets; namespace CalamityMod.Tiles.DraedonStructures.CagedLights { @@ -21,6 +22,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 60; @@ -91,10 +93,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs b/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs index 59539ee4f6..764e51188e 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 187; @@ -91,10 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs b/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs index 1102fa25b9..635df1e7d4 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 247; @@ -91,10 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedLablight.cs b/Tiles/DraedonStructures/CagedLights/CagedLablight.cs index 6997a227ba..1e8729a673 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedLablight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedLablight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 299; @@ -91,9 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs index 4cad230406..2cc4005b2a 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs @@ -2,8 +2,10 @@ using CalamityMod.Items.Placeables.FurnitureAcidwood; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +13,10 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { public class AcidwoodLanternTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -46,9 +52,19 @@ namespace CalamityMod.Tiles.FurnitureAcidwood CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodLanternTileFlame").Value, i, j, 0, -8); + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(64, 128, 102, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; } public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) 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/FurnitureAncient/AncientLantern.cs b/Tiles/FurnitureAncient/AncientLantern.cs index 00ac4b6fd0..a570d64da5 100644 --- a/Tiles/FurnitureAncient/AncientLantern.cs +++ b/Tiles/FurnitureAncient/AncientLantern.cs @@ -1,7 +1,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAncient { public class AncientLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -40,9 +46,19 @@ namespace CalamityMod.Tiles.FurnitureAncient } } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAncient/AncientLanternFlame").Value, i, j); + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 64, 64, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0f; } public override void HitWire(int i, int j) diff --git a/Tiles/FurnitureAshen/AshenChandelier.cs b/Tiles/FurnitureAshen/AshenChandelier.cs index 65bb0575ff..51b0668275 100644 --- a/Tiles/FurnitureAshen/AshenChandelier.cs +++ b/Tiles/FurnitureAshen/AshenChandelier.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Tiles.FurnitureAshen tileFlameData.flameRangeXMax = 11; tileFlameData.flameRangeYMin = -10; tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultX = 0.05f; tileFlameData.flameRangeMultY = 0f; } diff --git a/Tiles/FurnitureAshen/AshenLantern.cs b/Tiles/FurnitureAshen/AshenLantern.cs index ec7f983270..e671750d60 100644 --- a/Tiles/FurnitureAshen/AshenLantern.cs +++ b/Tiles/FurnitureAshen/AshenLantern.cs @@ -1,7 +1,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAshen { public class AshenLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -40,16 +46,26 @@ namespace CalamityMod.Tiles.FurnitureAshen } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 64, 64, 0); + tileFlameData.flameCount = 2; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0f; + tileFlameData.flameRangeMultY = 0f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAshen/AshenLanternFlame").Value, i, j); - } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; 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/FurnitureExo/ExoLanternTile.cs b/Tiles/FurnitureExo/ExoLanternTile.cs index 30c1883ff0..8946144fcf 100644 --- a/Tiles/FurnitureExo/ExoLanternTile.cs +++ b/Tiles/FurnitureExo/ExoLanternTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.FurnitureExo; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureExo { public class ExoLanternTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -41,14 +47,24 @@ namespace CalamityMod.Tiles.FurnitureExo } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoLanternTileFlame").Value, i, j); - } } } 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/FurnitureMonolith/MonolithLantern.cs b/Tiles/FurnitureMonolith/MonolithLantern.cs index c5a2cc2c2e..ab9b0e5a45 100644 --- a/Tiles/FurnitureMonolith/MonolithLantern.cs +++ b/Tiles/FurnitureMonolith/MonolithLantern.cs @@ -1,13 +1,24 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureMonolith { public class MonolithLantern : ModTile { + public Asset FlameTexture; + public Asset GlowTexture; + + public override void Load() + { + FlameTexture = ModContent.Request(Texture + "Flame"); + GlowTexture = ModContent.Request(Texture + "Glow"); + } + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -22,22 +33,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith num = fail ? 1 : 3; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - if (Main.tile[i, j].IsTileActuallyInvisible()) - return; - - int xPos = Main.tile[i, j].TileFrameX; - int yPos = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLanternGlow").Value; - Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - - Texture2D glowmaskBright = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLanternFlame").Value; - Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } + public override void AdjustMultiTileVineParameters(int i, int j, ref float? overrideWindCycle, ref float windPushPowerX, ref float windPushPowerY, ref bool dontRotateTopTiles, ref float totalWindMultiplier, ref Texture2D glowTexture, ref Color glowColor) => glowTexture = GlowTexture.Value; public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -55,6 +51,21 @@ namespace CalamityMod.Tiles.FurnitureMonolith } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 1; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0f; + tileFlameData.flameRangeMultY = 0f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); 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/FurnitureProfaned/ProfanedLantern.cs b/Tiles/FurnitureProfaned/ProfanedLantern.cs index 7435eaccba..5d142f4db2 100644 --- a/Tiles/FurnitureProfaned/ProfanedLantern.cs +++ b/Tiles/FurnitureProfaned/ProfanedLantern.cs @@ -1,8 +1,10 @@ using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +12,10 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public class ProfanedLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -41,16 +47,26 @@ namespace CalamityMod.Tiles.FurnitureProfaned } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 108, 90, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureProfaned/ProfanedLanternFlame").Value, i, j); - } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { if (Main.tile[i, j].TileFrameX < 18) 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/FurnitureSacrilegious/SacrilegiousLanternTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs index 3b46b8500e..456a13d127 100644 --- a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs +++ b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.FurnitureSacrilegious; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious { public class SacrilegiousLanternTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -40,14 +46,24 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 26, 26, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousLanternTileFlame").Value, i, j); - } } } 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/FurnitureStatigel/StatigelLantern.cs b/Tiles/FurnitureStatigel/StatigelLantern.cs index 5d09bb13e9..b31e99ef26 100644 --- a/Tiles/FurnitureStatigel/StatigelLantern.cs +++ b/Tiles/FurnitureStatigel/StatigelLantern.cs @@ -1,6 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +10,10 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public class StatigelLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -38,14 +44,24 @@ namespace CalamityMod.Tiles.FurnitureStatigel } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureStatigel/StatigelLanternFlame").Value, i, j); - } } } 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/WulfrumLantern.cs b/Tiles/FurnitureWulfrum/WulfrumLantern.cs index 01b9749e60..6ba870244e 100644 --- a/Tiles/FurnitureWulfrum/WulfrumLantern.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLantern.cs @@ -1,32 +1,20 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; -using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ObjectData; namespace CalamityMod.Tiles.FurnitureWulfrum { public class WulfrumLantern : ModTile { - public override void SetStaticDefaults() - { - Main.tileLighted[Type] = true; - Main.tileFrameImportant[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; - TileObjectData.newTile.StyleLineSkip = 2; - TileObjectData.addTile(Type); - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); - AddMapEntry(new Color(251, 235, 127), Language.GetText("MapObject.Lantern")); + public Asset FlameTexture; - TileID.Sets.DisableSmartCursor[Type] = true; - AdjTiles = new int[] { TileID.HangingLanterns }; - } + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + 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 CanExplode(int i, int j) => false; @@ -58,14 +46,24 @@ namespace CalamityMod.Tiles.FurnitureWulfrum } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + 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) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumLanternFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureWulfrum/WulfrumLantern.png b/Tiles/FurnitureWulfrum/WulfrumLantern.png index 4eda4d5984..66521d13f8 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumLantern.png and b/Tiles/FurnitureWulfrum/WulfrumLantern.png differ diff --git a/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png b/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png index 8a4b6a04cb..efc098ace6 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png and b/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png differ 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/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs index c58f0510f5..5cc0e8630a 100644 --- a/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using CalamityMod.Tiles.SunkenSea.Ambient; using Terraria.GameContent; using Terraria.ModLoader; diff --git a/Tiles/SunkenSea/AridSoil.cs b/Tiles/SunkenSea/AridSoil.cs new file mode 100644 index 0000000000..e0a83dfa7d --- /dev/null +++ b/Tiles/SunkenSea/AridSoil.cs @@ -0,0 +1,48 @@ +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; + + 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)); + + 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/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + } + + 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 6e309e5123..08dcb46d06 100644 --- a/Tiles/SunkenSea/Basalt.cs +++ b/Tiles/SunkenSea/Basalt.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Systems; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -7,21 +8,13 @@ namespace CalamityMod.Tiles.SunkenSea { public class Basalt : ModTile { - private int sheetWidth = 234; - private int sheetHeight = 90; - - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - 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.tileShine2[Type] = false; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); @@ -52,10 +45,9 @@ namespace CalamityMod.Tiles.SunkenSea return false; } - public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - frameXOffset = i % 4 * sheetWidth; - frameYOffset = j % 4 * sheetHeight; + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/Basalt.png b/Tiles/SunkenSea/Basalt.png index 4341da810c..c2285d2254 100644 Binary files a/Tiles/SunkenSea/Basalt.png and b/Tiles/SunkenSea/Basalt.png differ 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/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/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/CanvasPaintingUI.cs b/UI/CanvasPaintingUI.cs index 30119f2d8d..b655d2b1a4 100644 --- a/UI/CanvasPaintingUI.cs +++ b/UI/CanvasPaintingUI.cs @@ -63,7 +63,7 @@ namespace CalamityMod.UI float paintingFrameScale = painting.scale; Vector2 paintingFramePosition = painting.framePosition; - bool hideUI = Main.keyState.IsKeyDown(Keys.LeftShift); + bool hideUI = Main.keyState.PressingShift(); Texture2D tex = TextureAssets.Tile[ModContent.TileType()].Value; if (p.CurrentlyViewedCanvasType == 1) 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..91aae1bed8 --- /dev/null +++ b/UI/DialogueDisplay/DialogueDisplayUI.cs @@ -0,0 +1,1180 @@ +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]; + 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 (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/ModeIndicatorLock.png b/UI/ModeIndicator/ModeIndicatorLock.png index f440e5748d..ae7b9e6073 100644 Binary files a/UI/ModeIndicator/ModeIndicatorLock.png and b/UI/ModeIndicator/ModeIndicatorLock.png differ diff --git a/UI/ModeIndicator/ModeIndicatorOutline.png b/UI/ModeIndicator/ModeIndicatorOutline.png index d4f1f87ee3..8cfff31c70 100644 Binary files a/UI/ModeIndicator/ModeIndicatorOutline.png and b/UI/ModeIndicator/ModeIndicatorOutline.png differ diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index ddde388064..f56da1d192 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -1,17 +1,13 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; using System.Text.RegularExpressions; using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Systems; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; -using Terraria.GameInput; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -49,7 +45,7 @@ namespace CalamityMod.UI.ModeIndicator internal static int MenuAnimLength => MostAlternateDifficulties > 1 ? 60 : 40; private static int menuOpenTransitionTime = 0; private static DifficultyMode previouslyHoveredMode = null; - public static float WidthForTier(int alts) => (alts - 1) * 40f; + public static float WidthForTier(int alts) => (alts - 1) * 44f; private static void ClearVariables() { @@ -207,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; } } @@ -229,12 +225,7 @@ namespace CalamityMod.UI.ModeIndicator { locked = false; text = CalamityUtils.GetText("UI.DifficultyClickText"); - if (!Main.expertMode && GetCurrentDifficulty == Difficulties[0]) - { - locked = true; - text = CalamityUtils.GetText("UI.ExpertDifficultyLock"); - } - else if (CalamityPlayer.areThereAnyDamnBosses || BossRushEvent.BossRushActive) + if (CalamityPlayer.areThereAnyDamnBosses || BossRushEvent.BossRushActive) { locked = true; text = CalamityUtils.GetText("UI.ChangingTheRules"); @@ -303,7 +294,7 @@ namespace CalamityMod.UI.ModeIndicator public static void ManageHexIcons(SpriteBatch spriteBatch, out string text) { int tiers = DifficultyTiers.Count(); - float barLength = 60 * tiers * BarExpansionProgress; + float barLength = 68 * tiers * BarExpansionProgress; float progress = menuOpen ? 1 - menuOpenTransitionTime / (float)MenuAnimLength : menuOpenTransitionTime / (float)MenuAnimLength; Vector2 basePosition = DrawCenter + (barLength / (float)(tiers + 1f)) * Vector2.UnitY; @@ -322,7 +313,7 @@ namespace CalamityMod.UI.ModeIndicator for (int j = 0; j < modesAtTier; j++) { DifficultyMode mode = DifficultyTiers[i][j]; - Texture2D hexIcon = mode.Texture.Value; + Texture2D hexIcon = mode.Enabled ? mode.Texture.Value : mode.TextureDisabled.Value; Vector2 hexIconSize = hexIcon.Size(); // Get position. @@ -332,7 +323,7 @@ namespace CalamityMod.UI.ModeIndicator bool hovered = MouseScreenArea.Intersects(Utils.CenteredRectangle(iconPosition, hexIconSize)); - float usedOpacity = mode.Enabled ? 0.85f : 0.55f; + float usedOpacity = 0.85f; if (hovered) usedOpacity = MathHelper.Lerp(usedOpacity, 1f, 0.7f); @@ -355,10 +346,7 @@ namespace CalamityMod.UI.ModeIndicator text = GetDifficultyText(mode); - // Cannot switch to Death Mode if Master Mode isn't active. - // Cannot switch to Revengeance Mode if Master Mode is active. - bool cannotSwitchTo = (!Main.masterMode && mode == Difficulties[2]) || (Main.masterMode && mode == Difficulties[1]); - if (ClickingMouse && !cannotSwitchTo) + if (ClickingMouse) SwitchToDifficulty(mode); } } @@ -372,16 +360,16 @@ namespace CalamityMod.UI.ModeIndicator { Texture2D lockTexture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicatorLock").Value; float rotationShift = lockClickTime == 0 ? 0f : (float)Math.Sin((1 - lockClickTime / (float)LockAnimLength) * MathHelper.TwoPi * 2f) * 0.5f * (lockClickTime / (float)LockAnimLength); - spriteBatch.Draw(lockTexture, DrawCenter + Vector2.UnitY * 12 * MainIconScale, null, Color.White, 0f + rotationShift, lockTexture.Size() * 0.5f, LockShakeScale * MainIconScale, SpriteEffects.None, 0f); + spriteBatch.Draw(lockTexture, DrawCenter + Vector2.UnitY * 24 * MainIconScale, null, Color.White, 0f + rotationShift, lockTexture.Size() * 0.5f, LockShakeScale * MainIconScale, SpriteEffects.None, 0f); } #endregion #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(); @@ -389,7 +377,7 @@ namespace CalamityMod.UI.ModeIndicator if (mode.ExpandedDescription != LocalizedText.Empty) { // Show the description either if the player is holding shift. - if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift)) + if (Main.keyState.PressingShift()) text += "\n" + mode.ExpandedDescription.ToString(); else @@ -406,9 +394,15 @@ namespace CalamityMod.UI.ModeIndicator if (mode == GetCurrentDifficulty) return; + // This has to be put before difficulties change as to not disrupt GetCurrentDifficulty + 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++) { @@ -416,12 +410,7 @@ namespace CalamityMod.UI.ModeIndicator if (Difficulties[i]._difficultyTier >= mode._difficultyTier && Difficulties[i] != mode) { if (Difficulties[i].Enabled) - { - if (Difficulties[i].DeactivationTextKey != string.Empty) - DisplayLocalizedText(Difficulties[i].DeactivationTextKey, Difficulties[i].ChatTextColor); - Difficulties[i].Enabled = false; - } } } @@ -440,21 +429,24 @@ namespace CalamityMod.UI.ModeIndicator for (int j = 0; j < DifficultyTiers[i].Length; j++) DifficultyTiers[i][j].Enabled = false; - // Enable the one favored by the mode. - DifficultyTiers[i][mode.FavoredDifficultyAtTier(i)].Enabled = true; + // Enable the ones favored by the mode. + for (int j = 0; j < mode.FavoredDifficultyAtTier(i).Length; j++) + { + DifficultyTiers[i][mode.FavoredDifficultyAtTier(i)[j]].Enabled = true; + } } } - if (mode.ActivationTextKey != string.Empty) - DisplayLocalizedText(mode.ActivationTextKey, mode.ChatTextColor); - mode.Enabled = true; SoundEngine.PlaySound(mode.ActivationSound); CalamityNetcode.SyncCalamityWorldDifficulties(Main.myPlayer); - menuOpen = false; - menuOpenTransitionTime = MenuAnimLength; + if (menuOpen) + { + menuOpen = false; + menuOpenTransitionTime = MenuAnimLength; + } } #endregion diff --git a/UI/ModeIndicator/ModeIndicator_Classic.png b/UI/ModeIndicator/ModeIndicator_Classic.png new file mode 100644 index 0000000000..cec6bfee9b Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Classic.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Classic_Off.png b/UI/ModeIndicator/ModeIndicator_Classic_Off.png new file mode 100644 index 0000000000..ccf4bfccbc Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Classic_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Death.png b/UI/ModeIndicator/ModeIndicator_Death.png index 5729ede7b4..3407bf8f8d 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Death.png and b/UI/ModeIndicator/ModeIndicator_Death.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Death_Off.png b/UI/ModeIndicator/ModeIndicator_Death_Off.png new file mode 100644 index 0000000000..2a3f7cc3d5 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Death_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Expert.png b/UI/ModeIndicator/ModeIndicator_Expert.png new file mode 100644 index 0000000000..7f16d0f576 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Expert.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Expert_Off.png b/UI/ModeIndicator/ModeIndicator_Expert_Off.png new file mode 100644 index 0000000000..1ade0d9fd6 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Expert_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Master.png b/UI/ModeIndicator/ModeIndicator_Master.png new file mode 100644 index 0000000000..c69fcfaa6e Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Master.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Master_Off.png b/UI/ModeIndicator/ModeIndicator_Master_Off.png new file mode 100644 index 0000000000..91817fbfd1 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Master_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_None.png b/UI/ModeIndicator/ModeIndicator_None.png deleted file mode 100644 index 58648ff4ed..0000000000 Binary files a/UI/ModeIndicator/ModeIndicator_None.png and /dev/null differ diff --git a/UI/ModeIndicator/ModeIndicator_Rev.png b/UI/ModeIndicator/ModeIndicator_Rev.png index 64eec475d7..5b21cfd0fa 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Rev.png and b/UI/ModeIndicator/ModeIndicator_Rev.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Rev_Off.png b/UI/ModeIndicator/ModeIndicator_Rev_Off.png new file mode 100644 index 0000000000..3f8cc887fa Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Rev_Off.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 42c9269e04..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); @@ -98,7 +98,7 @@ namespace CalamityMod.UI string maxStealthStr = (100f * modPlayer.rogueStealthMax).ToString("n2"); string textToDisplay = $"{CalamityUtils.GetTextValue("UI.Stealth")}: {stealthStr}/{maxStealthStr}\n"; - if (!Main.keyState.IsKeyDown(LeftShift)) + if (!Main.keyState.PressingShift()) { textToDisplay += CalamityUtils.GetTextValue("UI.StealthShiftText"); } @@ -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 29fb7c446c..55c3541beb 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)) * (Main.getGoodWorld ? 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)) * (CalamityWorld.LegendaryMode ? 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/GeneralExtensionUtils.cs b/Utilities/GeneralExtensionUtils.cs index cba1a4cf52..a7950a7edd 100644 --- a/Utilities/GeneralExtensionUtils.cs +++ b/Utilities/GeneralExtensionUtils.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items; +using CalamityMod.Items.BaseItems; using CalamityMod.NPCs; using CalamityMod.Projectiles; using Terraria; @@ -15,5 +16,7 @@ namespace CalamityMod public static CalamityGlobalItem Calamity(this Item item) => item.GetGlobalItem(); public static CalamityGlobalProjectile Calamity(this Projectile proj) => proj.GetGlobalProjectile(); public static Item ActiveItem(this Player player) => Main.mouseItem.IsAir ? player.HeldItem : Main.mouseItem; + public static TransformationPlayer Transformation(this Player player) => player.GetModPlayer(); + } } diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index c28487a7fd..0f4c8d0cc7 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) { diff --git a/Utilities/LocalizationUtils.cs b/Utilities/LocalizationUtils.cs index 07d6a8c75f..d7096cdc8e 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,7 @@ 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 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 +101,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 89973967e4..fb0b74fabd 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -31,6 +31,14 @@ namespace CalamityMod ChatHelper.BroadcastChatMessage(NetworkText.FromKey(key), textColor.Value); } + public static void DisplayFormattedText(string key, Color textColor, params object[] args) + { + if (Main.netMode == NetmodeID.SinglePlayer) + Main.NewText(Language.GetOrRegister(key).Format(args), textColor); + else if (Main.dedServ || Main.netMode == NetmodeID.MultiplayerClient) + ChatHelper.BroadcastChatMessage(NetworkText.FromKey(key, args), textColor); + } + public static int IngredientIndex(this Recipe r, int itemID) { for (int i = 0; i < r.requiredItem.Count; ++i) 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 81e4aecbd5..19b85c5d58 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -9,6 +9,7 @@ using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; +using CalamityMod.Items.Armor.Statigel; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Systems.Collections; using CalamityMod.World; @@ -438,8 +439,8 @@ namespace CalamityMod int extraIFrames = 0; if (modPlayer.godSlayerThrowing && hurtInfo.Damage > 80) extraIFrames += 30; - if (modPlayer.statigelSet && hurtInfo.Damage > 100) - extraIFrames += 30; + if (modPlayer.statigelSet && hurtInfo.Damage > StatigelArmor.SetBonusHurtDamageThreshold) + extraIFrames += StatigelArmor.SetBonusIFrameExtension; // 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. @@ -617,6 +618,107 @@ namespace CalamityMod } #endregion + #region Player Healing and Lifesteal + /// + /// Directly provides lifesteal to the player. + /// This obeys the spawn behaviour of lifesteal and incurs cooldown. + /// + /// The player being healed. + /// The target being hit. Input null if there is none. + /// The amount of life being healed. + /// The multiplier to the rate of lifesteal. Increase above 1 to make it weaker and below 1 to make it stronger. + public static void DoLifestealDirect(this Player player, NPC target, int amount, float cooldownMultiplier = 1f) + { + // NPC limitations: disallow if target is not an enemy or deliberately disallowed from lifestealing + if (target is not null && (!target.IsAnEnemy(false) || !target.canGhostHeal)) + return; + + // Limit the amount of heal to the player's max health + amount = Math.Min(amount, player.statLifeMax2 - player.statLife); + + // As well as the physical cap to how much HP can be healed + amount = Math.Min(amount, BalancingConstants.LifeStealCap); + + // Player limitations: disallow if lifesteal variable reaches 0 or lower or Moon Bite is active + if (amount <= 0 || player.lifeSteal <= 0f || player.moonLeech) + return; + + // Grant lifesteal and subtract from the variable accordingly + player.lifeSteal -= amount * cooldownMultiplier; + player.HealPlayer(amount); + } + + /// + /// Spawns a projectile which grants healing to the player on contact. + /// This obeys the spawn behaviour of lifesteal and incurs cooldown. + /// This applies as a projectile on-hit effect. Use DoLifestealDirect for direct lifestealing. + /// + /// The player being healed. + /// The target being hit. Input null if there is none. + /// The source projectile performing this heal. + /// The type of healing projectile spawned. + /// The amount of life to heal. + /// The multiplier to the rate of lifesteal. Increase above 1 to make it weaker and below 1 to make it stronger. + /// Whether or not the heal is given to the player on the team with lowest HP. False by default. + /// The distance the projectile has to be from the player to direct the heal to when sharing. Default of 3000f (187.5 tiles) + public static void SpawnLifeStealProjectile(this Player player, NPC target, Projectile projSource, int projType, int amount, float cooldownMultiplier = 1f, bool shared = false, float distanceRequired = 3000f) + { + // NPC limitations: disallow if target is not an enemy or deliberately disallowed from lifestealing + if (target is not null && (!target.IsAnEnemy(false) || !target.canGhostHeal)) + return; + + int lowestHealthCheck = player.statLifeMax2 - player.statLife; + int targetPlayer = player.whoAmI; + if (shared) + { + foreach (Player otherPlayer in Main.ActivePlayers) + { + if (!otherPlayer.dead && ((!player.hostile && !otherPlayer.hostile) || player.team == otherPlayer.team)) + { + float playerDist = Vector2.Distance(projSource.Center, otherPlayer.Center); + if (playerDist < distanceRequired && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) + { + lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; + targetPlayer = otherPlayer.whoAmI; + } + } + } + } + + // Limit the amount of heal to the target player's max health + amount = Math.Min(amount, lowestHealthCheck); + + // As well as the physical cap to how much HP can be healed + amount = Math.Min(amount, BalancingConstants.LifeStealCap); + + // Player limitations: disallow if lifesteal variable reaches 0 or lower or Moon Bite is active + // This is performed on the player who DOES the lifesteal, and not the recipient + if (amount <= 0 || player.lifeSteal <= 0f || player.moonLeech) + return; + + // Grant lifesteal and subtract from the variable accordingly + player.lifeSteal -= amount * cooldownMultiplier; + if (projSource.owner == Main.myPlayer) + Projectile.NewProjectile(projSource.GetSource_FromThis(), projSource.Center, Vector2.Zero, projType, 0, 0f, projSource.owner, targetPlayer, amount); + } + + /// + /// A short method that heals the player. + /// All direct heals in Calamity should use this. + /// + /// The player being healed. + /// The amount of life being healed. + /// Whether the heal CombatText should be displayed, and whether it should be synced. Displays and syncs by default. + public static void HealPlayer(this Player player, int amount, HealTextType healTextType = HealTextType.Broadcast) + { + player.statLife += amount; + if (player.statLife > player.statLifeMax2) + player.statLife = player.statLifeMax2; + if (healTextType != HealTextType.None) + player.HealEffect(amount, healTextType == HealTextType.Broadcast); + } + #endregion + #region Rage and Adrenaline /// /// Returns the damage multiplier Adrenaline Mode provides for the given player. @@ -924,10 +1026,10 @@ namespace CalamityMod item.CountsAsClass() ); - bool heldItemIsTool = (item.pick > 0 || item.axe > 0 || item.hammer > 0) && !BlacklistedWeaponsWithToolPowerList.Includes(item.type); + bool heldItemIsTool = (item.pick > 0 || item.axe > 0 || item.hammer > 0) && !CalamityItemSets.WeaponWithToolPowerAffectedBySummonPenalty[item.type]; bool heldItemCanBeUsed = item.useStyle != ItemUseStyleID.None; bool heldItemIsAccessoryOrAmmo = item.accessory || item.ammo != AmmoID.None; - bool heldItemIsExcludedByModCall = DisabledSummonerNerfItemList.Includes(item.type); + bool heldItemIsExcludedByModCall = CalamityItemSets.ItemWhichDisablesSummonerNerf[item.type]; if (heldItemIsClassedWeapon && heldItemCanBeUsed && !heldItemIsTool && !heldItemIsAccessoryOrAmmo && !heldItemIsExcludedByModCall) return true; @@ -935,23 +1037,6 @@ namespace CalamityMod return false; } - - /// - /// A short method that heals the player. - /// All direct heals in Calamity should use this. - /// - /// The player being healed. - /// The amount of life being healed. - /// Whether the heal CombatText should be displayed, and whether it should be synced. Displays and syncs by default. - public static void HealPlayer(this Player player, int amount, HealTextType healTextType = HealTextType.Broadcast) - { - player.statLife += amount; - if (player.statLife > player.statLifeMax2) - player.statLife = player.statLifeMax2; - if (healTextType != HealTextType.None) - player.HealEffect(amount, healTextType == HealTextType.Broadcast); - } - /// /// Makes the given player send the given packet to all appropriate receivers.
/// If server is false, the packet is sent only to the multiplayer host.
diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index e8b9ab486f..bf30417251 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -845,7 +845,6 @@ namespace CalamityMod private static readonly List vanillaBlastImmuneTiles = new List() { - TileID.DemonAltar, TileID.Cobalt, TileID.Mythril, TileID.Adamantite, @@ -854,8 +853,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 +916,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/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..0d1e3e5774 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; 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/LargeBasaltWall.cs b/Walls/LargeBasaltWall.cs new file mode 100644 index 0000000000..4c902acac2 --- /dev/null +++ b/Walls/LargeBasaltWall.cs @@ -0,0 +1,30 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Walls +{ + public class LargeBasaltWall : MultiVariantModWall + { + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = true; + + AddMapEntry(new Color(45, 44, 50)); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Ash, 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 PopulateWallVariant(int i, int j, ref int frameXOffset, ref int frameYOffset) + { + frameXOffset = (i % 4) * 468; + frameYOffset = (j % 4) * 180; + } + } +} diff --git a/Walls/LargeBasaltWall.png b/Walls/LargeBasaltWall.png new file mode 100644 index 0000000000..775d0dc9d9 Binary files /dev/null and b/Walls/LargeBasaltWall.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/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 new file mode 100644 index 0000000000..d81e1570c5 --- /dev/null +++ b/Waters/BasaltGullyLava.cs @@ -0,0 +1,26 @@ +using CalamityMod.Dusts.WaterSplash; +using CalamityMod.Gores.WaterDroplet; +using CalamityMod.Systems; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class BasaltGullyLava : ModLavaStyle + { + public override string WaterfallTexture => "CalamityMod/Waters/BasaltGullyLavaflow"; + + public override int GetSplashDust() => ModContent.DustType(); + + public override int GetDropletGore() => ModContent.GoreType(); + + public override bool IsLavaActive() => Main.LocalPlayer.Calamity().ZoneBasaltGully; + + 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; + } + } +} diff --git a/Waters/BasaltGullyLava.png b/Waters/BasaltGullyLava.png new file mode 100644 index 0000000000..2459b3cf5e Binary files /dev/null and b/Waters/BasaltGullyLava.png differ diff --git a/Waters/BasaltGullyLava_Block.png b/Waters/BasaltGullyLava_Block.png new file mode 100644 index 0000000000..e1c8be0e19 Binary files /dev/null and b/Waters/BasaltGullyLava_Block.png differ diff --git a/Waters/BasaltGullyLava_Slope.png b/Waters/BasaltGullyLava_Slope.png new file mode 100644 index 0000000000..a6a89147f9 Binary files /dev/null and b/Waters/BasaltGullyLava_Slope.png differ diff --git a/Waters/BasaltGullyLavaflow.png b/Waters/BasaltGullyLavaflow.png new file mode 100644 index 0000000000..791bdd5ff1 Binary files /dev/null and b/Waters/BasaltGullyLavaflow.png differ diff --git a/Waters/SunkenSeaBurrowsWater_Slope.png b/Waters/SunkenSeaBurrowsWater_Slope.png index 5598cc77c0..fcd463d89f 100644 Binary files a/Waters/SunkenSeaBurrowsWater_Slope.png and b/Waters/SunkenSeaBurrowsWater_Slope.png differ diff --git a/Waters/SunkenSeaPolypWater_Slope.png b/Waters/SunkenSeaPolypWater_Slope.png index 9404893b7c..ddf2446ee4 100644 Binary files a/Waters/SunkenSeaPolypWater_Slope.png and b/Waters/SunkenSeaPolypWater_Slope.png differ diff --git a/Waters/SunkenSeaReefsWater_Slope.png b/Waters/SunkenSeaReefsWater_Slope.png index 74919b164c..5a485e545f 100644 Binary files a/Waters/SunkenSeaReefsWater_Slope.png and b/Waters/SunkenSeaReefsWater_Slope.png differ diff --git a/World/Abyss.cs b/World/Abyss.cs index 84775f63b8..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; } @@ -1119,6 +1119,7 @@ namespace CalamityMod.World if (ChestIndex != -1) { Main.chest[ChestIndex].item[0].SetDefaults(itemChoice); + Main.chest[ChestIndex].item[0].Prefix(-1); Main.chest[ChestIndex].item[1].SetDefaults(WorldGen.genRand.Next(Potions1)); Main.chest[ChestIndex].item[1].stack = WorldGen.genRand.Next(1, 3); diff --git a/World/AerialiteOreGen.cs b/World/AerialiteOreGen.cs index 9a487be65a..d712a0c3e8 100644 --- a/World/AerialiteOreGen.cs +++ b/World/AerialiteOreGen.cs @@ -34,7 +34,7 @@ namespace CalamityMod.World // 2. The original tile must not be empty air. // 3. A random dice-roll must land correctly, to ensure that patches of ore are occasional. // If any of these conditions are not met, this loop iteration is skipped. - if (!(tile.TileType == TileID.Cloud || tile.TileType == TileID.LesionBlock || tile.TileType == TileID.FleshBlock) || !tile.HasTile || !WorldGen.genRand.NextBool(CloudOreConversionChance)) + if (!(tile.TileType == TileID.Cloud || ((tile.TileType == TileID.LesionBlock || tile.TileType == TileID.FleshBlock) && WorldGen.remixWorldGen)) || !tile.HasTile || !WorldGen.genRand.NextBool(CloudOreConversionChance)) continue; int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); 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/CustomUnderworld.cs b/World/CustomUnderworld.cs index 60b43a5528..3271f7e3f4 100644 --- a/World/CustomUnderworld.cs +++ b/World/CustomUnderworld.cs @@ -2185,6 +2185,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -2215,6 +2216,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 566ee2b8f0..411b8181db 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -246,6 +246,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/DungeonArchive.cs b/World/DungeonArchive.cs index 51487e5f4c..ff39d10636 100644 --- a/World/DungeonArchive.cs +++ b/World/DungeonArchive.cs @@ -135,6 +135,7 @@ namespace CalamityMod.World else { chest.item[i].SetDefaults(contents2[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents2[i].Stack; } } diff --git a/World/GiantHive.cs b/World/GiantHive.cs index 7845fa730c..03fadea3de 100644 --- a/World/GiantHive.cs +++ b/World/GiantHive.cs @@ -831,12 +831,13 @@ namespace CalamityMod.World int index = 0; - chest.item[index++].SetDefaults(random.Next(FocusLootHoney)); + chest.item[index].SetDefaults(random.Next(FocusLootHoney)); + chest.item[index++].Prefix(-1); if (random.Next(3) <= 1) { chest.item[index].SetDefaults(random.Next(BarLootHoney)); - chest.item[index].SetDefaults(random.Next(7, 15)); + chest.item[index++].stack = random.Next(7, 15); } else { diff --git a/World/MechanicShed.cs b/World/MechanicShed.cs index 172e2fb573..5af166de3c 100644 --- a/World/MechanicShed.cs +++ b/World/MechanicShed.cs @@ -130,6 +130,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index 474cf6d647..6b92ec1073 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -63,6 +63,7 @@ namespace CalamityMod.World return; c.item[itemIndex].SetDefaults(id, false); + c.item[itemIndex].Prefix(-1); // Don't set quantity unless quantity is specified if (minQuantity > 0) diff --git a/World/Planets/MudPlanet.cs b/World/Planets/MudPlanet.cs index 97113e4681..0ce47166f8 100644 --- a/World/Planets/MudPlanet.cs +++ b/World/Planets/MudPlanet.cs @@ -222,13 +222,14 @@ namespace CalamityMod.World.Planets int index = 0; //Focus loot - chest.item[index++].SetDefaults(_random.Next(FocusLoot)); + chest.item[index].SetDefaults(_random.Next(FocusLoot)); + chest.item[index++].Prefix(-1); //Bars if (_random.Next(3) <= 1) { chest.item[index].SetDefaults(_random.Next(BarLoot)); - chest.item[index].SetDefaults(_random.Next(7, 15)); + chest.item[index++].stack = _random.Next(7, 15); } else { diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index da17625dd3..c9fbf8af15 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++) { @@ -753,11 +716,11 @@ namespace CalamityMod.World } } } - }); + } //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 +753,7 @@ namespace CalamityMod.World Tile.SmoothSlope(X, Y); } } - }); + } } //bottom of the biome (gleaming burrows) public static void PlaceGleamingBurrows(int startPosX, int startPosY) @@ -816,7 +779,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 +808,7 @@ namespace CalamityMod.World } } } - }); + } @@ -927,7 +890,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 +914,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 +938,7 @@ namespace CalamityMod.World } } } - }); + } //cleanup again, also place geodes for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -1103,7 +1066,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 +1090,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 +1114,7 @@ namespace CalamityMod.World } } } - }); + } //cleanup again for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -1198,7 +1161,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; @@ -1227,9 +1190,9 @@ namespace CalamityMod.World { Main.tile[X, Y].ClearEverything(); WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); - WorldGen.PlaceWall(X, Y, WallID.LavaUnsafe1); + 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 +1219,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 +1236,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++) { @@ -1303,8 +1266,9 @@ namespace CalamityMod.World WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); } + 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 @@ -1901,7 +1865,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++) { @@ -1921,7 +1885,7 @@ namespace CalamityMod.World } } } - }); + } } diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index d1379f1d3c..199fd4b84a 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -272,6 +272,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -341,6 +342,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -534,6 +536,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -670,6 +673,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -761,6 +765,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/VernalPass.cs b/World/VernalPass.cs index cea45e5153..4d3d7d3f94 100644 --- a/World/VernalPass.cs +++ b/World/VernalPass.cs @@ -86,6 +86,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } 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 {