diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs index 838eda9488..3f1369eb74 100644 --- a/Backgrounds/SunkenSeaBurrowsBG.cs +++ b/Backgrounds/SunkenSeaBurrowsBG.cs @@ -73,6 +73,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 +98,7 @@ namespace CalamityMod.Backgrounds // rendering code if that setting is on. if (Main.WaveQuality > 0 || !CalamityClientConfig.Instance.SunkenSeaBackgroundDistortion) { + DrawShoresBG(); DrawBurrowsBG(); } else @@ -123,14 +125,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 ef9ebaaf8f..9cb5eb02f0 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -36,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. @@ -136,8 +137,11 @@ namespace CalamityMod.Balancing #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 @@ -169,15 +173,12 @@ namespace CalamityMod.Balancing // 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())))); - // 25% resist to Lucrecia. NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + // 20% resist to Aurora Blazer. + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + // 20% resist to The Hive. NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); #endregion @@ -206,27 +207,27 @@ namespace CalamityMod.Balancing // 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())))); - // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, 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())))); - // 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())))); - // 35% resist to Icicle Arrows. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + // 30% resist to Aurora Blazer. + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + + // 30% resist to Flak Kraken. + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + + // 20% resist to Ballistic Poison Bomb's clouds. + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + // 20% resist to Cluster Rocket fragments. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII)))); #endregion 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/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/AquaticHeartBuff.cs b/Buffs/StatBuffs/AquaticHeartBuff.cs index d57b5c79f9..5dde4436f3 100644 --- a/Buffs/StatBuffs/AquaticHeartBuff.cs +++ b/Buffs/StatBuffs/AquaticHeartBuff.cs @@ -20,7 +20,6 @@ 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) 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/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 2f5f7166bc..3abf5065bb 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1319,7 +1319,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; @@ -1577,33 +1576,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; @@ -1612,8 +1597,6 @@ namespace CalamityMod.CalPlayer public bool omegaBlueTransformation; public bool omegaBlueTransformationForce; public bool omegaBlueTransformationPower; - public bool ghostBracelet; - public bool punchCard; #endregion #region Calamitas Enchant Effects @@ -2516,7 +2499,6 @@ namespace CalamityMod.CalPlayer xWrath = false; graxDefense = false; encased = false; - brutalCarnage = false; omniscience = false; zerg = false; zen = false; @@ -2722,29 +2704,22 @@ 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; @@ -3017,7 +2992,6 @@ namespace CalamityMod.CalPlayer xWrath = false; graxDefense = false; encased = false; - brutalCarnage = false; omniscience = false; zerg = false; zen = false; @@ -4048,6 +4022,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) @@ -4078,7 +4057,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); @@ -4879,37 +4858,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 || @@ -4917,58 +4865,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); @@ -4983,26 +4881,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) { @@ -5600,60 +5479,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 636e5136a1..910944e209 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -442,52 +442,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/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 694698bf8d..f80d30474b 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -485,7 +485,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 +635,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; @@ -1750,11 +1745,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 +1773,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(); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 8cc8d4de94..24f3ffaa5c 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3332,11 +3332,6 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += Grax.DamageBoost; } - if (brutalCarnage) - { - Player.GetDamage() += BrutalCarnage.MeleeDamageBoost; - } - // Trinket of Chi bonus if (trinketOfChi) { @@ -3662,14 +3657,6 @@ namespace CalamityMod.CalPlayer if (wDeath && !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) { Player.statDefense -= ArmorCrunch.DefenseReduction; 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/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/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/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index d4d1e7273f..a566bda6e5 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -65,7 +65,6 @@ namespace CalamityMod.ILEditing // NPC behavior IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; - On_NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInBossRush; IL_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush; IL_Player.CollectTaxes += MakeTaxCollectorUseful; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 90bdf541aa..9060f3013b 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -333,16 +333,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Allow Empress to Enrage in Boss Rush - private static bool AllowEmpressToEnrageInBossRush(On_NPC.orig_ShouldEmpressBeEnraged orig) - { - if (BossRushEvent.BossRushActive) - return true; - - return orig(); - } - #endregion - #region Prevent Vanilla Bosses From Being Marked as Defeated in Boss Rush private static void PreventVanillaBossDeathsInBossRush(ILContext il) { 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/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/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index a62a6fa4f7..de805f51fa 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,7 +25,7 @@ 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; @@ -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/Vanity/AbandonedWulfrumHelmet.cs b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs index ae04d03443..a1521cb95d 100644 --- a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs +++ b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -20,35 +21,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, "AbandonedWulfrumHelmet", "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 +47,6 @@ namespace CalamityMod.Items.Accessories.Vanity public override void UpdateVanity(Player player) { - player.GetModPlayer().transformationActive = true; player.GetModPlayer().vanityEquipped = true; } @@ -70,7 +54,6 @@ namespace CalamityMod.Items.Accessories.Vanity { if (!hideVisual) { - player.GetModPlayer().transformationActive = true; player.GetModPlayer().vanityEquipped = true; } } @@ -79,53 +62,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/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/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..d2b53bcda5 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, "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() { @@ -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/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/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/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index fcfbb6da1b..4717a713b6 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -57,8 +57,8 @@ 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_Player.KeyDoubleTap += ActivateSetBonus; + On_Main.DrawPendingMouseText += SpoofMouseItem; } public override void Unload() @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Armor.Wulfrum DummyCannon = null; } - private void ActivateSetBonus(Terraria.On_Player.orig_KeyDoubleTap orig, Player player, int keyDir) + private void ActivateSetBonus(On_Player.orig_KeyDoubleTap orig, Player player, int keyDir) { if (keyDir == (Main.ReversedUpDownArmorSetBonuses ? 1 : 0) && HasArmorSet(player) && !player.mount.Active) { @@ -84,9 +84,9 @@ namespace CalamityMod.Items.Armor.Wulfrum 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. + //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? + //Though do I need to sync that or is the player inventory auto synced? DummyCannon.SetDefaults(ItemType()); } } @@ -95,7 +95,7 @@ namespace CalamityMod.Items.Armor.Wulfrum } //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; @@ -132,7 +132,7 @@ 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.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; if (PowerModeEngaged(player, out var cd)) { @@ -143,11 +143,12 @@ namespace CalamityMod.Items.Armor.Wulfrum //Stats player.statDefense += 13; - player.endurance += 0.05f; //10% Dr in total with the chestplate + player.endurance += 0.05f; //10% DR in total with the chestplate - //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) @@ -158,11 +159,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()); @@ -175,7 +174,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; } @@ -187,6 +186,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; } } @@ -194,8 +196,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) { @@ -364,7 +366,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..01af6d62e9 --- /dev/null +++ b/Items/BaseItems/TransformationAccessory.cs @@ -0,0 +1,271 @@ +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.UpdateVisibleAccessory += SetTransformationItem; + } + + internal TransformationAccessory currentTransformation = null; + int prevSlot = -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 SetTransformationItem(On_Player.orig_UpdateVisibleAccessory orig, Player self, int itemSlot, Item item, bool modded) + { + orig(self, itemSlot, item, modded); + + if (self.Transformation().currentTransformation == null || !self.Transformation().currentTransformation.IsForced) + { + if (self.Transformation().prevSlot > itemSlot) //determines if we're on the first visible slot (as this isnt called on non-visible slots) + self.Transformation().currentTransformation = null; + + if (item.ModItem is TransformationAccessory transformation && transformation.ShouldTransform.Invoke(self) && (currentTransformation == null || transformation.Priority >= currentTransformation.Priority)) + self.Transformation().currentTransformation = transformation; + } + + if (self.Transformation().currentTransformation != null && itemSlot == 19) // last item slot, can set equip slots to our transformation if one is equipped + { + 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(); + } + + self.Transformation().prevSlot = itemSlot; + } + + 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); + } + } + } + + 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 f8aee874d4..824567cb3a 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1224,6 +1224,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; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 1342f4b23b..66b782bf2c 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1100,6 +1100,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%")); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 0a726b09d4..cf223874a0 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -100,7 +100,8 @@ 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(PointBlank, DamageExact(12), AutoReuse) }, { ItemID.DemonScythe, Do(AutoReuse, DamageExact(28)) }, { ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar @@ -111,7 +112,7 @@ 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 @@ -130,8 +131,8 @@ namespace CalamityMod.Items { ItemID.Gradient, Do(AutoReuse, DamageExact(39)) }, { ItemID.GreenPhaseblade, phaseblade }, { ItemID.GreenPhasesaber, phasesaber }, - { ItemID.GrenadeLauncher, Do(DamageExact(112)) }, - { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(7f)) }, + { ItemID.GrenadeLauncher, Do(DamageExact(105)) }, + { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(132), ShootSpeedExact(7f)) }, { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, { ItemID.Handgun, Do(PointBlank, UseExact(20)) }, { ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) }, @@ -145,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(PointBlank, DamageExact(69)) }, { ItemID.MedusaHead, Do(ManaExact(6), DamageExact(48)) }, { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, @@ -180,7 +181,8 @@ namespace CalamityMod.Items { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, { ItemID.MythrilRepeater, Do(PointBlank, 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, phaseblade }, @@ -189,7 +191,7 @@ namespace CalamityMod.Items { ItemID.OrichalcumRepeater, Do(PointBlank, DamageExact(48)) }, { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, { ItemID.PainterPaintballGun, Do(PointBlank, 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(PointBlank, DamageExact(45)) }, { ItemID.PalladiumSword, Do(UseTurn, DamageExact(150)) }, @@ -198,18 +200,17 @@ namespace CalamityMod.Items { ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) }, { ItemID.Phantasm, Do(PointBlank, DamageExact(48)) }, { ItemID.PhoenixBlaster, Do(AutoReuse, PointBlank, UseExact(20)) }, - { ItemID.PiranhaGun, Do(DamageExact(48)) }, { ItemID.PlatinumBow, Do(PointBlank, 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, phaseblade }, { ItemID.PurplePhasesaber, phasesaber }, - { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(70)) }, + { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(63)) }, { ItemID.QuadBarrelShotgun, Do(PointBlank, DamageExact(11)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, { ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13), KnockbackExact(8f)) }, @@ -221,10 +222,11 @@ namespace CalamityMod.Items { ItemID.RedPhasesaber, phasesaber }, { ItemID.RedRyder, Do(PointBlank, DamageExact(24)) }, { ItemID.RedsYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats - { ItemID.RocketLauncher, Do(DamageExact(70)) }, + { ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) }, { ItemID.Sandgun, Do(PointBlank, 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(PointBlank, DamageExact(55)) }, { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, @@ -237,12 +239,12 @@ 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(PointBlank, DamageExact(215)) }, + { ItemID.SniperRifle, Do(PointBlank, DamageExact(200), UseExact(40)) }, { ItemID.SolarEruption, Do(DamageExact(122)) }, { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain { 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), UseExact(15)) }, @@ -250,16 +252,17 @@ namespace CalamityMod.Items { 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(PointBlank, DamageExact(41)) }, + { ItemID.TacticalShotgun, Do(PointBlank, DamageExact(34)) }, { ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane { ItemID.TendonBow, Do(PointBlank, 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(PointBlank, AutoReuse, DamageExact(15)) }, @@ -269,6 +272,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)) }, @@ -282,9 +286,8 @@ namespace CalamityMod.Items { ItemID.Uzi, Do(PointBlank, 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(PointBlank, 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, phaseblade }, { ItemID.WhitePhasesaber, phasesaber }, @@ -477,6 +480,7 @@ namespace CalamityMod.Items { ItemID.StakeLauncher, pointBlank }, { ItemID.TinBow, pointBlank }, { ItemID.TungstenBow, pointBlank }, + { ItemID.VenusMagnum, pointBlank }, { ItemID.VortexBeater, pointBlank }, { ItemID.WoodenBow, pointBlank }, #endregion @@ -499,7 +503,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 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/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 43e9ecf44f..f86823bde7 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -64,6 +64,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "CrabBar", "Dandy", "Dia", + "Done", "dozezoze", "Eddie Spaghetti", "ENNWAY", @@ -118,7 +119,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "DarkTiny", "Demik", "DM Dokuro", - "Done", "Doog", "drh", "dwshin", 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/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/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/Weapons/Magic/AnahitasArpeggio.cs b/Items/Weapons/Magic/AnahitasArpeggio.cs index 154e914af3..07505a8cf2 100644 --- a/Items/Weapons/Magic/AnahitasArpeggio.cs +++ b/Items/Weapons/Magic/AnahitasArpeggio.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 56; Item.height = 50; - Item.damage = 127; + Item.damage = 65; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useTime = 22; @@ -58,8 +58,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..a6bf35a3c3 100644 --- a/Items/Weapons/Magic/Atlantis.cs +++ b/Items/Weapons/Magic/Atlantis.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { 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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index ce68ea8fc9..14adbd1f69 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -20,16 +20,15 @@ namespace CalamityMod.Items.Weapons.Melee internal const int TotalRows = 2; - internal const int TotalTeeth = 4; + internal const int TotalTeeth = 3; 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 +45,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 +82,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 +128,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 +166,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/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/Nebulash.cs b/Items/Weapons/Melee/Nebulash.cs index b6c96a6a50..d9b6e29fd2 100644 --- a/Items/Weapons/Melee/Nebulash.cs +++ b/Items/Weapons/Melee/Nebulash.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { 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..01c3ab635d 100644 --- a/Items/Weapons/Melee/Oblivion.cs +++ b/Items/Weapons/Melee/Oblivion.cs @@ -27,7 +27,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/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/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/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/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index 3ca149441e..342af60f9c 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -29,14 +29,11 @@ namespace CalamityMod.Items.Weapons.Ranged { 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; @@ -53,7 +50,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")); } @@ -65,15 +62,8 @@ namespace CalamityMod.Items.Weapons.Ranged //Distortion wind do whisper one truth... } - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - - public override bool AltFunctionUse(Player player) - { - return true; - } + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + public override bool AltFunctionUse(Player player) => true; public override float UseSpeedMultiplier(Player player) { diff --git a/Items/Weapons/Ranged/Arietes41.cs b/Items/Weapons/Ranged/Arietes41.cs index d1de224282..8a163ed1b4 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; @@ -39,7 +39,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 @@ -51,8 +50,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) @@ -63,8 +61,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/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index 825b90649f..0cc08831d2 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged { 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/BladedgeRailbow.cs b/Items/Weapons/Ranged/BladedgeRailbow.cs index 5b3983dd1b..8aa526363c 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; @@ -114,22 +113,18 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - 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; @@ -138,12 +133,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) @@ -151,12 +144,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/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 8fc15e31b1..81a591dcb8 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/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/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/Hydra.cs b/Items/Weapons/Ranged/Hydra.cs index 521f677b7a..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; @@ -47,7 +47,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.UseSound = null; //does so in Shoot - Item.Calamity().canFirePointBlankShots = true; } public override bool CanConsumeAmmo(Item ammo, Player player) => player.altFunctionUse == 2 ? false : true; @@ -97,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 61010b9c37..26978f9907 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged { 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; @@ -58,7 +58,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/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 155944b311..0508a50472 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; @@ -33,7 +35,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); @@ -43,20 +45,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 5f22951eac..28ff3ad12f 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; @@ -42,11 +42,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/Sandblaster.cs b/Items/Weapons/Ranged/Sandblaster.cs index 71bec5ad7c..4a309f2dd4 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; @@ -33,10 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - 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/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/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index f6219b4d3e..4cea38a174 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/VernalBolter.cs b/Items/Weapons/Ranged/VernalBolter.cs index fca73e5091..2f22ba25bf 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/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/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/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/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 90ed3cab91..acf40a72cb 100644 --- a/Items/Weapons/Rogue/FrostyFlare.cs +++ b/Items/Weapons/Rogue/FrostyFlare.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 10; Item.height = 22; - Item.damage = 32; + Item.damage = 37; Item.noUseGraphic = true; Item.noMelee = true; Item.useAnimation = Item.useTime = 13; 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/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..8ea4e320a3 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 36; Item.height = 38; - Item.damage = 44; + Item.damage = 43; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 9; @@ -21,7 +21,6 @@ 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(); @@ -31,25 +30,16 @@ 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) { - 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 * 1.5f, type, damage, knockback * 12, player.whoAmI, 0f, 4f); + tooth.Calamity().stealthStrike = true; + tooth.timeLeft = 140; + } + else + { + for (int i = 0; i < 2; i++) + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.7f, 1f), type, damage, knockback, player.whoAmI, 0f, Main.rand.Next(1, 3+1)); } return false; } 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/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/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/Whitewater.cs b/Items/Weapons/Rogue/Whitewater.cs index b8831ffa01..2f34530323 100644 --- a/Items/Weapons/Rogue/Whitewater.cs +++ b/Items/Weapons/Rogue/Whitewater.cs @@ -15,10 +15,10 @@ namespace CalamityMod.Items.Weapons.Rogue { 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 +30,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/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..5252545e0e 100644 --- a/Items/Weapons/Summon/BorealisBomber.cs +++ b/Items/Weapons/Summon/BorealisBomber.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Summon { 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/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/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..8e1c572b4b 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon { 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/GastricBelcherStaff.cs b/Items/Weapons/Summon/GastricBelcherStaff.cs index 4d2796f9cd..242608f0b0 100644 --- a/Items/Weapons/Summon/GastricBelcherStaff.cs +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon { 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/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/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/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 971ac6e917..e04f4def90 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 diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 4fbadd5955..6a257b83da 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -882,7 +882,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: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson index a68f00f2e6..dde7b09dae 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson @@ -515,5 +515,6 @@ SuperDummy: { Regenerates 1 million life per second Will not die when taking damage over time from debuffs to kill all super dummies + Can only spawn 50 super dummies at once ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index ebcb808e8d..c62fea1db5 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -1194,7 +1194,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' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 6ff50d2c54..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' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index c5e5658212..eefde30e9b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -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: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 17b4e499e4..021008f3c8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -559,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' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index be160ba56d..6957cd297e 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 ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index db7dd63721..bca33b7c0a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -893,7 +893,7 @@ WulfrumController: { Tooltip: ''' Summons a wulfrum droid to fight for you - Hold 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.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index d4886b9a19..7f5e74bfd8 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -86,8 +86,8 @@ DeathExpandedInfo: [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? +DeathActivate: Death is active. +DeathDeactivate: Death is not active. // Calamity Health Bar ExoTwinsNameNormal: XS-01 Artemis and XS-03 Apollo ExoTwinsNameHekate: Eyes of XB-∞ Hekate diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 00db54dfd7..7d5ea3826c 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -50,9 +50,7 @@ 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; @@ -90,16 +88,15 @@ 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 || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { if (nonHostile) { @@ -148,11 +145,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; } diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index c66d0fb21b..87eecca930 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -50,9 +50,7 @@ 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; @@ -90,16 +88,15 @@ 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 || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { if (nonHostile) { @@ -148,11 +145,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; } diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 20746f8f02..e0f4cd83d9 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -77,9 +77,7 @@ 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; @@ -131,17 +129,16 @@ 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 || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { if (nonHostile) { @@ -190,7 +187,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; @@ -198,12 +195,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; } @@ -222,7 +219,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) @@ -238,7 +235,7 @@ namespace CalamityMod.NPCs.AquaticScourge } // 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) @@ -351,7 +348,7 @@ 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; @@ -667,7 +664,7 @@ namespace CalamityMod.NPCs.AquaticScourge return 0f; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 328ddf987e..a9c2eb2544 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -48,9 +48,7 @@ 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; @@ -88,16 +86,15 @@ 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 || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) { if (nonHostile) { @@ -146,11 +143,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; } diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 7cc00bf5cf..1c9e667883 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -98,8 +98,8 @@ namespace CalamityMod.NPCs.AstrumAureus 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; @@ -155,10 +155,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; @@ -171,8 +170,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) @@ -195,10 +192,10 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.localAI[3] -= death ? 4f : expertMode ? 2f : 1f; } - float enrageScale = bossRush ? 1f : 0f; - if ((Main.IsItDay() && !player.Calamity().ZoneAstral) || bossRush) + float enrageScale = 0f; + if (Main.IsItDay() && !player.Calamity().ZoneAstral) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 1f; } @@ -277,7 +274,7 @@ namespace CalamityMod.NPCs.AstrumAureus { 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); @@ -371,8 +368,8 @@ 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); @@ -408,8 +405,8 @@ 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); @@ -458,7 +455,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(); @@ -570,7 +567,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; @@ -736,7 +733,7 @@ namespace CalamityMod.NPCs.AstrumAureus { 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; + int totalProjectiles = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 10f; Vector2 spinningPoint = new Vector2(0f, -velocity); @@ -754,8 +751,8 @@ 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); @@ -777,8 +774,8 @@ 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); + 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); @@ -905,7 +902,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(); @@ -1298,7 +1295,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; } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 7bf89ccdd3..42389b2276 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -67,9 +67,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; @@ -115,15 +113,14 @@ 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; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float enrageScale = bossRush ? 0.5f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = 0f; + if (Main.IsItDay()) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 1.5f; } diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index fe2f6e60b7..a1dcd445a8 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -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; @@ -149,15 +147,14 @@ 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; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float enrageScale = bossRush ? 0.5f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = 0f; + if (Main.IsItDay()) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 1.5f; } @@ -914,7 +911,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 9feb4201a8..b9362f3c8d 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -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; @@ -98,15 +96,14 @@ 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; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float enrageScale = bossRush ? 0.5f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = 0f; + if (Main.IsItDay()) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 1.5f; } diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 478a14704b..dfabd78a96 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -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; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index d4ecf7dac0..2e544b9c1d 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -179,16 +179,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; @@ -196,17 +195,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; } @@ -336,7 +335,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { NPC.localAI[1] += 1f; - if (NPC.localAI[1] >= (bossRush ? 90f : death ? 120f : 180f)) + if (NPC.localAI[1] >= (death ? 120f : 180f)) { NPC.TargetClosest(); NPC.localAI[1] = 0f; @@ -390,7 +389,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(); @@ -696,7 +695,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental 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()) @@ -886,7 +885,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs index c67134220c..b75c1e95c7 100644 --- a/NPCs/Bumblebirb/Dragonfolly.cs +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -132,10 +132,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,7 +147,7 @@ namespace CalamityMod.NPCs.Bumblebirb 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; @@ -162,13 +161,13 @@ 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 (CalamityWorld.LegendaryMode) @@ -223,8 +222,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); @@ -1229,7 +1228,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) { diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index ccd3112f8f..83f55e1c3e 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -72,10 +72,9 @@ namespace CalamityMod.NPCs.CalClone if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 0.8f; - NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 12 : 25; + NPC.defense = 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.LifeMaxNERB(39000, 46875, 520000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -137,10 +136,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; @@ -289,10 +287,10 @@ namespace CalamityMod.NPCs.CalClone // Target variable Player player = Main.player[NPC.target]; - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = 0f; + if (Main.IsItDay()) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -301,16 +299,6 @@ namespace CalamityMod.NPCs.CalClone 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; @@ -464,7 +452,7 @@ namespace CalamityMod.NPCs.CalClone type = ModContent.ProjectileType(); float gigaBlastFrequency = (CalamityWorld.LegendaryMode ? 120f : expertMode ? 180f : 240f) - enrageScale * 15f; - float projSpeed = bossRush ? 6.25f : 5f; + float projSpeed = 5f; if (calamityGlobalNPC.newAI[3] <= 300f) { if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top @@ -493,7 +481,7 @@ namespace CalamityMod.NPCs.CalClone { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - float projSpeed = bossRush ? 4.5f : 4f; + 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) { @@ -521,7 +509,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) @@ -535,7 +523,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) @@ -618,7 +606,7 @@ namespace CalamityMod.NPCs.CalClone { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - float projSpeed = bossRush ? 5f : 4f; + float projSpeed = 4f; if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) { float distance = Main.rand.NextBool() ? -1000f : 1000f; @@ -768,7 +756,7 @@ namespace CalamityMod.NPCs.CalClone 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; @@ -965,7 +953,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) { diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index 0645bfce1f..a09eed75d6 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -60,9 +60,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 +144,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,10 +154,10 @@ namespace CalamityMod.NPCs.CalClone Player player = Main.player[NPC.target]; - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = 0f; + if (Main.IsItDay()) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -378,10 +376,8 @@ namespace CalamityMod.NPCs.CalClone 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); diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index 09bd00a219..4cb790112d 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -55,9 +55,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 +138,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,10 +148,10 @@ namespace CalamityMod.NPCs.CalClone Player player = Main.player[NPC.target]; - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = 0f; + if (Main.IsItDay()) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -369,10 +367,8 @@ namespace CalamityMod.NPCs.CalClone 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); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index bafe50bf43..58619fd79b 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; @@ -798,31 +799,6 @@ namespace CalamityMod.NPCs } } - // Bonebreaker debuff stacking - if (npc.javelined) - { - if (npc.lifeRegen > 0) - npc.lifeRegen = 0; - - int projectileCount = 0; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.type == ProjectileType() && - p.ai[0] == 1f && p.ai[1] == npc.whoAmI) - { - projectileCount++; - } - } - - if (projectileCount > 0) - { - npc.lifeRegen -= projectileCount * 20; - - if (damage < projectileCount * 4) - damage = projectileCount * 4; - } - } - // Shellfish Staff (and Mollusk armor) debuff stacking if (shellfishVore > 0) { @@ -1256,15 +1232,6 @@ namespace CalamityMod.NPCs 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) { @@ -1359,6 +1326,12 @@ namespace CalamityMod.NPCs ApplyDPSDebuff(30, 6, ref npc.lifeRegen, ref damage); if (somaShredStacks > 0) Shred.TickDebuff(npc, this); + if (sagePoisonTime > 0) + { + // npc.Calamity().sagePoisonDamage = 50 * (float)(Math.Pow(totalSageSpirits, 0.9D) + Math.Pow(totalSageSpirits, 1.13D)) * 0.5f + // See SageNeedle.cs for details + ApplyDPSDebuff(npc.Calamity().sagePoisonDamage, npc.Calamity().sagePoisonDamage / 5, ref npc.lifeRegen, ref damage); + } if (heavybleeding > 0) ApplyDPSDebuff(80, 10, ref npc.lifeRegen, ref damage); if (laceration > 0) @@ -1436,11 +1409,11 @@ namespace CalamityMod.NPCs { 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.Golem, 0.15f }, + { NPCID.GolemFistLeft, 0.15f }, + { NPCID.GolemFistRight, 0.15f }, + { NPCID.GolemHead, 0.15f }, + { NPCID.GolemHeadFree, 0.15f }, { NPCID.GraniteFlyer, 0.1f }, { NPCID.GraniteGolem, 0.15f }, { NPCID.GreekSkeleton, 0.1f }, @@ -1740,12 +1713,12 @@ namespace CalamityMod.NPCs 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: @@ -1753,7 +1726,7 @@ namespace CalamityMod.NPCs break; case NPCID.Plantera: - npc.lifeMax = 80000; + npc.lifeMax = 72000; break; case NPCID.PlanterasTentacle: @@ -1854,12 +1827,14 @@ 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.275); + npc.npcSlots = 64f; + } + else if (npc.type == NPCID.GolemHead) + { + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); } else if (npc.type == NPCID.GolemHeadFree) { @@ -3205,7 +3180,7 @@ namespace CalamityMod.NPCs 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))); + modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / EaterOfWorldsAI.DRIncreaseTime, 0f, 1f))); if (DestroyerIDList.Includes(npc.type) && newAI[1] < DestroyerAI.DRIncreaseTime) modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / DestroyerAI.DRIncreaseTime, 0f, 1f))); } @@ -3347,15 +3322,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.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 @@ -5433,7 +5405,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); @@ -5713,14 +5685,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 (EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper || npc.type == NPCType()) + damageMult = 0.75f; + else if (PerforatorWormIDList.Includes(npc.type) || AquaticScourgeIDList.Includes(npc.type) || DestroyerIDList.Includes(npc.type) || + RavagerIDList.Includes(npc.type) || AstrumDeusIDList.Includes(npc.type) || StormWeaverIDList.Includes(npc.type) || + npc.type == NPCType() || npc.type == NPCType()) + damageMult = 0.5f; + else if (ThanatosIDList.Includes(npc.type)) + damageMult = 0.35f; + + modifiers.SourceDamage *= damageMult; } } #endregion @@ -7811,7 +7790,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; diff --git a/NPCs/CalamityPierceResistance.cs b/NPCs/CalamityPierceResistance.cs index c69f0b3ad7..b01140fda0 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))); diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index a8d82f091a..5d3adf1ca8 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -133,10 +133,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; @@ -188,7 +187,7 @@ 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); + bool moveVeryFast = Vector2.Distance(NPC.Center, player.Center) > 960f || (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0); // Despawn if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) @@ -212,8 +211,8 @@ 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 tileEnrageMult = (CalamityWorld.LegendaryMode && revenge) ? 1.5f : 1f; + NPC.Calamity().CurrentlyEnraged = tileEnrageMult > 1f && !BossRushEvent.BossRushActive; // Set AI variable to be used by Dark Energies NPC.ai[1] = tileEnrageMult; @@ -229,7 +228,7 @@ namespace CalamityMod.NPCs.CeaselessVoid 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.LegendaryMode && revenge) ? 2400f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; // Move closer to the target before trying to succ if (movingDuringSuccPhase) @@ -344,9 +343,9 @@ 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++) @@ -489,7 +488,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); @@ -533,8 +532,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 = moveVeryFast ? 25f : ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)) * tileEnrageMult; + float acceleration = (moveVeryFast ? 0.75f : death ? 0.2f : expertMode ? 0.16f : 0.12f) + (float)(death ? 0.04f * (1D - lifeRatio) : 0f) * tileEnrageMult; // Increase speed dramatically in succ phase if (succ) @@ -565,7 +564,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { // 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; @@ -807,7 +806,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(); } diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index f630d4a070..d22ab0e890 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -157,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) diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 11eead9cab..23b2b6aaad 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.lifeMax = CalamityWorld.LegendaryMode ? 180 : 15; if (BossRushEvent.BossRushActive) - NPC.lifeMax = 8000; + NPC.lifeMax = 6000; if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; AIType = -1; @@ -66,7 +66,7 @@ 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 xVelocityLimit = death ? 8f : revenge ? 6f : 5f; float yVelocityLimit = CalamityWorld.LegendaryMode ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; // Get a target diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 4265f19d2c..9f15b00127 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -129,10 +129,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; @@ -183,7 +182,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.timeLeft = 1800; // Enrage - if ((!player.ZoneGlowshroom || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) + if ((!player.ZoneGlowshroom || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -191,17 +190,17 @@ namespace CalamityMod.NPCs.Crabulon else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) + float enrageScale = 0f; + if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } - if (biomeEnraged && (!player.ZoneGlowshroom || bossRush)) + if (biomeEnraged && !player.ZoneGlowshroom) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } @@ -406,7 +405,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.ai[1] += 1f; } - float jumpGateValue = (bossRush ? 15f : expertMode ? 60f : 120f) / (enrageScale + 1f); + float jumpGateValue = (expertMode ? 60f : 120f) / (enrageScale + 1f); if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -521,13 +520,13 @@ 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 ? 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++) { @@ -546,13 +545,13 @@ 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++) { @@ -716,7 +715,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; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 8f67ef754e..06023f7ed4 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -180,13 +180,12 @@ 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; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Enrage - if (!player.ZoneSnow && !bossRush) + if (!player.ZoneSnow && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -194,21 +193,18 @@ namespace CalamityMod.NPCs.Cryogen 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 += 2f; } if (enrageScale > 2f) enrageScale = 2f; - if (bossRush) - enrageScale = 3f; - // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -317,7 +313,7 @@ namespace CalamityMod.NPCs.Cryogen } } - float chargePhaseGateValue = bossRush ? 240f : 360f; + float chargePhaseGateValue = 360f; float chargeDuration = 60f; float chargeTelegraphTime = NPC.ai[0] == 2f ? (CalamityWorld.LegendaryMode ? 60f : 80f) : (CalamityWorld.LegendaryMode ? 90f : 120f); float chargeTelegraphMaxRotationIncrement = 1f; @@ -337,7 +333,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); @@ -379,7 +375,7 @@ 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); @@ -455,7 +451,7 @@ 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); @@ -653,7 +649,7 @@ 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); @@ -816,7 +812,7 @@ 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); @@ -928,7 +924,7 @@ namespace CalamityMod.NPCs.Cryogen float velocity = 9f + enrageScale; 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; @@ -1030,7 +1026,7 @@ namespace CalamityMod.NPCs.Cryogen 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; @@ -1153,7 +1149,7 @@ 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); @@ -1174,7 +1170,7 @@ namespace CalamityMod.NPCs.Cryogen } NPC.ai[1] += 1f; - if (NPC.ai[1] >= (bossRush ? 120f : 180f)) + if (NPC.ai[1] >= 180f) { NPC.TargetClosest(); NPC.ai[0] = 4f; @@ -1388,7 +1384,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; } diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 07ffc224b6..7b7f3161dc 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -70,9 +70,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) { diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index bb18724fbc..4e439250e7 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -70,9 +70,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) { diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index d31f0d5d6c..3cf5fa073e 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -107,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--; @@ -124,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; } diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 1db5079b54..ed6fa99406 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -103,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--; @@ -120,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; } diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index af61513d30..f21ea1e2e2 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -52,9 +52,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]; diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index 07b792c929..fbab588d70 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -52,9 +52,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]; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 85933a5b17..a584771be0 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -89,9 +89,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) { diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 160b51789d..dc6f2e09ea 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; @@ -162,10 +161,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; @@ -188,7 +186,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--; @@ -196,12 +194,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; } @@ -234,7 +232,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; @@ -598,11 +596,11 @@ namespace CalamityMod.NPCs.DesertScourge { // Spit a huge spread of sand upwards that falls down SoundEngine.PlaySound(SandBlastSound, NPC.Center); - float velocity = CalamityWorld.LegendaryMode ? 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; + int numProj = death ? 24 : revenge ? 21 : expertMode ? 18 : 12; if (CalamityWorld.LegendaryMode) numProj *= 2; @@ -943,7 +941,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; } diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 58fc6ab045..38b829d3ae 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -69,9 +69,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]; diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index 1466430a21..4fc03348e6 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -140,7 +140,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Calculate contact damage based on velocity - float segmentVelocity = BossRushEvent.BossRushActive ? 30f : CalamityWorld.revenge ? 25f : 23f; + float segmentVelocity = CalamityWorld.revenge ? 25f : 23f; float minimalContactDamageVelocity = segmentVelocity * 0.25f; float minimalDamageVelocity = segmentVelocity * 0.5f; float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 3915489d33..ecd2c37d52 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -185,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) diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index 1b96f53359..15c3167633 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Calculate contact damage based on velocity - float segmentVelocity = BossRushEvent.BossRushActive ? 30f : CalamityWorld.revenge ? 25f : 23f; + float segmentVelocity = CalamityWorld.revenge ? 25f : 23f; float minimalContactDamageVelocity = segmentVelocity * 0.25f; float minimalDamageVelocity = segmentVelocity * 0.5f; float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 35b00db2ce..62d072d994 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -156,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) { @@ -269,7 +268,7 @@ 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 (CalamityWorld.LegendaryMode) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index d992764865..6f4278027f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -360,10 +361,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; @@ -398,14 +398,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) { @@ -415,7 +415,7 @@ 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); @@ -496,7 +496,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) @@ -547,7 +547,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; @@ -618,7 +618,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. @@ -639,7 +639,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) @@ -665,7 +665,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; @@ -710,7 +710,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; @@ -789,7 +789,7 @@ namespace CalamityMod.NPCs.DevourerofGods { 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; @@ -809,7 +809,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) { @@ -1383,8 +1383,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) { @@ -1530,7 +1530,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; @@ -1579,8 +1579,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 @@ -2128,8 +2128,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) { @@ -2310,7 +2310,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); @@ -2328,7 +2328,7 @@ namespace CalamityMod.NPCs.DevourerofGods float mult = revenge ? 1.5f : 3f; for (int i = 0; i < totalSpreads; i++) { - int totalProjectiles = (CalamityWorld.LegendaryMode) ? 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); @@ -2348,7 +2348,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; @@ -2547,7 +2547,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(); } @@ -2808,7 +2808,7 @@ 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() && DoGWingdings.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)); // This is how normal combat text spawn positioning is handled diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index d25e1c4524..8b27992d4c 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -157,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) { @@ -274,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 @@ -287,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; @@ -303,7 +301,7 @@ 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 (CalamityWorld.LegendaryMode) diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 7211c06529..34edc4cc71 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -234,10 +234,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) @@ -413,13 +412,13 @@ 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 (CalamityWorld.LegendaryMode) { @@ -432,7 +431,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 @@ -440,7 +439,7 @@ 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 (CalamityWorld.LegendaryMode) { @@ -1179,7 +1178,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Plasma bolts on charge 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); @@ -1670,7 +1669,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(); } diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index cfe07b9bbd..ca4c38e87e 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; @@ -297,10 +296,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]; @@ -604,7 +602,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; @@ -905,7 +903,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[3] = 1f; NPC.velocity *= decelerationVelocityMult; - int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 9 : expertMode ? 8 : 6; + int totalProjectiles = death ? 10 : revenge ? 9 : expertMode ? 8 : 6; if (CalamityWorld.LegendaryMode) totalProjectiles += 4; @@ -918,8 +916,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) @@ -1493,7 +1491,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(); } diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index f87b02ccde..9411a0e7fb 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -143,10 +143,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; @@ -235,7 +234,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) @@ -323,7 +322,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]; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index d2bca3300a..42c0afd1d4 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -148,10 +148,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; @@ -324,7 +323,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; @@ -355,8 +354,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 || diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index e0b2769c32..4bab1a0edf 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -142,10 +142,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; @@ -234,7 +233,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) @@ -335,7 +334,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]; @@ -351,8 +350,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 || diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index e6796f26a9..fd307284be 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -143,10 +143,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; @@ -235,7 +234,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) @@ -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]; @@ -351,8 +350,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 || diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 773dfae0af..3cfe451c13 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -267,10 +267,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) @@ -447,7 +446,7 @@ 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; @@ -491,7 +490,7 @@ 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 (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; @@ -514,7 +513,7 @@ 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; @@ -831,8 +830,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis 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; @@ -933,7 +932,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis * 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); @@ -1096,7 +1095,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 @@ -1589,7 +1588,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(); } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index b63f70659d..4851120345 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -138,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()); @@ -251,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; @@ -361,7 +360,7 @@ 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; @@ -519,7 +518,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 diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index cda5c41620..6ef4e718dc 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -137,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()); @@ -250,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; @@ -360,7 +359,7 @@ 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; @@ -522,7 +521,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 diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 87d8eb9d85..542aacd828 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -250,7 +250,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 : CalamityWorld.LegendaryMode ? 0.5f : 1f); + (CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.6f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : CalamityWorld.LegendaryMode ? 0.5f : 1f); public int CheckForOtherMechs(ref int targetIndex, out bool exoPrimeAlive, out bool exoTwinsAlive) { @@ -294,10 +294,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; @@ -515,7 +514,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 @@ -1242,7 +1241,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(); } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 5413bd2c6c..f9ed2b2893 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -137,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()); @@ -250,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; @@ -360,7 +359,7 @@ 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; @@ -520,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 diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 7b4007893f..2b52e7f81e 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -64,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; diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index 7bc1613875..c50f439d6d 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.HiveMind 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; @@ -85,11 +85,6 @@ namespace CalamityMod.NPCs.HiveMind 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 (BossRushEvent.BossRushActive) - { - velocity *= 2f; - acceleration *= 2f; - } if (NPC.position.Y > Main.player[NPC.target].position.Y - 400f) { diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 9d342a1d85..9149044c05 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -156,10 +156,9 @@ namespace CalamityMod.NPCs.HiveMind 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,16 +188,6 @@ namespace CalamityMod.NPCs.HiveMind driftBoost = 1.5f; } - if (bossRush) - { - lungeRots = 0.4; - minimumDriftTime = 40; - reelbackFade = 10; - lungeTime = 16; - driftSpeed = 6f; - driftBoost = 1f; - } - if (CalamityWorld.LegendaryMode) { reelbackFade *= 10; @@ -349,10 +338,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++) @@ -398,8 +386,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; @@ -437,16 +424,15 @@ 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 ((!player.ZoneCorrupt || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -454,17 +440,17 @@ namespace CalamityMod.NPCs.HiveMind else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCorrupt || bossRush)) + float enrageScale = 0f; + if (biomeEnraged && !player.ZoneCorrupt) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) + if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } @@ -610,8 +596,8 @@ namespace CalamityMod.NPCs.HiveMind if (Main.netMode != NetmodeID.MultiplayerClient) { - int maxSpawns = bossRush ? 10 : death ? 5 : revenge ? 4 : expertMode ? Main.rand.Next(3, 5) : Main.rand.Next(2, 4); - 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++) { @@ -969,7 +955,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.damage = NPC.defDamage; phase2timer = lungeTime - 4 * (int)enrageScale; - NPC.velocity = player.Center + (bossRush ? player.velocity * 20f : Vector2.Zero) - NPC.Center; + NPC.velocity = player.Center - NPC.Center; NPC.velocity.Normalize(); NPC.velocity *= teleportRadius / (lungeTime - (int)enrageScale); dashStarted = true; @@ -1336,7 +1322,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; } diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index 76acabd780..454cfa8f41 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -67,7 +67,6 @@ namespace CalamityMod.NPCs.Leviathan 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; @@ -157,14 +156,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--; @@ -172,12 +170,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; } @@ -234,7 +232,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); @@ -823,9 +821,11 @@ namespace CalamityMod.NPCs.Leviathan if (revenge) chargeVelocity += 2f + (death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio)); - 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); @@ -1017,7 +1017,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; } diff --git a/NPCs/Leviathan/AnahitasIceShield.cs b/NPCs/Leviathan/AnahitasIceShield.cs index 448a2afe0d..c8f89863d4 100644 --- a/NPCs/Leviathan/AnahitasIceShield.cs +++ b/NPCs/Leviathan/AnahitasIceShield.cs @@ -37,8 +37,8 @@ namespace CalamityMod.NPCs.Leviathan 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; diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 6580b9e687..c2db47e9c2 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -93,10 +93,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); @@ -125,13 +124,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; @@ -296,7 +295,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 2217e9e637..a031c11e5f 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -65,8 +65,8 @@ namespace CalamityMod.NPCs.Leviathan 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; @@ -128,10 +128,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 @@ -198,7 +197,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--; @@ -206,12 +205,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; } @@ -439,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 ? 20f : (!sirenAlive || phase4) ? 60f : 40f; + float aberrationSpawnDelay = CalamityWorld.LegendaryMode ? 20f : (!sirenAlive || phase4) ? 60f : 50f; if (NPC.ai[1] > aberrationSpawnDelay) { NPC.ai[1] = 0f; @@ -456,8 +447,8 @@ namespace CalamityMod.NPCs.Leviathan spawnedAberration = true; } - int spawnLimit = CalamityWorld.LegendaryMode ? 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) @@ -806,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; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index d7edd903ae..1778ab0596 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -442,7 +442,7 @@ namespace CalamityMod.NPCs.NormalNPCs 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/KingSlimeJewelRuby.cs b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs index 4e3236cde9..dbb346fda8 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs @@ -25,7 +25,6 @@ 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 override void SetStaticDefaults() @@ -55,8 +54,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 +124,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; @@ -194,7 +192,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/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 54f2db1ffb..0158de4c3e 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -190,10 +190,9 @@ 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 (CalamityWorld.LegendaryMode) @@ -268,15 +267,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; @@ -301,22 +292,22 @@ namespace CalamityMod.NPCs.OldDuke 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; @@ -390,7 +381,7 @@ namespace CalamityMod.NPCs.OldDuke } } - calamityGlobalNPC.newAI[0] -= bossRush ? 1.5f : 1f; + calamityGlobalNPC.newAI[0] -= 1f; if (calamityGlobalNPC.newAI[0] <= 0f) { calamityGlobalNPC.newAI[0] = 0f; @@ -399,14 +390,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))); } @@ -422,11 +413,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; @@ -2089,7 +2080,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(); } diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 662e7c71ae..9203aec38b 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -51,10 +51,9 @@ namespace CalamityMod.NPCs.OldDuke { 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; @@ -113,7 +112,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; } @@ -143,7 +142,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) diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index 0aa8634c7e..f2692d5014 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -70,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) { @@ -102,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) { @@ -142,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; diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index cdf85ca5fc..7050cc53a2 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -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; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index c55f7f7356..ebe58856f4 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -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; @@ -76,8 +74,7 @@ namespace CalamityMod.NPCs.Perforator public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.realLife = -1; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 02c83c47b5..2cfea10d43 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -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; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 490949c1c6..95cfa32ad3 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 @@ -73,9 +74,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; @@ -116,10 +115,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; + 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) @@ -132,7 +130,7 @@ namespace CalamityMod.NPCs.Perforator Player player = Main.player[NPC.target]; // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) + if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -140,12 +138,12 @@ namespace CalamityMod.NPCs.Perforator else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCrimson || bossRush)) + float enrageScale = 0f; + if (biomeEnraged && !player.ZoneCrimson) enrageScale += 1f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) + if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) enrageScale += 1f; // Percent life remaining @@ -632,11 +630,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 88cfa95580..878b4b2717 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,7 @@ namespace CalamityMod.NPCs.Perforator public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfMediumDeath"); public static Asset GlowTexture; - + private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; public override void SetStaticDefaults() { NPCID.Sets.BossBestiaryPriority.Add(Type); @@ -69,9 +70,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; @@ -100,15 +99,23 @@ 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; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float enrageScale = bossRush ? 1f : 0f; - if ((NPC.position.Y / 16f) < Main.worldSurface || bossRush) + if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) + { + if (biomeEnrageTimer > 0) + biomeEnrageTimer--; + } + else + biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; + + bool biomeEnraged = biomeEnrageTimer <= 0 && !BossRushEvent.BossRushActive; + float enrageScale = 0f; + if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) enrageScale += 1f; - if (!Main.player[NPC.target].ZoneCrimson || bossRush) + if (biomeEnraged && !Main.player[NPC.target].ZoneCrimson) enrageScale += 1f; // Total body segments @@ -568,11 +575,8 @@ namespace CalamityMod.NPCs.Perforator } } - 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() { diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index af6c850ffd..a1a9b28921 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 @@ -73,9 +74,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; @@ -112,13 +111,12 @@ 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; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Enrage - if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) + if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -126,12 +124,12 @@ namespace CalamityMod.NPCs.Perforator else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!Main.player[NPC.target].ZoneCrimson || bossRush)) + float enrageScale = 0f; + if (biomeEnraged && !Main.player[NPC.target].ZoneCrimson) enrageScale += 1f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) + if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) enrageScale += 1f; // Percent life remaining @@ -553,11 +551,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 5e1032532b..a6ee61ee34 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -136,13 +136,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]; @@ -154,7 +153,7 @@ namespace CalamityMod.NPCs.Perforator bool phase2 = lifeRatio < 0.7f; // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) + if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -162,17 +161,17 @@ namespace CalamityMod.NPCs.Perforator else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCrimson || bossRush)) + float enrageScale = 0f; + if (biomeEnraged && !player.ZoneCrimson) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) + if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1f; } @@ -320,7 +319,7 @@ namespace CalamityMod.NPCs.Perforator // Emit ichor blobs if (phase2) { - if (wormsAlive == 0 || large || bossRush || floatAboveToFireBlobs || CalamityWorld.LegendaryMode) + if (wormsAlive == 0 || large || floatAboveToFireBlobs || CalamityWorld.LegendaryMode) { NPC.ai[2] += 1f; if (NPC.ai[2] >= blobPhaseGateValue) @@ -328,7 +327,7 @@ 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; } @@ -362,7 +361,7 @@ namespace CalamityMod.NPCs.Perforator { 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) blobVelocity *= Main.rand.NextFloat() + 1f; @@ -556,7 +555,7 @@ namespace CalamityMod.NPCs.Perforator NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.HealingPotion; } diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index dc19841b3c..6cd8a641a4 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -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; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 76125c7858..166adf31ff 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -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; @@ -76,8 +74,7 @@ namespace CalamityMod.NPCs.Perforator public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.realLife = -1; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index b808b7af4b..b3acc752b3 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -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; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index fd4826d020..3645aa3d7a 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -50,10 +50,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath 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); @@ -108,7 +107,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(); @@ -130,7 +129,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)) diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index a2ed21c379..93acd2daea 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -48,9 +48,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath 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); @@ -74,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(); @@ -90,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; @@ -98,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); } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 9281228a76..652243aaa9 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -155,10 +155,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; @@ -226,7 +225,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--; @@ -234,12 +233,12 @@ 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; } @@ -249,10 +248,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath 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; @@ -628,7 +624,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; @@ -975,15 +971,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); } } @@ -1311,7 +1306,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; } diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 4debb61586..3920518521 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -94,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) { @@ -139,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) @@ -173,15 +172,14 @@ 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 @@ -229,7 +227,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); diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 34c8d983cf..67663ed07a 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 }; @@ -200,12 +200,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); @@ -328,7 +327,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--; @@ -413,15 +412,14 @@ 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 @@ -469,7 +467,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); @@ -946,7 +944,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(); } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 0fa397c0ba..0ce1497e82 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -212,7 +212,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 @@ -1475,7 +1475,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(); } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index f1b31b2df7..811c32bb2b 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -150,10 +150,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; @@ -356,7 +355,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; @@ -364,13 +363,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; + float maxChargeVelocity = death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; 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) @@ -453,7 +452,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (!goLow && !goLowPhase2 && !goHigh) calamityGlobalNPC.newAI[0] = -NPC.direction; - float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (CalamityWorld.LegendaryMode) velocity *= 1.25f; if (healerAlive) @@ -490,7 +489,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) @@ -504,7 +503,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) @@ -518,7 +517,7 @@ 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); @@ -531,8 +530,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++) { @@ -551,7 +550,7 @@ 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) @@ -664,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; @@ -685,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) { @@ -788,7 +787,7 @@ 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; + float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (CalamityWorld.LegendaryMode) velocity *= 1.25f; if (boostVelocityToCatchUp) @@ -800,7 +799,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; @@ -845,7 +844,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } else if (NPC.ai[1] % spearShootDivisor == 0f) { - float spearVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float spearVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (CalamityWorld.LegendaryMode) spearVelocity *= 1.25f; if (boostVelocityToCatchUp) @@ -863,8 +862,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++) { @@ -900,7 +899,7 @@ 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 (CalamityWorld.LegendaryMode) @@ -956,7 +955,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); @@ -1203,7 +1202,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) { diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 1c4285e11a..0411425f6d 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -238,17 +238,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; @@ -257,7 +256,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; + float maxChargeVelocity = death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; @@ -377,7 +376,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - float moveVelocity = bossRush ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; + float moveVelocity = death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; if (CalamityWorld.LegendaryMode) moveVelocity *= 1.25f; if (healerAlive) @@ -427,7 +426,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) { @@ -497,7 +496,7 @@ 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) @@ -604,7 +603,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; @@ -625,7 +624,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) { @@ -637,7 +636,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 diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index 6b993aa7a1..c20b287e69 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -104,7 +104,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; @@ -160,10 +160,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; @@ -212,7 +211,7 @@ 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); + float velocity = useCrystalShards ? (death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); if (CalamityWorld.LegendaryMode) velocity *= 1.25f; @@ -263,7 +262,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 @@ -300,7 +299,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { 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; @@ -339,7 +338,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; @@ -400,7 +399,7 @@ 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 (CalamityWorld.LegendaryMode) diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 379bf88d68..46241f8f75 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -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 @@ -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/Providence.cs b/NPCs/Providence/Providence.cs index 109b45d510..6c241b743e 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -355,12 +355,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; @@ -418,7 +416,7 @@ namespace CalamityMod.NPCs.Providence else if (fullPowerAI) projectileDamageMult = 2; - NPC.Calamity().CurrentlyEnraged = !bossRush && fullPowerAI; + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && fullPowerAI; // Projectile damage values int holyLaserDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; @@ -447,13 +445,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; @@ -857,7 +851,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; @@ -875,10 +869,8 @@ 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 (CalamityWorld.LegendaryMode) @@ -925,8 +917,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) @@ -1158,7 +1150,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); @@ -1203,8 +1195,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); @@ -1252,7 +1242,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); @@ -1296,7 +1286,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; @@ -1442,8 +1432,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); @@ -1487,7 +1475,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); @@ -1546,7 +1534,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)); @@ -2096,7 +2084,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(); } @@ -2762,7 +2750,7 @@ 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; // 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/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 736f120786..200da5f0c8 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -146,10 +146,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; @@ -224,14 +223,6 @@ namespace CalamityMod.NPCs.Ravager if (immunePhase) { NPC.dontTakeDamage = true; - if (bossRush) - { - foreach (Player p in Main.ActivePlayers) - { - if (!p.dead && revenge) - p.AddBuff(ModContent.BuffType(), 2); - } - } } else { @@ -523,11 +514,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; @@ -718,7 +709,7 @@ namespace CalamityMod.NPCs.Ravager { if (phase2) { - float stopBeforeFallTime = bossRush ? 25f : 30f; + float stopBeforeFallTime = 30f; if (!anyHeadActive) stopBeforeFallTime -= 15f; else if (expertMode) @@ -735,7 +726,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]; @@ -752,7 +743,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]; @@ -763,7 +754,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); @@ -812,11 +803,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]; @@ -833,7 +819,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(); @@ -1007,7 +993,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/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 170c064e17..97304365b3 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -56,7 +56,6 @@ namespace CalamityMod.NPCs.Ravager 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/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index d66745ec30..773a444c11 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -61,9 +61,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; @@ -103,7 +102,7 @@ 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(); diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index fbfe1ee64b..3795816de8 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -96,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; diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index cf8356ea68..a3869b462e 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -113,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/Signus.cs b/NPCs/Signus/Signus.cs index a71f658b44..84b2a7dcd4 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -126,10 +126,9 @@ 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; @@ -138,8 +137,8 @@ namespace CalamityMod.NPCs.Signus 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; + float inertia = death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; + float chargeVelocity = death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; if (CalamityWorld.LegendaryMode) { inertia *= 0.5f; @@ -248,7 +247,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); @@ -290,7 +289,7 @@ namespace CalamityMod.NPCs.Signus 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); @@ -353,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)); @@ -470,7 +469,7 @@ namespace CalamityMod.NPCs.Signus 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; @@ -510,8 +509,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) { @@ -632,7 +631,7 @@ namespace CalamityMod.NPCs.Signus // 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); @@ -913,7 +912,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(); } diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index f282473c9b..edeb7532dd 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -79,10 +79,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; @@ -112,7 +111,7 @@ namespace CalamityMod.NPCs.SlimeGod 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; @@ -238,9 +237,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - enraged = true; - if (NPC.localAI[1] != 1f) { if (enraged) @@ -339,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) { @@ -716,7 +712,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) @@ -749,7 +745,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 e46d7cec1a..334b34c5be 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -83,10 +83,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; @@ -157,12 +156,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - { - enraged = true; - hyperMode = true; - } - // For animating the wings NPC.localAI[0] += 1f; @@ -269,7 +262,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; @@ -433,7 +426,7 @@ 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) @@ -495,13 +488,13 @@ namespace CalamityMod.NPCs.SlimeGod // Charge variables float chargeVelocityMult = 0.1f; - float maxChargeVelocity = (bossRush || enraged) ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; + float maxChargeVelocity = enraged ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; 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 (CalamityWorld.LegendaryMode) @@ -541,7 +534,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; @@ -559,7 +552,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) { @@ -648,7 +641,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) @@ -681,7 +674,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) @@ -760,13 +753,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 7cb9a5240b..2d29bf7301 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -196,13 +196,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; @@ -488,7 +486,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; @@ -530,8 +528,6 @@ namespace CalamityMod.NPCs.SlimeGod flySpeed += 3f; if (phase2) flySpeed *= 1.1f; - if (bossRush) - flySpeed *= 1.2f; if (CalamityWorld.LegendaryMode) flySpeed *= 1.3f; @@ -710,7 +706,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/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 6ff6104ed6..42c34c95c1 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -94,10 +94,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; @@ -127,7 +126,7 @@ namespace CalamityMod.NPCs.SlimeGod 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; @@ -169,9 +168,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - enraged = true; - if (NPC.localAI[1] != 1f) { if (enraged) @@ -271,7 +267,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) { @@ -655,7 +651,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) @@ -688,7 +684,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 f6fb30c3a2..5ec2ecb787 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -94,10 +94,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; @@ -123,7 +122,7 @@ namespace CalamityMod.NPCs.SlimeGod 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; @@ -162,12 +161,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) { @@ -261,7 +254,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) { @@ -685,7 +678,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) @@ -718,7 +711,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 e8d3e9309a..f206fc6aa3 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -60,9 +60,7 @@ 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; @@ -98,10 +96,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; @@ -143,7 +140,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; @@ -235,7 +232,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Calculate contact damage based on velocity - float velocity = (phase2 ? 12f : 10f) + (bossRush ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); + float velocity = (phase2 ? 12f : 10f) + (revenge ? 1.5f : expertMode ? 1f : 0f); float minimalContactDamageVelocity = velocity * 0.25f; float minimalDamageVelocity = velocity * 0.5f; float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); @@ -259,10 +256,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; @@ -270,7 +266,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; @@ -296,17 +292,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; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 903126d03b..048364eb1a 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -112,9 +112,7 @@ 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; @@ -168,14 +166,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; @@ -330,8 +327,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) @@ -355,7 +352,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) @@ -815,7 +812,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); @@ -837,10 +834,9 @@ 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; @@ -848,7 +844,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; @@ -874,17 +870,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; @@ -951,7 +946,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 6c52c62b22..5ac021a23c 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -59,9 +59,7 @@ 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; @@ -111,9 +109,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; @@ -147,7 +144,7 @@ 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; @@ -231,7 +228,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Calculate contact damage based on velocity - float velocity = (phase2 ? 12f : 10f) + (bossRush ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); + float velocity = (phase2 ? 12f : 10f) + (revenge ? 1.5f : expertMode ? 1f : 0f); float minimalContactDamageVelocity = velocity * 0.25f; float minimalDamageVelocity = velocity * 0.5f; float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); @@ -255,10 +252,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; @@ -266,7 +262,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; @@ -300,17 +296,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; 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..74e37f921d 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; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 37ab41f7fa..5feceaae21 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -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) @@ -163,8 +163,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; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 43971f00dc..e331c4fb42 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -442,10 +442,9 @@ 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; @@ -464,16 +463,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas 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(); @@ -503,7 +492,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!startText) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalSummonText"; if (permafrost) @@ -681,13 +670,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 { @@ -774,7 +761,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); @@ -1023,7 +1010,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH2Text"; if (permafrost) @@ -1148,7 +1135,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH3Text"; if (permafrost) @@ -1353,7 +1340,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH4Text"; if (permafrost) @@ -1504,7 +1491,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (permafrost) key = "Mods.CalamityMod.Status.Boss.PermafrostBH5Text"; - if (!bossRush) + if (!BossRushEvent.BossRushActive) { if (DownedBossSystem.downedCalamitas && !permafrost) key += "Rematch"; @@ -1615,7 +1602,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } - 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); @@ -1705,7 +1692,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - if (bossRush) + if (BossRushEvent.BossRushActive) NPC.Center = initialRitualPosition + new Vector2(0, -30); if (NPC.velocity.Y < 8f) @@ -1713,11 +1700,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; @@ -1739,15 +1726,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); } @@ -1807,7 +1794,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText4"; if (permafrost) @@ -1823,7 +1810,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) @@ -1837,7 +1824,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) @@ -1851,7 +1838,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) @@ -1922,7 +1909,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) @@ -1940,7 +1927,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (!secondStage) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalSeekerRingText"; if (permafrost) @@ -3395,7 +3382,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(); } diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 3254b036d4..3dc5c8320c 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -178,13 +178,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; @@ -323,7 +322,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) @@ -337,8 +336,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -388,9 +385,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; @@ -405,8 +402,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; Vector2 fistSpawnPosition = NPC.Center + Vector2.UnitX * 74f * NPC.direction; if ((broIsAlive == false ? BigAttackLimit <= 3 && BigAttackLimit > 0 : BigAttackLimit == 1) && death) diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 4a0edd09e5..8985549edc 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -172,10 +172,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; @@ -272,8 +271,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas 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); dashes++; @@ -370,7 +367,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) { @@ -383,8 +380,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; Vector2 slashSpawnPosition = NPC.Center + Vector2.UnitX * 125f * NPC.direction; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -436,7 +431,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; @@ -450,8 +445,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; Vector2 slashSpawnPosition = NPC.Center; Vector2 firingVelocity = (broIsAlive == false ? (NPC.DirectionTo(Target.Center) + Target.velocity * 0.032f).SafeNormalize(Vector2.UnitY) : NPC.DirectionTo(Target.Center)); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index fabcacbcb3..805e23757a 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -21,8 +21,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // 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,7 +33,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - 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; @@ -42,20 +41,20 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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) + float enrageScale = death ? 0.5f : 0f; + if ((npc.position.Y / 16f) < Main.worldSurface && enrage) { - npc.Calamity().CurrentlyEnraged = !bossRush; + npc.Calamity().CurrentlyEnraged = true; enrageScale += 0.5f; } - if (!Main.player[npc.target].ZoneCrimson || bossRush) + if (!Main.player[npc.target].ZoneCrimson && enrage) { - npc.Calamity().CurrentlyEnraged = !bossRush; + npc.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } // Despawn check - bool despawn = Main.player[npc.target].dead && !bossRush; + bool despawn = Main.player[npc.target].dead; // Despawn if (despawn) @@ -859,15 +858,14 @@ 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; + float enrageScale = death ? 0.5f : 0f; if ((npc.position.Y / 16f) < Main.worldSurface) enrageScale += 0.5f; if (!Main.player[npc.target].ZoneCrimson) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs index 53ba9c333f..62da8e5ebf 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs @@ -35,8 +35,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); @@ -70,19 +69,6 @@ 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) - { - iceMistFireRate = 40; - iceMistSpeed = 14f; - iceMistAmt = 3; - fireballFireRate = 8; - fireballSpeed *= 1.2f; - lightningOrbPhaseTime = 90; - ancientLightSpawnRate = 20; - ancientLightAmt = 4; - idleTime = 20; - } - if (CalamityWorld.LegendaryMode) { iceMistFireRate = 30; @@ -1094,8 +1080,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; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs index c4d0b9f78a..8b178b34e6 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs @@ -34,8 +34,7 @@ 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; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 9e6163bd23..7934f5bd09 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -31,7 +31,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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; @@ -67,8 +66,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,10 +120,10 @@ 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) + float enrageScale = 0f; + if (Main.IsItDay()) { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; + calamityGlobalNPC.CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 2f; } @@ -248,7 +246,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.type == NPCID.TheDestroyerBody) { // Enrage, fire more cyan lasers - if (enrageScale > 0f && !bossRush) + if (enrageScale > 0f) { if (calamityGlobalNPC.newAI[2] < 480f) calamityGlobalNPC.newAI[2] += 1f; @@ -349,7 +347,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) { @@ -428,7 +426,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - if (calamityGlobalNPC.newAI[2] > 0f || bossRush) + if (calamityGlobalNPC.newAI[2] > 0f) calamityGlobalNPC.destroyerLaserColor = 2; npc.SyncDestroyerLaserColor(); @@ -1060,8 +1058,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedProbeAI(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) @@ -1072,8 +1069,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) @@ -1175,7 +1172,7 @@ 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; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index 6655805af2..ddb1421ec3 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -19,8 +19,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); @@ -106,7 +105,7 @@ 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; @@ -144,21 +143,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 +171,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bubbleSpinPhaseDivisor = 1; bubbleSpinBubbleVelocity = 15f; - if (!bossRush) - { - setDamage *= 2; - npc.defense = npc.defDefense * 3; - } + setDamage *= 2; + npc.defense = npc.defDefense * 3; } if (death) @@ -228,15 +224,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) @@ -960,7 +947,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 diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 392bbf42bc..132e76bf5f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -21,8 +21,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; // 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,7 +37,7 @@ 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; + bool enrage = !BossRushEvent.BossRushActive; int targetTileX = (int)Main.player[npc.target].Center.X / 16; int targetTileY = (int)Main.player[npc.target].Center.Y / 16; @@ -47,14 +46,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses enrage = false; float enrageScale = 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].ZoneCorrupt || bossRush) + if (!Main.player[npc.target].ZoneCorrupt && enrage) { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; + calamityGlobalNPC.CurrentlyEnraged = true; enrageScale += 2f; } @@ -543,7 +542,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Despawn bool shouldDespawn = npc.type == NPCID.EaterofWorldsHead && Main.player[npc.target].dead; - if (shouldDespawn && !bossRush) + if (shouldDespawn) { bool everyoneDead = true; for (int i = 0; i < Main.maxPlayers; i++) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index 7476547f4f..ef21e65935 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -17,8 +17,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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; @@ -44,7 +43,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; + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && dayTimeEnrage; int projectileDamageMultiplier = dayTimeEnrage ? 2 : 1; @@ -354,7 +353,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; @@ -676,7 +675,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; @@ -1211,7 +1210,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 a7566146c1..2b50234d9d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -23,8 +23,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; @@ -43,10 +42,10 @@ 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; + float enrageScale = death ? 0.5f : 0f; if (Main.IsItDay()) { - npc.Calamity().CurrentlyEnraged = !bossRush; + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 2f; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index c2bb3a2dcf..b2795a7342 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -22,8 +22,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; @@ -46,8 +45,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) { @@ -58,15 +57,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || CalamityWorld.LegendaryMode) + 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); @@ -511,7 +510,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.dust[fiery2].velocity.X *= 2f; } - float projectileVelocity = death ? 11f : 7.25f; + float projectileVelocity = death ? 7.5f : 4.75f; if (enrage) projectileVelocity *= 1.5f; if (turboEnrage) @@ -522,12 +521,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center; destination.Normalize(); destination *= projectileVelocity; - int totalFireballsPerSide = 2; - int totalIterations = (turboEnrage && CalamityWorld.LegendaryMode) ? 11 : death ? 25 : 35; + int totalFireballsPerSide = 3; + 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))); @@ -692,14 +691,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; @@ -708,12 +706,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || CalamityWorld.LegendaryMode) + if (CalamityWorld.LegendaryMode) enrage = true; float aggression = turboEnrage ? (CalamityWorld.LegendaryMode ? 4f : 3f) : enrage ? 2f : death ? 1.7f : 1f; @@ -978,8 +976,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); @@ -990,9 +987,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.Center = Main.npc[NPC.golemBoss].Center - new Vector2(3f, 57f) * npc.scale; // 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; @@ -1001,12 +998,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || CalamityWorld.LegendaryMode) + if (CalamityWorld.LegendaryMode) enrage = true; // Alpha @@ -1227,16 +1224,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float golemLifeRatio = Main.npc[NPC.golemBoss].life / (float)Main.npc[NPC.golemBoss].lifeMax; // Phases - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase2 = lifeRatio < 0.7f || golemLifeRatio < 0.85f || death; bool phase3 = lifeRatio < 0.55f || golemLifeRatio < 0.7f || death; bool phase4 = lifeRatio < 0.4f || golemLifeRatio < 0.55f || death; // 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; @@ -1245,12 +1241,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || CalamityWorld.LegendaryMode; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || CalamityWorld.LegendaryMode) + if (CalamityWorld.LegendaryMode) enrage = true; if (turboEnrage) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index fde22e50e2..c97b951193 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -33,8 +33,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses teleportScale *= teleportScaleSpeed; } - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Phases based on life percentage @@ -241,7 +240,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; } @@ -441,7 +440,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 +462,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 +497,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) @@ -523,13 +517,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { 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; } @@ -620,7 +614,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 7b5a439579..e98a738be2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs @@ -21,8 +21,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; int aggressionLevel = 4; if (npc.type == NPCID.MoonLordCore || npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) @@ -45,9 +44,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (bossRush) - aggressionLevel = 5; - if (CalamityWorld.LegendaryMode) aggressionLevel = 6; @@ -1169,7 +1165,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int damage = npc.GetProjectileDamage(type); int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), handAttackMovement, handAttackDirection, type, damage, 0f, Main.myPlayer, 0f, ai); Main.projectile[proj].timeLeft = 1200; - Main.projectile[proj].Calamity().lineColor = bossRush ? 1 : aggressionLevel; + Main.projectile[proj].Calamity().lineColor = aggressionLevel; } } else diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index 58c09def7a..2fc7601040 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -31,8 +31,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) @@ -56,11 +55,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int reducedSetDamage = (int)Math.Round(setDamage * 0.5); // Variables and target - bool enrage = bossRush; + bool enrage = !BossRushEvent.BossRushActive; 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 +120,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); @@ -395,7 +394,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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) { @@ -793,8 +792,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); @@ -968,7 +965,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 +986,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; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 057044ce51..14880299e8 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -23,10 +23,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,23 +35,20 @@ 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 (CalamityWorld.LegendaryMode) enrageScale += 1f; - if (bossRush) - enrageScale = 2f; - if (enrageScale > maxEnrageScale) enrageScale = maxEnrageScale; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index c46b92bfc1..46ec34802e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -15,8 +15,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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 +207,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 +271,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 +311,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; @@ -388,7 +387,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 +399,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 +427,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 +441,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 +464,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target >= Main.maxPlayers) break; - float jumpVelocity = bossRush ? 9f : death ? 7f : 4.5f; + 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) @@ -624,8 +623,8 @@ 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; + npc.velocity.Y += death ? 1.75f : 1.5f; + float slamVelocity = death ? 15.5f : 15f; if (CalamityWorld.LegendaryMode) { npc.velocity.Y += 1f; @@ -701,7 +700,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; @@ -921,14 +920,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; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index bb95bf2971..641afdf1a7 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -22,8 +22,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; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -139,7 +138,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); @@ -157,38 +156,38 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool handsDead = numHandsAlive == 0; int numProj = CalamityWorld.LegendaryMode ? 22 : death ? 5 : 3; float spread = CalamityWorld.LegendaryMode ? 180 : 60; - float headSpinVelocityMult = bossRush ? (phase3 ? 18f : 9f) : (phase3 ? 12f : 4.5f); + float headSpinVelocityMult = phase3 ? 12f : 4.5f; switch (numHandsAlive) { case 0: numProj = CalamityWorld.LegendaryMode ? 36 : death ? 9 : 7; spread = CalamityWorld.LegendaryMode ? 180 : death ? 90 : 82; - headSpinVelocityMult = bossRush ? (phase3 ? 18f : 12f) : (phase3 ? 12f : 6f); + headSpinVelocityMult = phase3 ? 12f : 6f; break; case 1: numProj = CalamityWorld.LegendaryMode ? 27 : death ? 7 : 5; spread = CalamityWorld.LegendaryMode ? 150 : death ? 76 : 68; - headSpinVelocityMult = bossRush ? (phase3 ? 15f : 10f) : (phase3 ? 11.5f : 5f); + headSpinVelocityMult = phase3 ? 11.5f : 5f; break; case 2: numProj = CalamityWorld.LegendaryMode ? 18 : death ? 6 : 4; spread = CalamityWorld.LegendaryMode ? 140 : death ? 70 : 62; - headSpinVelocityMult = bossRush ? (phase3 ? 13.5f : 9f) : (phase3 ? 11f : 4.5f); + headSpinVelocityMult = phase3 ? 11f : 4.5f; break; case 3: numProj = CalamityWorld.LegendaryMode ? 15 : death ? 5 : 3; spread = CalamityWorld.LegendaryMode ? 130 : death ? 64 : 56; - headSpinVelocityMult = bossRush ? (phase3 ? 12f : 8f) : (phase3 ? 10.5f : 4f); + headSpinVelocityMult = phase3 ? 10.5f : 4f; break; case 4: numProj = CalamityWorld.LegendaryMode ? 12 : death ? 4 : 3; spread = CalamityWorld.LegendaryMode ? 120 : 56; - headSpinVelocityMult = bossRush ? (phase3 ? 10f : 7f) : (phase3 ? 10f : 3.5f); + headSpinVelocityMult = phase3 ? 10f : 3.5f; break; } @@ -207,7 +206,7 @@ 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; @@ -272,7 +271,7 @@ 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 @@ -347,7 +346,7 @@ 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; + float skullProjFrequency = phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; if (CalamityWorld.LegendaryMode) skullProjFrequency *= 0.8f; skullProjFrequency = (float)Math.Ceiling(skullProjFrequency); @@ -360,7 +359,7 @@ 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; @@ -432,12 +431,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float headXTopSpeed = headXAcceleration * 100f; float deceleration = CalamityWorld.LegendaryMode ? 0.83f : death ? 0.86f : 0.89f; - if (bossRush) - { - headYAcceleration *= 1.25f; - headXAcceleration *= 1.25f; - } - float moveAwayGateValue = chargePhaseGateValue - (5f + chargePhaseChangeRate); bool moveAwayBeforeCharge = npc.ai[2] >= moveAwayGateValue; if (moveAwayBeforeCharge) @@ -704,7 +697,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!phase3) { float velocityBoost = MathHelper.Lerp(0f, 3f, (1f - lifeRatio) / (1f - phase3LifeRatio)); - if (handsDead || bossRush) + if (handsDead) headSpinVelocityMult += velocityBoost; } @@ -732,7 +725,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; } @@ -810,8 +803,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) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index e682c73553..ba08d0ffc7 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -21,8 +21,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) @@ -122,7 +121,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) @@ -190,7 +189,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) { @@ -283,7 +282,7 @@ 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); @@ -341,7 +340,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) @@ -493,9 +492,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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 @@ -597,8 +596,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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); @@ -659,8 +658,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) @@ -719,7 +717,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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) { @@ -823,7 +821,7 @@ 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); @@ -890,7 +888,7 @@ 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); @@ -927,8 +925,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) @@ -1041,7 +1038,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) { @@ -1189,8 +1186,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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))); @@ -1206,8 +1203,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) @@ -1271,7 +1267,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // 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) { @@ -1361,7 +1357,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) { @@ -1454,7 +1450,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - float chargeVelocity = bossRush ? 20f : 16f; + float chargeVelocity = 16f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1522,7 +1518,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - float chargeVelocity = bossRush ? 17.5f : 14f; + float chargeVelocity = 14f; if (!cannonAlive) chargeVelocity += 1f; if (!laserAlive) @@ -1574,8 +1570,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) @@ -1637,7 +1632,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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) { @@ -1723,7 +1718,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) { @@ -1810,7 +1805,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - float chargeVelocity = bossRush ? 27.5f : 22f; + float chargeVelocity = 22f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1846,7 +1841,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - float chargeVelocity = bossRush ? 13.5f : 11f; + float chargeVelocity = 11f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1864,7 +1859,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 ebe3e2c98f..ad4c94e90f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -17,8 +17,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) @@ -28,10 +27,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = death ? 0.3f : 0f; + if (Main.IsItDay()) { - npc.Calamity().CurrentlyEnraged = !bossRush; + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 1f; } @@ -734,8 +733,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) @@ -745,10 +743,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; - if (Main.IsItDay() || bossRush) + float enrageScale = death ? 0.3f : 0f; + if (Main.IsItDay()) { - npc.Calamity().CurrentlyEnraged = !bossRush; + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; enrageScale += 1f; } @@ -1357,7 +1355,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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) @@ -1396,7 +1394,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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); @@ -1512,7 +1510,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses 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; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 25f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index e94a7788b1..04c820a6cb 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -20,8 +20,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; // Despawn if (npc.position.X < 160f || npc.position.X > ((Main.maxTilesX - 10) * 16)) @@ -88,8 +87,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; @@ -252,9 +249,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 +298,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,7 +312,7 @@ 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) @@ -439,9 +430,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 +537,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; @@ -702,8 +690,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 +801,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); diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index c62980823c..ad7517e5bd 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -198,12 +198,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; @@ -213,7 +210,7 @@ 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; } @@ -252,7 +249,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; @@ -271,8 +268,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; @@ -281,17 +278,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; @@ -366,12 +363,12 @@ namespace CalamityMod.NPCs.Yharon enraged = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 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 : CalamityWorld.LegendaryMode ? 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 : CalamityWorld.LegendaryMode ? 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 : 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 @@ -407,17 +404,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; } } @@ -440,7 +437,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) @@ -557,12 +554,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; } @@ -609,7 +606,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -656,7 +653,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -673,7 +670,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -724,7 +721,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -800,7 +797,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -838,12 +835,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; } @@ -893,7 +890,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -986,7 +983,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1004,7 +1001,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1023,7 +1020,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1128,7 +1125,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1205,12 +1202,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; } @@ -1263,7 +1260,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1356,7 +1353,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1374,7 +1371,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1400,7 +1397,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1507,7 +1504,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1597,7 +1594,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1616,7 +1613,7 @@ 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; @@ -1727,21 +1724,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; @@ -1749,20 +1746,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; @@ -1779,7 +1776,7 @@ 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 / 15 + (secondPhasePhase == 4 ? spinPhaseTimer / 60 : 0); @@ -1794,16 +1791,16 @@ 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; @@ -1999,7 +1996,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); @@ -2056,7 +2053,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); @@ -2133,7 +2130,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * chargeSpeed; @@ -2165,7 +2162,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; @@ -2184,7 +2181,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) @@ -2232,7 +2229,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * fireballBreathPhaseVelocity; @@ -2296,7 +2293,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); @@ -2468,7 +2465,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) @@ -2533,7 +2530,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) { @@ -2592,10 +2589,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: @@ -2603,13 +2600,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); @@ -2617,13 +2614,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; @@ -3012,7 +3009,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(); } @@ -3107,7 +3104,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/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index 3da901c212..f2e9d814cd 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -37,12 +37,11 @@ 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; + Projectile.timeLeft = death ? 60 : revenge ? 68 : expertMode ? 75 : 90; if (CalamityWorld.LegendaryMode) Projectile.timeLeft /= 2; } @@ -78,13 +77,12 @@ 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; + float telegraphTotalTime = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; if (CalamityWorld.LegendaryMode) telegraphTotalTime *= 0.5f; diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index 569a7b3921..42b5160a1d 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -35,7 +35,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 +55,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); @@ -164,7 +164,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; diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 6b95f59bbb..563bd7fed5 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]; 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 1881f84842..2693b4a241 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -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(); @@ -125,7 +124,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; // 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 +137,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); diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index 5dd72d425e..9588221e55 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -34,7 +34,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) @@ -57,7 +57,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); @@ -162,7 +162,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) 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 a0220bfd95..38eede7c02 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss if (Velocity != Vector2.Zero) { Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index 1d1de9d9f3..2242660b7a 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -40,10 +40,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; Projectile.frameCounter++; if (Projectile.frameCounter > 4) @@ -104,8 +103,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]; diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 82f15bd2a2..34eee8c747 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(); diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 0913198f87..e0d36a0248 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -48,8 +48,6 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - int target = Player.FindClosest(Projectile.Center, 1, 1); float targetDist; @@ -60,7 +58,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(); diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index c734f9520a..92cded34d9 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; } diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index c5955b1f99..8f2f6b0ce0 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -114,13 +114,12 @@ 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(); 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/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 6023f80dfa..2b152da1fe 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -1,11 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using CalamityMod.Graphics.Primitives; -using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; -using CalamityMod.NPCs.TownNPCs; using CalamityMod.Particles; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -13,7 +8,6 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -111,8 +105,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 +121,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; } diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 4874585c60..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); diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 2c3b539632..4ae37dde93 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -50,7 +50,7 @@ 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; 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/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/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..b701bec6ac 100644 --- a/Projectiles/Boss/RavagerNuke.cs +++ b/Projectiles/Boss/RavagerNuke.cs @@ -36,8 +36,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 +52,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/SCalBrimstoneFireblast.cs b/Projectiles/Boss/SCalBrimstoneFireblast.cs index 81036fdca1..c8ae0a8a65 100644 --- a/Projectiles/Boss/SCalBrimstoneFireblast.cs +++ b/Projectiles/Boss/SCalBrimstoneFireblast.cs @@ -197,16 +197,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; diff --git a/Projectiles/Boss/SCalBrimstoneGigablast.cs b/Projectiles/Boss/SCalBrimstoneGigablast.cs index 92d27f5bc5..e9d0c5bc16 100644 --- a/Projectiles/Boss/SCalBrimstoneGigablast.cs +++ b/Projectiles/Boss/SCalBrimstoneGigablast.cs @@ -181,16 +181,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; diff --git a/Projectiles/Boss/SupremeCataclysmFist.cs b/Projectiles/Boss/SupremeCataclysmFist.cs index edb9e872bf..ebc27bf2d3 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) diff --git a/Projectiles/Boss/SupremeCatastropheSlash.cs b/Projectiles/Boss/SupremeCatastropheSlash.cs index afa91f3d53..0e6a90038c 100644 --- a/Projectiles/Boss/SupremeCatastropheSlash.cs +++ b/Projectiles/Boss/SupremeCatastropheSlash.cs @@ -46,10 +46,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 7ee16eee49..e17154f9d9 100644 --- a/Projectiles/Boss/THanosSideLaser.cs +++ b/Projectiles/Boss/THanosSideLaser.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Boss if (Velocity != Vector2.Zero) { Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index b0ae9f8529..578220cb13 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; @@ -146,7 +145,7 @@ 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(); diff --git a/Projectiles/Boss/ThanatosLaser.cs b/Projectiles/Boss/ThanatosLaser.cs index 474cf05d03..a8d06e422c 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Boss if (Velocity != Vector2.Zero) { Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Boss if (Velocity != Vector2.Zero) { Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs index c1c879d50c..8b54687e48 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; diff --git a/Projectiles/Boss/UnstableCrimulanGlob.cs b/Projectiles/Boss/UnstableCrimulanGlob.cs index c8a8e560da..3db3a7a054 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss 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 (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; @@ -50,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 96aff26ff3..95ef39e3df 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss 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 (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; @@ -33,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/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 4018e6c6a9..c452f59d70 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -349,10 +349,6 @@ namespace CalamityMod.Projectiles if (e.Context == "SetBonus_GhostHurt") projectile.damage /= 2; } - - // Nerfed Seedler projectile damage by 25% - if (source is EntitySource_ItemUse_WithAmmo ea && ea.Item.type == ItemID.Seedler) - projectile.damage = (int)(projectile.damage * 0.75f); } 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(); @@ -521,10 +517,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) { @@ -563,7 +559,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; @@ -3234,6 +3230,13 @@ namespace CalamityMod.Projectiles 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) { @@ -3246,6 +3249,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) { @@ -3276,6 +3280,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) @@ -3312,7 +3332,7 @@ namespace CalamityMod.Projectiles { 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 @@ -3514,16 +3534,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; } } } @@ -4012,6 +4029,15 @@ namespace CalamityMod.Projectiles projectile.damage = 1; } + // Super Star Shooter has damage falloff + if (projectile.type == ProjectileID.SuperStar) + { + if (projectile.numHits > 0) + projectile.damage = (int)(projectile.damage * 0.95f); + if (projectile.damage < 1) + projectile.damage = 1; + } + // Stardust Wings buff the Stardust Guardian's damage if (player.wingsLogic == (int)VanillaWingID.WingsStardust && projectile.type == ProjectileID.StardustGuardian) modifiers.SourceDamage *= 2f; @@ -4244,7 +4270,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; diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 9431add264..1e8a7636c2 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(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.BulletHighVelocity, Do(PointBlank, 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) }, 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/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/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/SHPV.cs b/Projectiles/Magic/SHPV.cs index bb9a52caa4..8a9f05313e 100644 --- a/Projectiles/Magic/SHPV.cs +++ b/Projectiles/Magic/SHPV.cs @@ -87,7 +87,7 @@ 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); @@ -97,7 +97,19 @@ namespace CalamityMod.Projectiles.Magic 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/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/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/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/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/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/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/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/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/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/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/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/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 d9a48ebcd8..6ce0a50098 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -41,23 +41,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/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/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/HydrasBlood.cs b/Projectiles/Ranged/HydrasBlood.cs index ee78b8b6ae..c768f79f5d 100644 --- a/Projectiles/Ranged/HydrasBlood.cs +++ b/Projectiles/Ranged/HydrasBlood.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 5; Projectile.penetrate = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); diff --git a/Projectiles/Ranged/SproutingArrowMain.cs b/Projectiles/Ranged/SproutingArrowMain.cs index 4857e9db0d..38971fbaa1 100644 --- a/Projectiles/Ranged/SproutingArrowMain.cs +++ b/Projectiles/Ranged/SproutingArrowMain.cs @@ -59,7 +59,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; @@ -97,7 +97,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/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index ce88e9d5ee..3bded3c1c6 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,27 +107,23 @@ 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) + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(ModContent.BuffType(), 180); + OnHitEffect(target); + } + private void OnHitEffect(Entity target) { 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); + 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; @@ -136,12 +132,6 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - OnHitEffect(target.Center, target.width); - } - public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item9, Projectile.position); @@ -166,5 +156,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/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/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 76c782b4e5..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; } } diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index 5c4e1ebc5a..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; } } 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/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..fee710f9ef 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -151,14 +151,16 @@ namespace CalamityMod.Projectiles.Rogue { 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); + if (Main.myPlayer == Projectile.owner) + { + Projectile tooth = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnPos, jawVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack / 12, Projectile.owner, 0, Main.rand.Next(1, 3 + 1), Projectile.velocity.X > 0 ? 1 : -1); + tooth.Calamity().stealthStrike = true; + tooth.timeLeft = 120; + tooth.extraUpdates = 0; + tooth.usesLocalNPCImmunity = false; + tooth.usesIDStaticNPCImmunity = true; + tooth.idStaticNPCHitCooldown = 8; + } jawline = !jawline; } if (time % 2 == 0) @@ -229,9 +231,7 @@ namespace CalamityMod.Projectiles.Rogue 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 + if (!Projectile.Calamity().stealthStrike) modifiers.SourceDamage *= target == chosenTarget ? 1 : (canStick ? 0.2f : 0.5f); } public override bool? CanDamage() => canDamage ? null : false; 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/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/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 3107b69692..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)) 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/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 1b47c6a40a..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, 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/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/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index d306144ecb..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; } diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index d97715807b..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() { @@ -82,8 +83,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.ChargingMinionAI(Calamitamini.Range, Calamitamini.SeparationAnxietyMin, Calamitamini.SeparationAnxietyMax, Calamitamini.SafeDist, 0, 40f, 8f, 4f, new Vector2(0f, -60f), 40f, 8f, false, 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/GastricBelcher.cs b/Projectiles/Summon/GastricBelcher.cs index c4122ab978..c4523cdeee 100644 --- a/Projectiles/Summon/GastricBelcher.cs +++ b/Projectiles/Summon/GastricBelcher.cs @@ -163,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; } @@ -243,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; @@ -265,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; 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/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/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/SageNeedle.cs b/Projectiles/Summon/SageNeedle.cs index 0efecc2a3b..d5623a1134 100644 --- a/Projectiles/Summon/SageNeedle.cs +++ b/Projectiles/Summon/SageNeedle.cs @@ -41,13 +41,13 @@ 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. + // 1 slot provides 25 DoT. + // 2 slots provide 50 DoT. + // 3 slots provide 76 DoT. + // [...] + // 9 slots provide 240 DoT. int sagePoisonDamage = (int)(50 * averageDamageMultiplier); target.AddBuff(ModContent.BuffType(), 300); target.Calamity().sagePoisonDamage = sagePoisonDamage; diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 3369526d19..d9f2fb1c4b 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -82,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; } diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 49c7084efa..74f07ebcf7 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -165,15 +165,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; 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/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/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/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.wav b/Sounds/Custom/CalamitasClone/BulletHellEnding.wav index 3f54027802..252d500055 100644 Binary files a/Sounds/Custom/CalamitasClone/BulletHellEnding.wav and b/Sounds/Custom/CalamitasClone/BulletHellEnding.wav 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/Systems/Collections/NPCs/BossRushHPChangeDict.cs b/Systems/Collections/NPCs/BossRushHPChangeDict.cs index 61332ad1c5..452538f8b9 100644 --- a/Systems/Collections/NPCs/BossRushHPChangeDict.cs +++ b/Systems/Collections/NPCs/BossRushHPChangeDict.cs @@ -33,9 +33,9 @@ namespace CalamityMod.Systems.Collections { NPCID.EyeofCthulhu, 450000 }, // 30 seconds { NPCID.ServantofCthulhu, 6000 }, - { NPCID.EaterofWorldsHead, 10000 }, // 30 seconds + immunity timer at start - { NPCID.EaterofWorldsBody, 10000 }, - { NPCID.EaterofWorldsTail, 10000 }, + { NPCID.EaterofWorldsHead, 15000 }, // 30 seconds + immunity timer at start + { NPCID.EaterofWorldsBody, 15000 }, + { NPCID.EaterofWorldsTail, 15000 }, { NPCID.BrainofCthulhu, 100000 }, // 30 seconds with creepers { NPCID.Creeper, 10000 }, diff --git a/Systems/Collections/SharedStaticIFramesIDSet.cs b/Systems/Collections/SharedStaticIFramesIDSet.cs index b6495ebf96..c8a102b76d 100644 --- a/Systems/Collections/SharedStaticIFramesIDSet.cs +++ b/Systems/Collections/SharedStaticIFramesIDSet.cs @@ -35,19 +35,25 @@ namespace CalamityMod.Systems.Collections ProjectileID.VilethornTip ], - [ // Set 3: Harp notes + [ // Set 3: Nettle Burst + ProjectileID.NettleBurstLeft, + ProjectileID.NettleBurstRight, + ProjectileID.NettleBurstEnd + ], + + [ // Set 4: Harp notes ProjectileID.QuarterNote, ProjectileID.EighthNote, ProjectileID.TiedEighthNote ], - [ // Set 4: The North Pole + [ // Set 5: The North Pole ProjectileID.NorthPoleWeapon, ProjectileID.NorthPoleSpear, ProjectileID.NorthPoleSnowflake, ], - [ // Set 5: All spore gas clouds + [ // Set 6: All spore gas clouds ProjectileID.SporeTrap, ProjectileID.SporeTrap2, ProjectileID.SporeGas, @@ -55,12 +61,17 @@ namespace CalamityMod.Systems.Collections ProjectileID.SporeGas3 ], - [ // Set 6: Astral Staff + [ // Set 7: Astral Staff ModContent.ProjectileType(), ModContent.ProjectileType() ], - [ // Set 7: All toxic clouds + [ // Set 8: Keelhaul + ModContent.ProjectileType(), + ModContent.ProjectileType() + ], + + [ // Set 9: All toxic clouds ProjectileID.ToxicCloud, ProjectileID.ToxicCloud2, ProjectileID.ToxicCloud3 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/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/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));